Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Drop ¶
type Drop struct { // Name is the name of the variable to drop. Name string }
Drop describes a moniors attempt to drop a variable.
type IdentityVar ¶
type IdentityVar struct { // ID is an identity for an application instance talking to a monitor. ID string // Var is the variable sent to the monitor from the Identity. Var Var }
IdentityVar is a variable sent from an Identity.
type MonitorTransport ¶
type MonitorTransport interface { // Listen allows for the transport to start listening for connections. Listen(hostPort string) error // Subscribe subscribes the monitor to start receiving a variable. Subscribe(id string, v string) error // Drop drops s variable from being monitored. Drop(id string, vars string) error // Receive a variable that has changed from a river instance. Receive() <-chan IdentityVar // Close closes the Transport's connection. Close() }
MonitorTransport is implemented by a monitor to be able to receive data from a river application.
type OpType ¶
type OpType int
OpType is the type of operation we are attempting to do.
const ( // UnknownOp indicates we don't know what type of Operation this is. // This is always a bug. UnknownOp OpType = 0 // SubscribeOp indicates we are trying to subscribe to certain variables. SubscribeOp OpType = 1 // DropOp indicates we are trying to remove certain variables from // monitoring. DropOp OpType = 2 )
type Operation ¶
type Operation struct { // Type is the operation type that is happening. Type OpType // Subscribe contains data if the Type === SubscribeOp. Subscribe Subscribe // Drop contains data if the Type == DropOp. Drop Drop // Response is the response to this operation. If it its nil, then it // succeeded. Otherwise there was a failure. Response chan error }
Operation is an instruction from the monitor to a river application.
type RiverTransport ¶
type RiverTransport interface { // Connect connects to the remote monitor. Connect() error // Receive returns a channel that we read Operations from. Receive() <-chan Operation // Send sends a variable to the monitor. Send(v data.VarState) error // Close closes the Transport's connection. Close() }
RiverTransport is used to implement a client for talking to a monitor over some type of underlying transport (websocket, grpc, etc). All methods must be type safe.
type Source ¶
type Source struct { // App is the name of the application, as reported by the sender. // This may not be empty. It may not contain ":". App string // Shard is a collection of applications sharing some type of relationship. // Maybe a kubernetes pod or other construct. This may not contain ":". // This may be empty. Shard string // IP is the IP address that the river instance is connected from. IP net.IP // Port is the port that the river instance connected from. Port int32 // Instance is a particular instance of an app on a IP:Port combination, to // distiguish the app from other instances. This can be empty. Instance int32 }
Source is the river app that is connecting to a monitor.
type Subscribe ¶
type Subscribe struct { // Name is the name of the variable to subscribe to. Name string // Interval is the minimum time between updates. Interval time.Duration }
Subscribe describes a monitors attempt to subscribe to a variable.
type Var ¶
type Var struct { // Name is the name of the variable. Name string // Source is the source of the variable. Source Source // Type is the type of variable. Type VarType // Int is an int64. Int int64 // Float is a float64. Float float64 // String is a string. String string }
Var is a monitored variable that is transported from a river instance to a monitor.