Documentation ¶
Index ¶
- type Manager
- type State
- type TestManager
- type TestState
- func (s *TestState) AddNode(nodeID ids.ShortID, startTime time.Time)
- func (s *TestState) GetStartTime(nodeID ids.ShortID) (time.Time, error)
- func (s *TestState) GetUptime(nodeID ids.ShortID) (time.Duration, time.Time, error)
- func (s *TestState) SetUptime(nodeID ids.ShortID, upDuration time.Duration, lastUpdated time.Time) error
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Manager ¶
type Manager interface { // TODO: Remove SetState as it is a jank workaround. SetState(state State) // Should only be called once StartTracking(nodeIDs []ids.ShortID) error // Should only be called once Shutdown(nodeIDs []ids.ShortID) error Connect(nodeID ids.ShortID) error IsConnected(nodeID ids.ShortID) bool Disconnect(nodeID ids.ShortID) error CalculateUptime(nodeID ids.ShortID) (time.Duration, time.Time, error) CalculateUptimePercent(nodeID ids.ShortID) (float64, error) CalculateUptimePercentFrom(nodeID ids.ShortID, startTime time.Time) (float64, error) }
func NewManager ¶
type State ¶
type State interface { GetUptime(nodeID ids.ShortID) (upDuration time.Duration, lastUpdated time.Time, err error) SetUptime(nodeID ids.ShortID, upDuration time.Duration, lastUpdated time.Time) error GetStartTime(nodeID ids.ShortID) (startTime time.Time, err error) }
func UnreadyState ¶
func UnreadyState() State
type TestManager ¶
type TestState ¶
type TestState struct {
// contains filtered or unexported fields
}
func NewTestState ¶
func NewTestState() *TestState
func (*TestState) GetStartTime ¶
Click to show internal directories.
Click to hide internal directories.