亚洲国产日韩欧美一区二区三区,精品亚洲国产成人av在线,国产99视频精品免视看7,99国产精品久久久久久久成人热,欧美日韩亚洲国产综合乱

目錄 搜尋
archive archive/tar archive/zip bufio bufio(緩存) builtin builtin(內(nèi)置包) bytes bytes(包字節(jié)) compress compress/bzip2(壓縮/bzip2) compress/flate(壓縮/flate) compress/gzip(壓縮/gzip) compress/lzw(壓縮/lzw) compress/zlib(壓縮/zlib) container container/heap(容器數(shù)據(jù)結(jié)構(gòu)heap) container/list(容器數(shù)據(jù)結(jié)構(gòu)list) container/ring(容器數(shù)據(jù)結(jié)構(gòu)ring) context context(上下文) crypto crypto(加密) crypto/aes(加密/aes) crypto/cipher(加密/cipher) crypto/des(加密/des) crypto/dsa(加密/dsa) crypto/ecdsa(加密/ecdsa) crypto/elliptic(加密/elliptic) crypto/hmac(加密/hmac) crypto/md5(加密/md5) crypto/rand(加密/rand) crypto/rc4(加密/rc4) crypto/rsa(加密/rsa) crypto/sha1(加密/sha1) crypto/sha256(加密/sha256) crypto/sha512(加密/sha512) crypto/subtle(加密/subtle) crypto/tls(加密/tls) crypto/x509(加密/x509) crypto/x509/pkix(加密/x509/pkix) database database/sql(數(shù)據(jù)庫/sql) database/sql/driver(數(shù)據(jù)庫/sql/driver) debug debug/dwarf(調(diào)試/dwarf) debug/elf(調(diào)試/elf) debug/gosym(調(diào)試/gosym) debug/macho(調(diào)試/macho) debug/pe(調(diào)試/pe) debug/plan9obj(調(diào)試/plan9obj) encoding encoding(編碼) encoding/ascii85(編碼/ascii85) encoding/asn1(編碼/asn1) encoding/base32(編碼/base32) encoding/base64(編碼/base64) encoding/binary(編碼/binary) encoding/csv(編碼/csv) encoding/gob(編碼/gob) encoding/hex(編碼/hex) encoding/json(編碼/json) encoding/pem(編碼/pem) encoding/xml(編碼/xml) errors errors(錯誤) expvar expvar flag flag(命令行參數(shù)解析flag包) fmt fmt go go/ast(抽象語法樹) go/build go/constant(常量) go/doc(文檔) go/format(格式) go/importer go/parser go/printer go/scanner(掃描儀) go/token(令牌) go/types(類型) hash hash(散列) hash/adler32 hash/crc32 hash/crc64 hash/fnv html html html/template(模板) image image(圖像) image/color(顏色) image/color/palette(調(diào)色板) image/draw(繪圖) image/gif image/jpeg image/png index index/suffixarray io io io/ioutil log log log/syslog(日志系統(tǒng)) math math math/big math/big math/bits math/bits math/cmplx math/cmplx math/rand math/rand mime mime mime/multipart(多部分) mime/quotedprintable net net net/http net/http net/http/cgi net/http/cookiejar net/http/fcgi net/http/httptest net/http/httptrace net/http/httputil net/http/internal net/http/pprof net/mail net/mail net/rpc net/rpc net/rpc/jsonrpc net/smtp net/smtp net/textproto net/textproto net/url net/url os os os/exec os/signal os/user path path path/filepath(文件路徑) plugin plugin(插件) reflect reflect(反射) regexp regexp(正則表達(dá)式) regexp/syntax runtime runtime(運行時) runtime/debug(調(diào)試) runtime/internal/sys runtime/pprof runtime/race(競爭) runtime/trace(執(zhí)行追蹤器) sort sort(排序算法) strconv strconv(轉(zhuǎn)換) strings strings(字符串) sync sync(同步) sync/atomic(原子操作) syscall syscall(系統(tǒng)調(diào)用) testing testing(測試) testing/iotest testing/quick text text/scanner(掃描文本) text/tabwriter text/template(定義模板) text/template/parse time time(時間戳) unicode unicode unicode/utf16 unicode/utf8 unsafe unsafe
文字

  • import "expvar"

  • 概述

  • 索引

概述

軟件包 expvar 為公共變量提供了標(biāo)準(zhǔn)化接口,如服務(wù)器中的操作計數(shù)器。它以 JSON 格式在 /debug/vars 中通過 HTTP 公開這些變量。

設(shè)置或修改這些公共變量的操作是原子操作。

除了添加 HTTP 處理程序之外,該程序包還會注冊以下變量:

cmdline   os.Args
memstats  runtime.Memstats

該包有時只是為了注冊 HTTP 處理程序和上述變量的副作用而導(dǎo)入。要以這種方式使用,請將此程序包鏈接到您的程序中:

import _ "expvar"

索引

  • func Do(f func(KeyValue))

  • func Handler() http.Handler

  • func Publish(name string, v Var)

  • type Float

  • func NewFloat(name string) *Float

  • func (v *Float) Add(delta float64)

  • func (v *Float) Set(value float64)

  • func (v *Float) String() string

  • func (v *Float) Value() float64

  • type Func

  • func (f Func) String() string

  • func (f Func) Value() interface{}

  • type Int

  • func NewInt(name string) *Int

  • func (v *Int) Add(delta int64)

  • func (v *Int) Set(value int64)

  • func (v *Int) String() string

  • func (v *Int) Value() int64

  • type KeyValue

  • type Map

  • func NewMap(name string) *Map

  • func (v *Map) Add(key string, delta int64)

  • func (v *Map) AddFloat(key string, delta float64)

  • func (v *Map) Do(f func(KeyValue))

  • func (v *Map) Get(key string) Var

  • func (v *Map) Init() *Map

  • func (v *Map) Set(key string, av Var)

  • func (v *Map) String() string

  • type String

  • func NewString(name string) *String

  • func (v *String) Set(value string)

  • func (v *String) String() string

  • func (v *String) Value() string

  • type Var

  • func Get(name string) Var

包文件

expvar.go

func Do

func Do(f func(KeyValue))

對每個導(dǎo)出的變量都調(diào)用 f 。全局變量映射在迭代期間被鎖定,但現(xiàn)有條目可能會同時更新。

func Handler

func Handler() http.Handler

處理程序返回expvar HTTP處理程序。

這只需要將處理程序安裝在非標(biāo)準(zhǔn)位置。

func Publish

func Publish(name string, v Var)

發(fā)布聲明一個命名的導(dǎo)出變量。這應(yīng)該在創(chuàng)建其變量時從包的 init 函數(shù)中調(diào)用。如果名稱已經(jīng)注冊,那么這將會 log.Panic。

type Float

Float 是一個滿足 Var 接口的64位浮點型變量。

type Float struct {        // 包含已過濾或未導(dǎo)出的字段}

func NewFloat

func NewFloat(name string) *Float

func (*Float) Add

func (v *Float) Add(delta float64)

添加將增量添加到v。

func (*Float) Set

func (v *Float) Set(value float64)

將v設(shè)置為值。

func (*Float) String

func (v *Float) String() string

func (*Float) Value

func (v *Float) Value() float64

type Func

Func 通過調(diào)用函數(shù)并使用 JSON 格式化返回的值來實現(xiàn) Var。

type Func func() interface{}

func (Func) String

func (f Func) String() string

func (Func) Value

func (f Func) Value() interface{}

type Int

Int 是一個滿足 Var 接口的64位整數(shù)變量。

type Int struct {        // 包含已過濾或未導(dǎo)出的字段}

func NewInt

func NewInt(name string) *Int

func (*Int) Add

func (v *Int) Add(delta int64)

func (*Int) Set

func (v *Int) Set(value int64)

func (*Int) String

func (v *Int) String() string

func (*Int) Value

func (v *Int) Value() int64

type KeyValue

KeyValue 表示 Map 中的單個條目。

type KeyValue struct {
        Key   string
        Value Var}

type Map

Map 是一個滿足 Var 接口的字符串到 Var 映射變量。

type Map struct {        // 包含已過濾或未導(dǎo)出的字段}

func NewMap

func NewMap(name string) *Map

func (*Map) Add

func (v *Map) Add(key string, delta int64)

添加將增量添加到存儲在給定映射鍵下的 *Int 值。

func (*Map) AddFloat

func (v *Map) AddFloat(key string, delta float64)

AddFloat 將增量添加到存儲在給定映射關(guān)鍵字下的 *Float值。

func (*Map) Do

func (v *Map) Do(f func(KeyValue))

請為地圖中的每個條目調(diào)用 f 。迭代期間地圖被鎖定,但現(xiàn)有條目可能會同時更新。

func (*Map) Get

func (v *Map) Get(key string) Var

func (*Map) Init

func (v *Map) Init() *Map

Init 從地圖上刪除所有密鑰。

func (*Map) Set

func (v *Map) Set(key string, av Var)

func (*Map) String

func (v *Map) String() string

type String

字符串是一個字符串變量,并且滿足 Var 接口。

type String struct {        // 包含已過濾或未導(dǎo)出的字段}

func NewString

func NewString(name string) *String

func (*String) Set

func (v *String) Set(value string)

func (*String) String

func (v *String) String() string

字符串實現(xiàn) Val 接口。要獲取未加引號的字符串,請使用 Value。

func (*String) Value

func (v *String) Value() string

type Var

Var是所有導(dǎo)出變量的抽象類型。

type Var interface {        // String返回變量的有效JSON值。        // 具有不返回有效JSON的String方法的類型        // (例如time.Time)不能用作Var。        String() string}

func Get

func Get(name string) Var

獲取一個命名的導(dǎo)出變量。如果名稱尚未注冊,則返回 nil。

上一篇: 下一篇: