status

package
v0.11.0-alpha Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Oct 3, 2023 License: MIT Imports: 7 Imported by: 0

Documentation

Index

Constants

View Source
const Subsystem = "STAT"

Variables

This section is empty.

Functions

func UseLogger

func UseLogger(logger btclog.Logger)

UseLogger uses a specified Logger to output package logging info. This should be used in preference to SetLogWriter if the caller is also using btclog.

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 NewStatusManager

func NewStatusManager() *Manager

NewStatusManager constructs a new Manager.

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

func (s *Manager) RegisterAndEnableSubServer(name string)

RegisterAndEnableSubServer will create a new sub-server entry for the Manager to keep track of and will set it as enabled.

func (*Manager) RegisterSubServer

func (s *Manager) RegisterSubServer(name string)

RegisterSubServer will create a new sub-server entry for the Manager to keep track of.

func (*Manager) SetEnabled

func (s *Manager) SetEnabled(name string)

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

func (s *Manager) SetErrored(name string, errStr string,
	params ...interface{})

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

func (s *Manager) SetRunning(name string)

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

func (s *Manager) SetStopped(name string)

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

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.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL