Documentation
¶
Index ¶
- type State
- func (s *State) GetBlockMessage(ctx context.Context, t blockcommand.BlockType) (string, error)
- func (s *State) GetBlocks(ctx context.Context) ([]blockcommand.Block, error)
- func (s *State) RemoveAllBlocks(ctx context.Context) error
- func (s *State) RemoveBlock(ctx context.Context, t blockcommand.BlockType) error
- func (s *State) SetBlock(ctx context.Context, t blockcommand.BlockType, message string) error
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type State ¶
State represents database interactions dealing with command block.
func NewState ¶
func NewState(factory coredatabase.TxnRunnerFactory) *State
NewState returns a new block device state based on the input database factory method.
func (*State) GetBlockMessage ¶
func (*State) RemoveAllBlocks ¶
RemoveAllBlocks removes all blocks for the current model. If no blocks are found, returns nil.
func (*State) RemoveBlock ¶
RemoveBlock disables block of specified type for the current model. Returns an error errors.BlockNotFound.
func (*State) SetBlock ¶
SetBlock switches on a command block for a given type with an optional message. Returns an error errors.BlockAlreadyExists.
Click to show internal directories.
Click to hide internal directories.