Documentation ¶
Index ¶
- type Availability
- type ChangeEvent
- type LivenessState
- type LivenessStateHealthChecker
- type ReadinessState
- type ReadinessStateHealthChecker
- type State
- type StateHolder
- func (h *StateHolder) GetLastChangeEvent(typ reflector.Type) *ChangeEvent
- func (h *StateHolder) GetOrDefaultState(typ reflector.Type, defaultState State) State
- func (h *StateHolder) GetState(typ reflector.Type) State
- func (h *StateHolder) LivenessState() LivenessState
- func (h *StateHolder) OnAvailabilityChangeEvent(ctx context.Context, changeEvent *ChangeEvent)
- func (h *StateHolder) PostConstruct() error
- func (h *StateHolder) ReadinessState() ReadinessState
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Availability ¶
type Availability interface { LivenessState() LivenessState ReadinessState() ReadinessState GetOrDefaultState(typ reflector.Type, defaultState State) State GetState(typ reflector.Type) State GetLastChangeEvent(typ reflector.Type) *ChangeEvent }
type ChangeEvent ¶
type ChangeEvent struct {
// contains filtered or unexported fields
}
func NewChangeEvent ¶
func NewChangeEvent(source any, state State) *ChangeEvent
func (*ChangeEvent) EventSource ¶
func (e *ChangeEvent) EventSource() any
func (*ChangeEvent) State ¶
func (e *ChangeEvent) State() State
func (*ChangeEvent) Time ¶
func (e *ChangeEvent) Time() time.Time
type LivenessState ¶
type LivenessState int
const ( StateCorrect LivenessState = iota + 1 StateBroken )
func (LivenessState) Status ¶
func (s LivenessState) Status() health.Status
type LivenessStateHealthChecker ¶
type LivenessStateHealthChecker struct {
// contains filtered or unexported fields
}
func NewLivenessStateHealthChecker ¶
func NewLivenessStateHealthChecker(availability Availability) *LivenessStateHealthChecker
func (*LivenessStateHealthChecker) DoHealthCheck ¶
func (c *LivenessStateHealthChecker) DoHealthCheck() (health.Health, error)
type ReadinessState ¶
type ReadinessState int
const ( StateAcceptingTraffic ReadinessState = iota + 1 StateRefusingTraffic )
func (ReadinessState) Status ¶
func (s ReadinessState) Status() health.Status
type ReadinessStateHealthChecker ¶
type ReadinessStateHealthChecker struct {
// contains filtered or unexported fields
}
func NewReadinessStateHealthChecker ¶
func NewReadinessStateHealthChecker(availability Availability) *ReadinessStateHealthChecker
func (*ReadinessStateHealthChecker) DoHealthCheck ¶
func (c *ReadinessStateHealthChecker) DoHealthCheck() (health.Health, error)
type StateHolder ¶
type StateHolder struct {
// contains filtered or unexported fields
}
func NewStateHolder ¶
func NewStateHolder(registry event.ListenerRegistry) *StateHolder
func (*StateHolder) GetLastChangeEvent ¶
func (h *StateHolder) GetLastChangeEvent(typ reflector.Type) *ChangeEvent
func (*StateHolder) GetOrDefaultState ¶
func (h *StateHolder) GetOrDefaultState(typ reflector.Type, defaultState State) State
func (*StateHolder) LivenessState ¶
func (h *StateHolder) LivenessState() LivenessState
func (*StateHolder) OnAvailabilityChangeEvent ¶
func (h *StateHolder) OnAvailabilityChangeEvent(ctx context.Context, changeEvent *ChangeEvent)
func (*StateHolder) PostConstruct ¶
func (h *StateHolder) PostConstruct() error
func (*StateHolder) ReadinessState ¶
func (h *StateHolder) ReadinessState() ReadinessState
Click to show internal directories.
Click to hide internal directories.