Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type GatewayObj ¶
type GaugeState ¶
type GaugeState struct { OwnerID uuid.UUID `yaml:"owner-id" json:"owner-id"` Description string `yaml:"description" json:"description"` Value int `yaml:"value" json:"value"` // the gauge's "value" }
GaugeState represents the value of some general measurement.
func (*GaugeState) GwKey ¶
func (g *GaugeState) GwKey() string
func (*GaugeState) GwPrefix ¶
func (g *GaugeState) GwPrefix() string
func (*GaugeState) MkKey ¶
func (g *GaugeState) MkKey(id string) string
type LogRecord ¶
type LogRecord struct { TimeStamp time.Time `yaml:"ts" json:"ts"` Sender uuid.UUID `yaml:"sender" json:"sender"` Message string `yaml:"message" json:"message"` }
LogRecord is a single log record
type ProtoGateway ¶
type ProtoGateway interface { Close() SetComponent(c Component) error GetComponent(id uuid.UUID) (Component, error) GetAllComponents() ([]Component, error) CreateGauge(id uuid.UUID, desc string) error SetGauge(id uuid.UUID, val int) error ObserveGauge(ctx context.Context, id uuid.UUID) (<-chan GaugeState, error) SendLogRecord(lr LogRecord) error GetAllLogs() ([]LogRecord, error) ObserveLogs(ctx context.Context) (<-chan LogRecord, error) }
func MakeProtoGateway ¶
func MakeProtoGateway(gwPrefix string, kvstore kv.KV) ProtoGateway
Click to show internal directories.
Click to hide internal directories.