Documentation
¶
Index ¶
- Constants
- type Map
- type Model
- func (m *Model) DeleteProblem(name string)
- func (m *Model) GetCurrentStatus(readMask *fieldmaskpb.FieldMask) (*gen.StatusLog, error)
- func (m *Model) PullCurrentStatus(ctx context.Context, readMask *fieldmaskpb.FieldMask, updatesOnly bool) <-chan StatusLogChange
- func (m *Model) UpdateProblem(problem *gen.StatusLog_Problem) (*gen.StatusLog_Problem, error)
- type ModelServer
- type ProblemMerger
- func (pm *ProblemMerger) AddProblem(problem *gen.StatusLog_Problem)
- func (pm *ProblemMerger) AddProblemMessages(problems []proto.Message)
- func (pm *ProblemMerger) AddProblems(problems []*gen.StatusLog_Problem)
- func (pm *ProblemMerger) AddStatusLog(sl *gen.StatusLog)
- func (pm *ProblemMerger) Build() *gen.StatusLog
- func (pm *ProblemMerger) Empty() bool
- type StatusLogChange
- type WatchEvent
Constants ¶
const TraitName trait.Name = "smartcore.bos.Status"
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Map ¶
type Map struct {
// contains filtered or unexported fields
}
Map tracks the status of multiple named status Model. Any names used to update/delete problems will be announced as Status traits using the given announcer.
func (*Map) DeleteProblem ¶
func (*Map) UpdateProblem ¶
func (m *Map) UpdateProblem(name string, problem *gen.StatusLog_Problem)
func (*Map) WatchEvents ¶
func (m *Map) WatchEvents(ctx context.Context) <-chan WatchEvent
WatchEvents returns a chan that emits when a client starts pulling the status for a given name. The context of the event is the context of the client's request, so will be cancelled when the client disconnects.
type Model ¶
type Model struct {
// contains filtered or unexported fields
}
Model provides an in-memory model for storing and retrieving problems as a status log. A Model can be used as a backing store for the StatusApi.
func (*Model) DeleteProblem ¶
DeleteProblem removes the named problem if it exists.
func (*Model) GetCurrentStatus ¶
GetCurrentStatus returns all known problems as a status log.
func (*Model) PullCurrentStatus ¶
func (m *Model) PullCurrentStatus(ctx context.Context, readMask *fieldmaskpb.FieldMask, updatesOnly bool) <-chan StatusLogChange
func (*Model) UpdateProblem ¶
func (m *Model) UpdateProblem(problem *gen.StatusLog_Problem) (*gen.StatusLog_Problem, error)
UpdateProblem will add or update the given problem in the model. Pull methods will be notified.
type ModelServer ¶
type ModelServer struct { gen.UnimplementedStatusApiServer // contains filtered or unexported fields }
func NewModelServer ¶
func NewModelServer(model *Model) *ModelServer
func (*ModelServer) GetCurrentStatus ¶
func (s *ModelServer) GetCurrentStatus(_ context.Context, req *gen.GetCurrentStatusRequest) (*gen.StatusLog, error)
func (*ModelServer) PullCurrentStatus ¶
func (s *ModelServer) PullCurrentStatus(request *gen.PullCurrentStatusRequest, server gen.StatusApi_PullCurrentStatusServer) error
type ProblemMerger ¶
type ProblemMerger struct { BiggestProblem *gen.StatusLog_Problem MostRecentNominal *gen.StatusLog_Problem // contains filtered or unexported fields }
func (*ProblemMerger) AddProblem ¶
func (pm *ProblemMerger) AddProblem(problem *gen.StatusLog_Problem)
func (*ProblemMerger) AddProblemMessages ¶
func (pm *ProblemMerger) AddProblemMessages(problems []proto.Message)
func (*ProblemMerger) AddProblems ¶
func (pm *ProblemMerger) AddProblems(problems []*gen.StatusLog_Problem)
func (*ProblemMerger) AddStatusLog ¶
func (pm *ProblemMerger) AddStatusLog(sl *gen.StatusLog)
func (*ProblemMerger) Build ¶
func (pm *ProblemMerger) Build() *gen.StatusLog
func (*ProblemMerger) Empty ¶
func (pm *ProblemMerger) Empty() bool