info

package
v2.2.0+incompatible Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Dec 5, 2017 License: Apache-2.0 Imports: 3 Imported by: 4

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Callback

type Callback func() string

Callback function

func (Callback) String

func (c Callback) String() string

type Counter

type Counter struct {
	// contains filtered or unexported fields
}

Counter is a numeric counter value

func NewCounter

func NewCounter() *Counter

NewCounter return a Counter

func (*Counter) Inc

func (c *Counter) Inc(delta int64) int64

Inc atomically increase the Counter by delta

func (*Counter) Set

func (c *Counter) Set(v int64)

Set atomically set the value of Counter to v

func (*Counter) String

func (c *Counter) String() string

String return the value of Counter as string

func (*Counter) Value

func (c *Counter) Value() int64

Value atomically get the value stored in Counter

type Registry

type Registry struct {
	// contains filtered or unexported fields
}

Registry : main info registry. Please note: in order to minimise performance impact info registries are not using locks are therefore not thread-safe. Please make sure you register all metrics and values before you start the server.

func New

func New() *Registry

New creates a new Registry

func (*Registry) Clear

func (r *Registry) Clear()

Clear removes all sections from the registry

func (*Registry) Section

func (r *Registry) Section(name string) *Section

Section returns a section, or appends a new one when the given name cannot be found

func (*Registry) String

func (r *Registry) String() string

String generates an info string output

type Section

type Section struct {
	// contains filtered or unexported fields
}

Section : an info section contains multiple values

func (*Section) Clear

func (s *Section) Clear()

Clear removes all values from a section

func (*Section) Register

func (s *Section) Register(name string, value Value)

Register registers a value under a name

type StringValue

type StringValue string

StringValue is the simplest value type

func (StringValue) String

func (v StringValue) String() string

type Value

type Value interface {
	String() string
}

Value must be exportable as a string

func IntValue

func IntValue(n int) Value

IntValue converts a static integer into a value

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL