summaryrefslogtreecommitdiff
path: root/devdocs/go/expvar%2Findex.html
diff options
context:
space:
mode:
Diffstat (limited to 'devdocs/go/expvar%2Findex.html')
-rw-r--r--devdocs/go/expvar%2Findex.html120
1 files changed, 120 insertions, 0 deletions
diff --git a/devdocs/go/expvar%2Findex.html b/devdocs/go/expvar%2Findex.html
new file mode 100644
index 00000000..fed3e6d1
--- /dev/null
+++ b/devdocs/go/expvar%2Findex.html
@@ -0,0 +1,120 @@
+<h1> Package expvar </h1> <ul id="short-nav">
+<li><code>import "expvar"</code></li>
+<li><a href="#pkg-overview" class="overviewLink">Overview</a></li>
+<li><a href="#pkg-index" class="indexLink">Index</a></li>
+</ul> <h2 id="pkg-overview">Overview </h2> <p>Package expvar provides a standardized interface to public variables, such as operation counters in servers. It exposes these variables via HTTP at /debug/vars in JSON format. </p>
+<p>Operations to set or modify these public variables are atomic. </p>
+<p>In addition to adding the HTTP handler, this package registers the following variables: </p>
+<pre data-language="go">cmdline os.Args
+memstats runtime.Memstats
+</pre> <p>The package is sometimes only imported for the side effect of registering its HTTP handler and the above variables. To use it this way, link this package into your program: </p>
+<pre data-language="go">import _ "expvar"
+</pre> <h2 id="pkg-index">Index </h2> <ul id="manual-nav">
+<li><a href="#Do">func Do(f func(KeyValue))</a></li>
+<li><a href="#Handler">func Handler() http.Handler</a></li>
+<li><a href="#Publish">func Publish(name string, v Var)</a></li>
+<li><a href="#Float">type Float</a></li>
+<li> <a href="#NewFloat">func NewFloat(name string) *Float</a>
+</li>
+<li> <a href="#Float.Add">func (v *Float) Add(delta float64)</a>
+</li>
+<li> <a href="#Float.Set">func (v *Float) Set(value float64)</a>
+</li>
+<li> <a href="#Float.String">func (v *Float) String() string</a>
+</li>
+<li> <a href="#Float.Value">func (v *Float) Value() float64</a>
+</li>
+<li><a href="#Func">type Func</a></li>
+<li> <a href="#Func.String">func (f Func) String() string</a>
+</li>
+<li> <a href="#Func.Value">func (f Func) Value() any</a>
+</li>
+<li><a href="#Int">type Int</a></li>
+<li> <a href="#NewInt">func NewInt(name string) *Int</a>
+</li>
+<li> <a href="#Int.Add">func (v *Int) Add(delta int64)</a>
+</li>
+<li> <a href="#Int.Set">func (v *Int) Set(value int64)</a>
+</li>
+<li> <a href="#Int.String">func (v *Int) String() string</a>
+</li>
+<li> <a href="#Int.Value">func (v *Int) Value() int64</a>
+</li>
+<li><a href="#KeyValue">type KeyValue</a></li>
+<li><a href="#Map">type Map</a></li>
+<li> <a href="#NewMap">func NewMap(name string) *Map</a>
+</li>
+<li> <a href="#Map.Add">func (v *Map) Add(key string, delta int64)</a>
+</li>
+<li> <a href="#Map.AddFloat">func (v *Map) AddFloat(key string, delta float64)</a>
+</li>
+<li> <a href="#Map.Delete">func (v *Map) Delete(key string)</a>
+</li>
+<li> <a href="#Map.Do">func (v *Map) Do(f func(KeyValue))</a>
+</li>
+<li> <a href="#Map.Get">func (v *Map) Get(key string) Var</a>
+</li>
+<li> <a href="#Map.Init">func (v *Map) Init() *Map</a>
+</li>
+<li> <a href="#Map.Set">func (v *Map) Set(key string, av Var)</a>
+</li>
+<li> <a href="#Map.String">func (v *Map) String() string</a>
+</li>
+<li><a href="#String">type String</a></li>
+<li> <a href="#NewString">func NewString(name string) *String</a>
+</li>
+<li> <a href="#String.Set">func (v *String) Set(value string)</a>
+</li>
+<li> <a href="#String.String">func (v *String) String() string</a>
+</li>
+<li> <a href="#String.Value">func (v *String) Value() string</a>
+</li>
+<li><a href="#Var">type Var</a></li>
+<li> <a href="#Get">func Get(name string) Var</a>
+</li>
+</ul> <h3>Package files</h3> <p> <span>expvar.go</span> </p> <h2 id="Do">func <span>Do</span> </h2> <pre data-language="go">func Do(f func(KeyValue))</pre> <p>Do calls f for each exported variable. The global variable map is locked during the iteration, but existing entries may be concurrently updated. </p>
+<h2 id="Handler">func <span>Handler</span> <span title="Added in Go 1.8">1.8</span> </h2> <pre data-language="go">func Handler() http.Handler</pre> <p>Handler returns the expvar HTTP Handler. </p>
+<p>This is only needed to install the handler in a non-standard location. </p>
+<h2 id="Publish">func <span>Publish</span> </h2> <pre data-language="go">func Publish(name string, v Var)</pre> <p>Publish declares a named exported variable. This should be called from a package's init function when it creates its Vars. If the name is already registered then this will log.Panic. </p>
+<h2 id="Float">type <span>Float</span> </h2> <p>Float is a 64-bit float variable that satisfies the <a href="#Var">Var</a> interface. </p>
+<pre data-language="go">type Float struct {
+ // contains filtered or unexported fields
+}
+</pre> <h3 id="NewFloat">func <span>NewFloat</span> </h3> <pre data-language="go">func NewFloat(name string) *Float</pre> <h3 id="Float.Add">func (*Float) <span>Add</span> </h3> <pre data-language="go">func (v *Float) Add(delta float64)</pre> <p>Add adds delta to v. </p>
+<h3 id="Float.Set">func (*Float) <span>Set</span> </h3> <pre data-language="go">func (v *Float) Set(value float64)</pre> <p>Set sets v to value. </p>
+<h3 id="Float.String">func (*Float) <span>String</span> </h3> <pre data-language="go">func (v *Float) String() string</pre> <h3 id="Float.Value">func (*Float) <span>Value</span> <span title="Added in Go 1.8">1.8</span> </h3> <pre data-language="go">func (v *Float) Value() float64</pre> <h2 id="Func">type <span>Func</span> </h2> <p>Func implements <a href="#Var">Var</a> by calling the function and formatting the returned value using JSON. </p>
+<pre data-language="go">type Func func() any</pre> <h3 id="Func.String">func (Func) <span>String</span> </h3> <pre data-language="go">func (f Func) String() string</pre> <h3 id="Func.Value">func (Func) <span>Value</span> <span title="Added in Go 1.8">1.8</span> </h3> <pre data-language="go">func (f Func) Value() any</pre> <h2 id="Int">type <span>Int</span> </h2> <p>Int is a 64-bit integer variable that satisfies the <a href="#Var">Var</a> interface. </p>
+<pre data-language="go">type Int struct {
+ // contains filtered or unexported fields
+}
+</pre> <h3 id="NewInt">func <span>NewInt</span> </h3> <pre data-language="go">func NewInt(name string) *Int</pre> <h3 id="Int.Add">func (*Int) <span>Add</span> </h3> <pre data-language="go">func (v *Int) Add(delta int64)</pre> <h3 id="Int.Set">func (*Int) <span>Set</span> </h3> <pre data-language="go">func (v *Int) Set(value int64)</pre> <h3 id="Int.String">func (*Int) <span>String</span> </h3> <pre data-language="go">func (v *Int) String() string</pre> <h3 id="Int.Value">func (*Int) <span>Value</span> <span title="Added in Go 1.8">1.8</span> </h3> <pre data-language="go">func (v *Int) Value() int64</pre> <h2 id="KeyValue">type <span>KeyValue</span> </h2> <p>KeyValue represents a single entry in a <a href="#Map">Map</a>. </p>
+<pre data-language="go">type KeyValue struct {
+ Key string
+ Value Var
+}
+</pre> <h2 id="Map">type <span>Map</span> </h2> <p>Map is a string-to-Var map variable that satisfies the <a href="#Var">Var</a> interface. </p>
+<pre data-language="go">type Map struct {
+ // contains filtered or unexported fields
+}
+</pre> <h3 id="NewMap">func <span>NewMap</span> </h3> <pre data-language="go">func NewMap(name string) *Map</pre> <h3 id="Map.Add">func (*Map) <span>Add</span> </h3> <pre data-language="go">func (v *Map) Add(key string, delta int64)</pre> <p>Add adds delta to the *<a href="#Int">Int</a> value stored under the given map key. </p>
+<h3 id="Map.AddFloat">func (*Map) <span>AddFloat</span> </h3> <pre data-language="go">func (v *Map) AddFloat(key string, delta float64)</pre> <p>AddFloat adds delta to the *<a href="#Float">Float</a> value stored under the given map key. </p>
+<h3 id="Map.Delete">func (*Map) <span>Delete</span> <span title="Added in Go 1.12">1.12</span> </h3> <pre data-language="go">func (v *Map) Delete(key string)</pre> <p>Delete deletes the given key from the map. </p>
+<h3 id="Map.Do">func (*Map) <span>Do</span> </h3> <pre data-language="go">func (v *Map) Do(f func(KeyValue))</pre> <p>Do calls f for each entry in the map. The map is locked during the iteration, but existing entries may be concurrently updated. </p>
+<h3 id="Map.Get">func (*Map) <span>Get</span> </h3> <pre data-language="go">func (v *Map) Get(key string) Var</pre> <h3 id="Map.Init">func (*Map) <span>Init</span> </h3> <pre data-language="go">func (v *Map) Init() *Map</pre> <p>Init removes all keys from the map. </p>
+<h3 id="Map.Set">func (*Map) <span>Set</span> </h3> <pre data-language="go">func (v *Map) Set(key string, av Var)</pre> <h3 id="Map.String">func (*Map) <span>String</span> </h3> <pre data-language="go">func (v *Map) String() string</pre> <h2 id="String">type <span>String</span> </h2> <p>String is a string variable, and satisfies the <a href="#Var">Var</a> interface. </p>
+<pre data-language="go">type String struct {
+ // contains filtered or unexported fields
+}
+</pre> <h3 id="NewString">func <span>NewString</span> </h3> <pre data-language="go">func NewString(name string) *String</pre> <h3 id="String.Set">func (*String) <span>Set</span> </h3> <pre data-language="go">func (v *String) Set(value string)</pre> <h3 id="String.String">func (*String) <span>String</span> </h3> <pre data-language="go">func (v *String) String() string</pre> <p>String implements the <a href="#Var">Var</a> interface. To get the unquoted string use <a href="#String.Value">String.Value</a>. </p>
+<h3 id="String.Value">func (*String) <span>Value</span> <span title="Added in Go 1.8">1.8</span> </h3> <pre data-language="go">func (v *String) Value() string</pre> <h2 id="Var">type <span>Var</span> </h2> <p>Var is an abstract type for all exported variables. </p>
+<pre data-language="go">type Var interface {
+ // String returns a valid JSON value for the variable.
+ // Types with String methods that do not return valid JSON
+ // (such as time.Time) must not be used as a Var.
+ String() string
+}</pre> <h3 id="Get">func <span>Get</span> </h3> <pre data-language="go">func Get(name string) Var</pre> <p>Get retrieves a named exported variable. It returns nil if the name has not been registered. </p><div class="_attribution">
+ <p class="_attribution-p">
+ &copy; Google, Inc.<br>Licensed under the Creative Commons Attribution License 3.0.<br>
+ <a href="http://golang.org/pkg/expvar/" class="_attribution-link">http://golang.org/pkg/expvar/</a>
+ </p>
+</div>