Documentation
¶
Index ¶
- Constants
- func UseLogger(logger btclog.Logger)
- type Manager
- func (s *Manager) GetStatus(name string) (*SubServerStatus, error)
- func (s *Manager) RegisterAndEnableSubServer(name string)
- func (s *Manager) RegisterSubServer(name string)
- func (s *Manager) SetEnabled(name string)
- func (s *Manager) SetErrored(name string, errStr string, params ...interface{})
- func (s *Manager) SetRunning(name string)
- func (s *Manager) SetStopped(name string)
- func (s *Manager) SubServerStatus(_ context.Context, _ *litrpc.SubServerStatusReq) (*litrpc.SubServerStatusResp, error)
- type SubServerStatus
Constants ¶
const Subsystem = "STAT"
Variables ¶
This section is empty.
Functions ¶
Types ¶
type Manager ¶
type Manager struct { litrpc.UnimplementedStatusServer // contains filtered or unexported fields }
Manager manages the status of any sub-server registered to it. It is also an implementation of the litrpc.StatusServer which can be queried for the status of various LiT sub-servers.
func (*Manager) GetStatus ¶
func (s *Manager) GetStatus(name string) (*SubServerStatus, error)
GetStatus returns the current status of a given sub-server. This will silently fail if the referenced sub-server has not yet been registered.
func (*Manager) RegisterAndEnableSubServer ¶
RegisterAndEnableSubServer will create a new sub-server entry for the Manager to keep track of and will set it as enabled.
func (*Manager) RegisterSubServer ¶
RegisterSubServer will create a new sub-server entry for the Manager to keep track of.
func (*Manager) SetEnabled ¶
SetEnabled marks the sub-server with the given name as enabled.
NOTE: This will silently fail if the referenced sub-server has not yet been registered.
func (*Manager) SetErrored ¶
SetErrored can be used to set the status of a sub-server as not Running and also to set an error message for the sub-server.
NOTE: This will silently fail if the referenced sub-server has not yet been registered.
func (*Manager) SetRunning ¶
SetRunning can be used to set the status of a sub-server as Running with no errors.
NOTE: This will silently fail if the referenced sub-server has not yet been registered.
func (*Manager) SetStopped ¶
SetStopped can be used to set the status of a sub-server as not Running and with no errors.
NOTE: This will silently fail if the referenced sub-server has not yet been registered.
func (*Manager) SubServerStatus ¶
func (s *Manager) SubServerStatus(_ context.Context, _ *litrpc.SubServerStatusReq) (*litrpc.SubServerStatusResp, error)
SubServerStatus queries the current status of a given sub-server.
NOTE: this is part of the litrpc.StatusServer interface.
type SubServerStatus ¶
type SubServerStatus struct { // Disabled is true if the sub-server is available in the LiT bundle but // has explicitly been disabled by the user. Disabled bool // Running is true if the sub-server is enabled and has successfully // been started. Running bool // Err will be a non-empty string if the sub-server failed to start. Err string }
SubServerStatus represents the status of a sub-server.