Documentation ¶
Overview ¶
Package river provides a streaming version of the Go standard library expvar. This allows monitors to be updated to only variables they are interested in and only when the variable has actually changed.
Index ¶
- func GetVars() []string
- func IDString(id ID) (string, error)
- func Publish(name string, v expvar.Var)
- func RegisterMonitor(ctx context.Context, dest string, t transport.RiverTransport) error
- func RemoveMonitor(dest string)
- func SetID(id ID)
- type Float
- type ID
- type IDAttr
- type Int
- type Map
- type String
- type Var
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func Publish ¶
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. Publishing a Func will call the Func() once to verify its output.
func RegisterMonitor ¶
RegisterMonitor connects to a river monitor. This will return an error if we cannot connect. Connecting will only be attempted for the lifetime of ctx (by default this is infinity).
Types ¶
type Float ¶
type Float struct {
// contains filtered or unexported fields
}
Float is a 64-bit float variable that satisfies the Var interface.
type ID ¶
type ID interface { // Attributes returns a list of field/value pairs that are used to make up // an ID. A string version of this IDAttr will be output using this order // with just the values separated by ":". ":"'s a' Attributes() []IDAttr }
ID provides an ID for the application instance, which must be unique between apps talking to a monitor.
type IDAttr ¶
type IDAttr struct { // Field is the name of the field. Field string // Value is the string value of the field. Value string }
IDAttr is an attribute used to make up an ID.
type Int ¶
type Int struct {
// contains filtered or unexported fields
}
Int is a 64-bit integer variable that satisfies the Var interface.
type Map ¶
type Map struct {
// contains filtered or unexported fields
}
Map is a string-to-Var map variable that satisfies the Var interface.
func MakeMap ¶
func MakeMap() *Map
MakeMap creates a new *Map, but does not call Publish() like NewMap().
func (*Map) Do ¶
Do calls f for each entry in the map. The map is locked during the iteration, but existing entries may be concurrently updated.
type String ¶
type String struct {
// contains filtered or unexported fields
}
String is a string variable, and satisfies the Var interface.
func MakeString ¶
type Var ¶
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 // contains filtered or unexported methods }
Var is an abstract type for all exported variables.
Directories ¶
Path | Synopsis |
---|---|
actions
Package actions provides boutique.Actions to signal modifications to the store.
|
Package actions provides boutique.Actions to signal modifications to the store. |
data
Package data provides state data for boutique stores.
|
Package data provides state data for boutique stores. |
modifiers
Package modifiers provides modifiers for all boutique.Store changes.
|
Package modifiers provides modifiers for all boutique.Store changes. |