go/src/expvar/expvar.go

type Var

type jsonVar

type Int

func (v *Int) Value() int64 {}

func (v *Int) String() string {}

func (v *Int) appendJSON(b []byte) []byte {}

func (v *Int) Add(delta int64) {}

func (v *Int) Set(value int64) {}

type Float

func (v *Float) Value() float64 {}

func (v *Float) String() string {}

func (v *Float) appendJSON(b []byte) []byte {}

// Add adds delta to v.
func (v *Float) Add(delta float64) {}

// Set sets v to value.
func (v *Float) Set(value float64) {}

type Map

type KeyValue

func (v *Map) String() string {}

func (v *Map) appendJSON(b []byte) []byte {}

func (v *Map) appendJSONMayExpand(b []byte, expand bool) []byte {}

// Init removes all keys from the map.
func (v *Map) Init() *Map {}

// addKey updates the sorted list of keys in v.keys.
func (v *Map) addKey(key string) {}

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

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

// Add adds delta to the *[Int] value stored under the given map key.
func (v *Map) Add(key string, delta int64) {}

// AddFloat adds delta to the *[Float] value stored under the given map key.
func (v *Map) AddFloat(key string, delta float64) {}

// Delete deletes the given key from the map.
func (v *Map) Delete(key string) {}

// Do calls f for each entry in the map.
// The map is locked during the iteration,
// but existing entries may be concurrently updated.
func (v *Map) Do(f func(KeyValue)) {}

type String

func (v *String) Value() string {}

// String implements the [Var] interface. To get the unquoted string
// use [String.Value].
func (v *String) String() string {}

func (v *String) appendJSON(b []byte) []byte {}

func (v *String) Set(value string) {}

type Func

func (f Func) Value() any {}

func (f Func) String() string {}

var vars

// 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.
func Publish(name string, v Var) {}

// Get retrieves a named exported variable. It returns nil if the name has
// not been registered.
func Get(name string) Var {}

func NewInt(name string) *Int {}

func NewFloat(name string) *Float {}

func NewMap(name string) *Map {}

func NewString(name string) *String {}

// Do calls f for each exported variable.
// The global variable map is locked during the iteration,
// but existing entries may be concurrently updated.
func Do(f func(KeyValue)) {}

func expvarHandler(w http.ResponseWriter, r *http.Request) {}

// Handler returns the expvar HTTP Handler.
//
// This is only needed to install the handler in a non-standard location.
func Handler() http.Handler {}

func cmdline() any {}

func memstats() any {}

func init() {}

// TODO: Use json.appendString instead.
func appendJSONQuote(b []byte, s string) []byte {}