Documentation
¶
Overview ¶
Code generated by github.com/ngicks/gommon/cmd/generate_state_impl/generate_state_impl.go. DO NOT EDIT.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func NewEndedState ¶ added in v0.0.2
func NewEndedState() (embedder *EndedStateChecker, setter *EndedStateSetter)
NewEndedState builds splitted EndedState wrapper. Either or both can be embedded and or used as unexported member to hide it setter.
func NewWorkingState ¶
func NewWorkingState() (embedder *WorkingStateChecker, setter *WorkingStateSetter)
NewWorkingState builds splitted WorkingState wrapper. Either or both can be embedded and or used as unexported member to hide it setter.
Types ¶
type EndedState ¶ added in v0.0.3
type EndedState struct {
// contains filtered or unexported fields
}
EndedState simple atomic state primitive.
func (*EndedState) IsEnded ¶ added in v0.0.3
func (s *EndedState) IsEnded() bool
IsEnded is atomic state checker. It returns true if state is set, and vice versa.
func (*EndedState) SetEnded ¶ added in v0.0.3
func (s *EndedState) SetEnded(to ...bool) (swapped bool)
SetEnded is atomic state setter. Calling this, without any arg or args are all true, will set its state. If one of to is false, it un-sets internal state.
It returns true when successfully set, false otherwise.
type EndedStateChecker ¶ added in v0.0.3
type EndedStateChecker struct {
// contains filtered or unexported fields
}
EndedStateSetter is sipmle wrapper of EndedState. It only exposes IsEnded.
func (*EndedStateChecker) IsEnded ¶ added in v0.0.3
func (s *EndedStateChecker) IsEnded() bool
IsEnded is atomic state checker. It returns true if state is set, and vice versa.
type EndedStateSetter ¶ added in v0.0.2
type EndedStateSetter struct {
// contains filtered or unexported fields
}
EndedStateSetter is sipmle wrapper of EndedState. It only exposes SetEnded.
func (*EndedStateSetter) SetEnded ¶ added in v0.0.2
func (s *EndedStateSetter) SetEnded(to ...bool) (swapped bool)
SetEnded is atomic state setter. Calling this, without any arg or args are all true, will set its state. If one of to is false, it un-sets internal state.
It returns true when successfully set, false otherwise.
type WorkingState ¶ added in v0.0.3
type WorkingState struct {
// contains filtered or unexported fields
}
WorkingState simple atomic state primitive.
func (*WorkingState) IsWorking ¶ added in v0.0.3
func (s *WorkingState) IsWorking() bool
IsWorking is atomic state checker. It returns true if state is set, and vice versa.
func (*WorkingState) SetWorking ¶ added in v0.0.3
func (s *WorkingState) SetWorking(to ...bool) (swapped bool)
SetWorking is atomic state setter. Calling this, without any arg or args are all true, will set its state. If one of to is false, it un-sets internal state.
It returns true when successfully set, false otherwise.
type WorkingStateChecker ¶ added in v0.0.3
type WorkingStateChecker struct {
// contains filtered or unexported fields
}
WorkingStateSetter is sipmle wrapper of WorkingState. It only exposes IsWorking.
func (*WorkingStateChecker) IsWorking ¶ added in v0.0.3
func (s *WorkingStateChecker) IsWorking() bool
IsWorking is atomic state checker. It returns true if state is set, and vice versa.
type WorkingStateSetter ¶
type WorkingStateSetter struct {
// contains filtered or unexported fields
}
WorkingStateSetter is sipmle wrapper of WorkingState. It only exposes SetWorking.
func (*WorkingStateSetter) SetWorking ¶
func (s *WorkingStateSetter) SetWorking(to ...bool) (swapped bool)
SetWorking is atomic state setter. Calling this, without any arg or args are all true, will set its state. If one of to is false, it un-sets internal state.
It returns true when successfully set, false otherwise.