<ruby id="bdb3f"></ruby>

    <p id="bdb3f"><cite id="bdb3f"></cite></p>

      <p id="bdb3f"><cite id="bdb3f"><th id="bdb3f"></th></cite></p><p id="bdb3f"></p>
        <p id="bdb3f"><cite id="bdb3f"></cite></p>

          <pre id="bdb3f"></pre>
          <pre id="bdb3f"><del id="bdb3f"><thead id="bdb3f"></thead></del></pre>

          <ruby id="bdb3f"><mark id="bdb3f"></mark></ruby><ruby id="bdb3f"></ruby>
          <pre id="bdb3f"><pre id="bdb3f"><mark id="bdb3f"></mark></pre></pre><output id="bdb3f"></output><p id="bdb3f"></p><p id="bdb3f"></p>

          <pre id="bdb3f"><del id="bdb3f"><progress id="bdb3f"></progress></del></pre>

                <ruby id="bdb3f"></ruby>

                ??碼云GVP開源項目 12k star Uniapp+ElementUI 功能強大 支持多語言、二開方便! 廣告
                # package expvar `import "expvar"` expvar包提供了公共變量的標準接口,如服務的操作計數器。本包通過HTTP在/debug/vars位置以JSON格式導出了這些變量。 對這些公共變量的讀寫操作都是原子級的。 為了增加HTTP處理器,本包注冊了如下變量: ``` cmdline os.Args memstats runtime.Memstats ``` 有時候本包被導入只是為了獲得本包注冊HTTP處理器和上述變量的副作用。此時可以如下方式導入本包: ``` import _ "expvar" ``` ## Index * [type Var](#Var) * [type Int](#Int) * [func NewInt(name string) \*Int](#NewInt) * [func (v \*Int) Add(delta int64)](#Int.Add) * [func (v \*Int) Set(value int64)](#Int.Set) * [func (v \*Int) String() string](#Int.String) * [type Float](#Float) * [func NewFloat(name string) \*Float](#NewFloat) * [func (v \*Float) Add(delta float64)](#Float.Add) * [func (v \*Float) Set(value float64)](#Float.Set) * [func (v \*Float) String() string](#Float.String) * [type String](#String) * [func NewString(name string) \*String](#NewString) * [func (v \*String) Set(value string)](#String.Set) * [func (v \*String) String() string](#String.String) * [type Func](#Func) * [func (f Func) String() string](#Func.String) * [type KeyValue](#KeyValue) * [type Map](#Map) * [func NewMap(name string) \*Map](#NewMap) * [func (v \*Map) Init() \*Map](#Map.Init) * [func (v \*Map) Get(key string) Var](#Map.Get) * [func (v \*Map) Set(key string, av Var)](#Map.Set) * [func (v \*Map) Add(key string, delta int64)](#Map.Add) * [func (v \*Map) AddFloat(key string, delta float64)](#Map.AddFloat) * [func (v \*Map) Do(f func(KeyValue))](#Map.Do) * [func (v \*Map) String() string](#Map.String) * [func Get(name string) Var](#Get) * [func Publish(name string, v Var)](#Publish) * [func Do(f func(KeyValue))](#Do) ## type [Var](https://github.com/golang/go/blob/master/src/expvar/expvar.go#L38 "View Source") ``` type Var interface { String() string } ``` Var接口是所有導出變量的抽象類型。 ## type [Int](https://github.com/golang/go/blob/master/src/expvar/expvar.go#L43 "View Source") ``` type Int struct { // 內含隱藏或非導出字段 } ``` Int代表一個64位整數變量,滿足Var接口。 ### func [NewInt](https://github.com/golang/go/blob/master/src/expvar/expvar.go#L273 "View Source") ``` func NewInt(name string) *Int ``` ### func (\*Int) [Add](https://github.com/golang/go/blob/master/src/expvar/expvar.go#L54 "View Source") ``` func (v *Int) Add(delta int64) ``` ### func (\*Int) [Set](https://github.com/golang/go/blob/master/src/expvar/expvar.go#L60 "View Source") ``` func (v *Int) Set(value int64) ``` ### func (\*Int) [String](https://github.com/golang/go/blob/master/src/expvar/expvar.go#L48 "View Source") ``` func (v *Int) String() string ``` ## type [Float](https://github.com/golang/go/blob/master/src/expvar/expvar.go#L67 "View Source") ``` type Float struct { // 內含隱藏或非導出字段 } ``` Float代表一個64位浮點數變量,滿足Var接口。 ### func [NewFloat](https://github.com/golang/go/blob/master/src/expvar/expvar.go#L279 "View Source") ``` func NewFloat(name string) *Float ``` ### func (\*Float) [Add](https://github.com/golang/go/blob/master/src/expvar/expvar.go#L79 "View Source") ``` func (v *Float) Add(delta float64) ``` Add adds delta to v. ### func (\*Float) [Set](https://github.com/golang/go/blob/master/src/expvar/expvar.go#L86 "View Source") ``` func (v *Float) Set(value float64) ``` Set sets v to value. ### func (\*Float) [String](https://github.com/golang/go/blob/master/src/expvar/expvar.go#L72 "View Source") ``` func (v *Float) String() string ``` ## type [String](https://github.com/golang/go/blob/master/src/expvar/expvar.go#L217 "View Source") ``` type String struct { // 內含隱藏或非導出字段 } ``` String代表一個字符串變量,滿足Var接口。 ### func [NewString](https://github.com/golang/go/blob/master/src/expvar/expvar.go#L291 "View Source") ``` func NewString(name string) *String ``` ### func (\*String) [Set](https://github.com/golang/go/blob/master/src/expvar/expvar.go#L228 "View Source") ``` func (v *String) Set(value string) ``` ### func (\*String) [String](https://github.com/golang/go/blob/master/src/expvar/expvar.go#L222 "View Source") ``` func (v *String) String() string ``` ## type [Func](https://github.com/golang/go/blob/master/src/expvar/expvar.go#L236 "View Source") ``` type Func func() interface{} ``` Func通過調用函數并將結果編碼為json,實現了Var接口。 ### func (Func) [String](https://github.com/golang/go/blob/master/src/expvar/expvar.go#L238 "View Source") ``` func (f Func) String() string ``` ## type [KeyValue](https://github.com/golang/go/blob/master/src/expvar/expvar.go#L100 "View Source") ``` type KeyValue struct { Key string Value Var } ``` KeyValue代表Map中的一條記錄。(鍵值對) ## type [Map](https://github.com/golang/go/blob/master/src/expvar/expvar.go#L93 "View Source") ``` type Map struct { // 內含隱藏或非導出字段 } ``` Map代表一個string到Var的映射變量,滿足Var接口。 ### func [NewMap](https://github.com/golang/go/blob/master/src/expvar/expvar.go#L285 "View Source") ``` func NewMap(name string) *Map ``` ### func (\*Map) [Init](https://github.com/golang/go/blob/master/src/expvar/expvar.go#L122 "View Source") ``` func (v *Map) Init() *Map ``` ### func (\*Map) [Get](https://github.com/golang/go/blob/master/src/expvar/expvar.go#L141 "View Source") ``` func (v *Map) Get(key string) Var ``` ### func (\*Map) [Set](https://github.com/golang/go/blob/master/src/expvar/expvar.go#L147 "View Source") ``` func (v *Map) Set(key string, av Var) ``` ### func (\*Map) [Add](https://github.com/golang/go/blob/master/src/expvar/expvar.go#L154 "View Source") ``` func (v *Map) Add(key string, delta int64) ``` ### func (\*Map) [AddFloat](https://github.com/golang/go/blob/master/src/expvar/expvar.go#L177 "View Source") ``` func (v *Map) AddFloat(key string, delta float64) ``` AddFloat向索引key對應的值(底層為\*Float)修改為加上delta后的值。 ### func (\*Map) [Do](https://github.com/golang/go/blob/master/src/expvar/expvar.go#L202 "View Source") ``` func (v *Map) Do(f func(KeyValue)) ``` Do對映射的每一條記錄都調用f。迭代執行時會鎖定該映射,但已存在的記錄可以同時更新。 ### func (\*Map) [String](https://github.com/golang/go/blob/master/src/expvar/expvar.go#L105 "View Source") ``` func (v *Map) String() string ``` ## func [Get](https://github.com/golang/go/blob/master/src/expvar/expvar.go#L265 "View Source") ``` func Get(name string) Var ``` Get獲取名為name的導出變量。 ## func [Publish](https://github.com/golang/go/blob/master/src/expvar/expvar.go#L253 "View Source") ``` func Publish(name string, v Var) ``` Publish聲明一個導出變量。必須在init函數里調用。如果name已經被注冊,會調用log.Panic。 ## func [Do](https://github.com/golang/go/blob/master/src/expvar/expvar.go#L300 "View Source") ``` func Do(f func(KeyValue)) ``` Do對導出變量的每一條記錄都調用f。迭代執行時會鎖定全局變量映射,但已存在的記錄可以同時更新。
                  <ruby id="bdb3f"></ruby>

                  <p id="bdb3f"><cite id="bdb3f"></cite></p>

                    <p id="bdb3f"><cite id="bdb3f"><th id="bdb3f"></th></cite></p><p id="bdb3f"></p>
                      <p id="bdb3f"><cite id="bdb3f"></cite></p>

                        <pre id="bdb3f"></pre>
                        <pre id="bdb3f"><del id="bdb3f"><thead id="bdb3f"></thead></del></pre>

                        <ruby id="bdb3f"><mark id="bdb3f"></mark></ruby><ruby id="bdb3f"></ruby>
                        <pre id="bdb3f"><pre id="bdb3f"><mark id="bdb3f"></mark></pre></pre><output id="bdb3f"></output><p id="bdb3f"></p><p id="bdb3f"></p>

                        <pre id="bdb3f"><del id="bdb3f"><progress id="bdb3f"></progress></del></pre>

                              <ruby id="bdb3f"></ruby>

                              哎呀哎呀视频在线观看