package expvar

Import Path
	expvar (on go.dev)

Dependency Relation
	imports 12 packages, and imported by one package

Involved Source Files 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. Operations to set or modify these public variables are atomic. In addition to adding the HTTP handler, this package registers the following variables: cmdline os.Args memstats runtime.Memstats 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: import _ "expvar"
Package-Level Type Names (total 7, all are exported)
/* sort exporteds by: | */
Float is a 64-bit float variable that satisfies the Var interface. Add adds delta to v. Set sets v to value. (*Float) String() string (*Float) Value() float64 *Float : Var *Float : fmt.Stringer func NewFloat(name string) *Float
Func implements Var by calling the function and formatting the returned value using JSON. ( Func) String() string ( Func) Value() any Func : Var Func : fmt.Stringer
Int is a 64-bit integer variable that satisfies the Var interface. (*Int) Add(delta int64) (*Int) Set(value int64) (*Int) String() string (*Int) Value() int64 *Int : Var *Int : fmt.Stringer func NewInt(name string) *Int
KeyValue represents a single entry in a Map. Key string Value Var
Map is a string-to-Var map variable that satisfies the Var interface. Add adds delta to the *Int value stored under the given map key. AddFloat adds delta to the *Float value stored under the given map key. Delete deletes the given key from the map. Do calls f for each entry in the map. The map is locked during the iteration, but existing entries may be concurrently updated. (*Map) Get(key string) Var Init removes all keys from the map. (*Map) Set(key string, av Var) (*Map) String() string *Map : Var *Map : fmt.Stringer func NewMap(name string) *Map func (*Map).Init() *Map
String is a string variable, and satisfies the Var interface. (*String) Set(value string) String implements the Var interface. To get the unquoted string use Value. (*String) Value() string *String : Var *String : fmt.Stringer func NewString(name string) *String
Var is an abstract type for all exported variables. ( Var) String() string *Float Func *Int *Map *String *bytes.Buffer crypto.Hash crypto/tls.ClientAuthType crypto/tls.CurveID crypto/tls.SignatureScheme crypto/x509.PublicKeyAlgorithm crypto/x509.SignatureAlgorithm crypto/x509/pkix.Name crypto/x509/pkix.RDNSequence database/sql.IsolationLevel encoding/asn1.ObjectIdentifier encoding/binary.ByteOrder (interface) encoding/json.Delim encoding/json.Number flag.Getter (interface) flag.Value (interface) fmt.Stringer (interface) github.com/aws/aws-sdk-go-v2/aws.RetryMode github.com/aws/aws-sdk-go-v2/aws.Ternary github.com/aws/aws-sdk-go-v2/aws/arn.ARN github.com/aws/aws-sdk-go-v2/aws/protocol/eventstream.BoolValue github.com/aws/aws-sdk-go-v2/aws/protocol/eventstream.BytesValue github.com/aws/aws-sdk-go-v2/aws/protocol/eventstream.Int16Value github.com/aws/aws-sdk-go-v2/aws/protocol/eventstream.Int32Value github.com/aws/aws-sdk-go-v2/aws/protocol/eventstream.Int64Value github.com/aws/aws-sdk-go-v2/aws/protocol/eventstream.Int8Value github.com/aws/aws-sdk-go-v2/aws/protocol/eventstream.StringValue github.com/aws/aws-sdk-go-v2/aws/protocol/eventstream.TimestampValue github.com/aws/aws-sdk-go-v2/aws/protocol/eventstream.UUIDValue github.com/aws/aws-sdk-go-v2/aws/protocol/eventstream.Value (interface) github.com/aws/aws-sdk-go-v2/aws/signer/internal/v4.SigningTime github.com/aws/aws-sdk-go-v2/internal/v4a/internal/v4.SigningTime github.com/aws/aws-sdk-go-v2/service/internal/checksum.Algorithm github.com/aws/aws-sdk-go-v2/service/internal/s3shared/arn.AccessPointARN github.com/aws/aws-sdk-go-v2/service/internal/s3shared/arn.OutpostAccessPointARN github.com/aws/aws-sdk-go-v2/service/internal/s3shared/arn.OutpostARN (interface) github.com/aws/aws-sdk-go-v2/service/internal/s3shared/arn.OutpostBucketARN github.com/aws/aws-sdk-go-v2/service/internal/s3shared/arn.Resource (interface) github.com/aws/aws-sdk-go-v2/service/internal/s3shared/arn.S3ObjectLambdaAccessPointARN github.com/aws/aws-sdk-go-v2/service/internal/s3shared/arn.S3ObjectLambdaARN (interface) github.com/aws/smithy-go.ErrorFault github.com/aws/smithy-go/document.Number github.com/aws/smithy-go/encoding/xml.Encoder *github.com/aws/smithy-go/middleware.Stack *github.com/go-pg/migrations/v8.Migration *github.com/go-pg/pg/v10.DB *github.com/go-pg/pg/v10.Listener *github.com/go-pg/pg/v10/orm.CreateCompositeQuery *github.com/go-pg/pg/v10/orm.CreateTableQuery *github.com/go-pg/pg/v10/orm.DeleteQuery *github.com/go-pg/pg/v10/orm.DropCompositeQuery *github.com/go-pg/pg/v10/orm.DropTableQuery *github.com/go-pg/pg/v10/orm.Formatter *github.com/go-pg/pg/v10/orm.InsertQuery github.com/go-pg/pg/v10/orm.QueryCommand (interface) *github.com/go-pg/pg/v10/orm.Relation *github.com/go-pg/pg/v10/orm.SelectQuery *github.com/go-pg/pg/v10/orm.Table *github.com/go-pg/pg/v10/orm.UpdateQuery github.com/go-pg/pg/v10/types.NullTime *github.com/golang/mock/gomock.Call github.com/golang/mock/gomock.Matcher (interface) github.com/golang/mock/gomock.StringerFunc *github.com/golang/protobuf/proto.Properties github.com/golang/protobuf/ptypes.DynamicAny github.com/google/go-cmp/cmp.Indirect github.com/google/go-cmp/cmp.MapIndex github.com/google/go-cmp/cmp.Options github.com/google/go-cmp/cmp.Path github.com/google/go-cmp/cmp.PathStep (interface) github.com/google/go-cmp/cmp.SliceIndex github.com/google/go-cmp/cmp.StructField github.com/google/go-cmp/cmp.Transform github.com/google/go-cmp/cmp.TypeAssertion github.com/google/go-cmp/cmp/internal/diff.EditScript *github.com/valyala/fastjson.Object github.com/valyala/fastjson.Type *github.com/valyala/fastjson.Value *github.com/vmihailenco/bufpool.Buffer go.pact.im/x/phcformat.Hash *go.uber.org/atomic.Bool *go.uber.org/atomic.Duration *go.uber.org/atomic.Float32 *go.uber.org/atomic.Float64 *go.uber.org/atomic.Int32 *go.uber.org/atomic.Int64 *go.uber.org/atomic.String *go.uber.org/atomic.Uint32 *go.uber.org/atomic.Uint64 *go.uber.org/atomic.Uintptr go.uber.org/goleak/internal/stack.Stack go.uber.org/zap.AtomicLevel *go.uber.org/zap/buffer.Buffer go.uber.org/zap/zapcore.EntryCaller go.uber.org/zap/zapcore.Level go/ast.CommentMap *go/ast.Ident go/ast.ObjKind *go/ast.Scope *go/build/constraint.AndExpr go/build/constraint.Expr (interface) *go/build/constraint.NotExpr *go/build/constraint.OrExpr *go/build/constraint.TagExpr go/constant.Kind go/constant.Value (interface) go/token.Position go/token.Token *go/types.Array *go/types.Basic *go/types.Builtin *go/types.Chan *go/types.Const *go/types.Func *go/types.Initializer *go/types.Interface *go/types.Label *go/types.Map *go/types.MethodSet *go/types.Named *go/types.Nil go/types.Object (interface) *go/types.Package *go/types.PkgName *go/types.Pointer *go/types.Scope *go/types.Selection *go/types.Signature *go/types.Slice *go/types.Struct *go/types.Term *go/types.Tuple go/types.Type (interface) *go/types.TypeName *go/types.TypeParam *go/types.Union *go/types.Var golang.org/x/exp/apidiff.Report golang.org/x/net/http2.ContinuationFrame golang.org/x/net/http2.DataFrame golang.org/x/net/http2.ErrCode golang.org/x/net/http2.FrameHeader golang.org/x/net/http2.FrameType golang.org/x/net/http2.FrameWriteRequest golang.org/x/net/http2.GoAwayFrame golang.org/x/net/http2.HeadersFrame golang.org/x/net/http2.MetaHeadersFrame golang.org/x/net/http2.PingFrame golang.org/x/net/http2.PriorityFrame golang.org/x/net/http2.PushPromiseFrame golang.org/x/net/http2.RSTStreamFrame golang.org/x/net/http2.Setting golang.org/x/net/http2.SettingID golang.org/x/net/http2.SettingsFrame golang.org/x/net/http2.UnknownFrame golang.org/x/net/http2.WindowUpdateFrame golang.org/x/net/http2/hpack.HeaderField *golang.org/x/net/idna.Profile *golang.org/x/net/internal/timeseries.Float *golang.org/x/text/unicode/bidi.Run golang.org/x/tools/go/packages.LoadMode *golang.org/x/tools/go/packages.Package *golang.org/x/tools/internal/pkgbits.Decoder golang.org/x/tools/internal/pkgbits.SyncMarker golang.org/x/tools/internal/typesinternal.ErrorCode *google.golang.org/genproto/googleapis/rpc/status.Status google.golang.org/grpc.Codec (interface) *google.golang.org/grpc/binarylog/grpc_binarylog_v1.Address google.golang.org/grpc/binarylog/grpc_binarylog_v1.Address_Type *google.golang.org/grpc/binarylog/grpc_binarylog_v1.ClientHeader *google.golang.org/grpc/binarylog/grpc_binarylog_v1.GrpcLogEntry google.golang.org/grpc/binarylog/grpc_binarylog_v1.GrpcLogEntry_EventType google.golang.org/grpc/binarylog/grpc_binarylog_v1.GrpcLogEntry_Logger *google.golang.org/grpc/binarylog/grpc_binarylog_v1.Message *google.golang.org/grpc/binarylog/grpc_binarylog_v1.Metadata *google.golang.org/grpc/binarylog/grpc_binarylog_v1.MetadataEntry *google.golang.org/grpc/binarylog/grpc_binarylog_v1.ServerHeader *google.golang.org/grpc/binarylog/grpc_binarylog_v1.Trailer google.golang.org/grpc/codes.Code google.golang.org/grpc/connectivity.ServingMode google.golang.org/grpc/connectivity.State google.golang.org/grpc/credentials.SecurityLevel *google.golang.org/grpc/internal/channelz.Identifier google.golang.org/grpc/internal/channelz.RefChannelType *google.golang.org/grpc/internal/status.Status google.golang.org/grpc/resolver.Address google.golang.org/protobuf/internal/encoding/json.Kind google.golang.org/protobuf/internal/encoding/text.Kind google.golang.org/protobuf/internal/encoding/text.NameKind google.golang.org/protobuf/internal/impl.ValidationStatus google.golang.org/protobuf/reflect/protoreflect.Cardinality google.golang.org/protobuf/reflect/protoreflect.Kind google.golang.org/protobuf/reflect/protoreflect.MapKey google.golang.org/protobuf/reflect/protoreflect.SourcePath google.golang.org/protobuf/reflect/protoreflect.Syntax google.golang.org/protobuf/reflect/protoreflect.Value google.golang.org/protobuf/runtime/protoiface.MessageV1 (interface) *google.golang.org/protobuf/types/descriptorpb.DescriptorProto *google.golang.org/protobuf/types/descriptorpb.DescriptorProto_ExtensionRange *google.golang.org/protobuf/types/descriptorpb.DescriptorProto_ReservedRange *google.golang.org/protobuf/types/descriptorpb.EnumDescriptorProto *google.golang.org/protobuf/types/descriptorpb.EnumDescriptorProto_EnumReservedRange *google.golang.org/protobuf/types/descriptorpb.EnumOptions *google.golang.org/protobuf/types/descriptorpb.EnumValueDescriptorProto *google.golang.org/protobuf/types/descriptorpb.EnumValueOptions *google.golang.org/protobuf/types/descriptorpb.ExtensionRangeOptions *google.golang.org/protobuf/types/descriptorpb.FieldDescriptorProto google.golang.org/protobuf/types/descriptorpb.FieldDescriptorProto_Label google.golang.org/protobuf/types/descriptorpb.FieldDescriptorProto_Type *google.golang.org/protobuf/types/descriptorpb.FieldOptions google.golang.org/protobuf/types/descriptorpb.FieldOptions_CType google.golang.org/protobuf/types/descriptorpb.FieldOptions_JSType *google.golang.org/protobuf/types/descriptorpb.FileDescriptorProto *google.golang.org/protobuf/types/descriptorpb.FileDescriptorSet *google.golang.org/protobuf/types/descriptorpb.FileOptions google.golang.org/protobuf/types/descriptorpb.FileOptions_OptimizeMode *google.golang.org/protobuf/types/descriptorpb.GeneratedCodeInfo *google.golang.org/protobuf/types/descriptorpb.GeneratedCodeInfo_Annotation *google.golang.org/protobuf/types/descriptorpb.MessageOptions *google.golang.org/protobuf/types/descriptorpb.MethodDescriptorProto *google.golang.org/protobuf/types/descriptorpb.MethodOptions google.golang.org/protobuf/types/descriptorpb.MethodOptions_IdempotencyLevel *google.golang.org/protobuf/types/descriptorpb.OneofDescriptorProto *google.golang.org/protobuf/types/descriptorpb.OneofOptions *google.golang.org/protobuf/types/descriptorpb.ServiceDescriptorProto *google.golang.org/protobuf/types/descriptorpb.ServiceOptions *google.golang.org/protobuf/types/descriptorpb.SourceCodeInfo *google.golang.org/protobuf/types/descriptorpb.SourceCodeInfo_Location *google.golang.org/protobuf/types/descriptorpb.UninterpretedOption *google.golang.org/protobuf/types/descriptorpb.UninterpretedOption_NamePart *google.golang.org/protobuf/types/known/anypb.Any *google.golang.org/protobuf/types/known/durationpb.Duration *google.golang.org/protobuf/types/known/timestamppb.Timestamp *internal/profile.Profile internal/reflectlite.Kind internal/reflectlite.Type (interface) io/fs.FileMode math/big.Accuracy *math/big.Float *math/big.Int *math/big.Rat math/big.RoundingMode net.Addr (interface) net.Flags net.HardwareAddr net.IP *net.IPAddr net.IPMask *net.IPNet *net.TCPAddr *net.UDPAddr *net.UnixAddr net/http.ConnState *net/http.Cookie net/netip.Addr net/netip.AddrPort net/netip.Prefix *net/url.URL *net/url.Userinfo *os.ProcessState os.Signal (interface) *os/exec.Cmd os/exec.ExitError reflect.ChanDir reflect.Kind reflect.Type (interface) reflect.Value *regexp.Regexp regexp/syntax.ErrorCode *regexp/syntax.Inst regexp/syntax.InstOp regexp/syntax.Op *regexp/syntax.Prog *regexp/syntax.Regexp *runtime/debug.BuildInfo *strings.Builder syscall.Signal testing.BenchmarkResult *text/template/parse.ActionNode *text/template/parse.BoolNode *text/template/parse.BranchNode *text/template/parse.BreakNode *text/template/parse.ChainNode *text/template/parse.CommandNode *text/template/parse.CommentNode *text/template/parse.ContinueNode *text/template/parse.DotNode *text/template/parse.FieldNode *text/template/parse.IdentifierNode *text/template/parse.IfNode *text/template/parse.ListNode *text/template/parse.NilNode text/template/parse.Node (interface) *text/template/parse.NumberNode *text/template/parse.PipeNode *text/template/parse.RangeNode *text/template/parse.StringNode *text/template/parse.TemplateNode *text/template/parse.TextNode *text/template/parse.VariableNode *text/template/parse.WithNode time.Duration *time.Location time.Month time.Time time.Weekday vendor/golang.org/x/net/dns/dnsmessage.Class vendor/golang.org/x/net/dns/dnsmessage.Name vendor/golang.org/x/net/dns/dnsmessage.RCode vendor/golang.org/x/net/dns/dnsmessage.Type vendor/golang.org/x/net/http2/hpack.HeaderField *vendor/golang.org/x/net/idna.Profile *vendor/golang.org/x/text/unicode/bidi.Run Var : fmt.Stringer func Get(name string) Var func (*Map).Get(key string) Var func Publish(name string, v Var) func (*Map).Set(key string, av Var)
Package-Level Functions (total 12, in which 8 are exported)
Do calls f for each exported variable. The global variable map is locked during the iteration, but existing entries may be concurrently updated.
Get retrieves a named exported variable. It returns nil if the name has not been registered.
Handler returns the expvar HTTP Handler. This is only needed to install the handler in a non-standard location.
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.
Package-Level Variables (total 3, none are exported)