Documentation
¶
Index ¶
- type Command
- func (c *Command) AddCommandToChain(nextCommand CommandInterface)
- func (c *Command) GetAndX() *andx.AndX
- func (c *Command) GetChainLength() uint
- func (c *Command) GetCommandCode() codes.CommandCode
- func (c *Command) GetData() *data.Data
- func (c *Command) GetNextCommand() CommandInterface
- func (c *Command) GetParameters() *parameters.Parameters
- func (c *Command) Init()
- func (c *Command) IsAndX() bool
- func (c *Command) Marshal() ([]byte, error)
- func (c *Command) SetAndX(andX *andx.AndX)
- func (c *Command) SetCommandCode(commandCode codes.CommandCode)
- func (c *Command) SetData(data *data.Data)
- func (c *Command) SetNextCommand(nextCommand CommandInterface)
- func (c *Command) SetParameters(parameters *parameters.Parameters)
- func (c *Command) Unmarshal(data []byte) (int, error)
- type CommandInterface
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Command ¶
type Command struct {
// Command code
CommandCode codes.CommandCode
// AndX command
AndX *andx.AndX
// Parameters
Parameters *parameters.Parameters
// Data
Data *data.Data
// Next command
NextCommand CommandInterface
}
Command is a struct that implements the CommandInterface
func (*Command) AddCommandToChain ¶
func (c *Command) AddCommandToChain(nextCommand CommandInterface)
AddCommandToChain adds a command to the chain
Parameters:
- nextCommand: The next command to add to the chain
func (*Command) GetAndX ¶
GetAndX returns the AndX of the command
Returns:
- *andx.AndX: The AndX of the command
func (*Command) GetChainLength ¶
GetChainLength returns the length of the chain of commands
Returns:
- uint: The length of the chain of commands
func (*Command) GetCommandCode ¶
func (c *Command) GetCommandCode() codes.CommandCode
GetCommandCode returns the command code
Returns:
- codes.CommandCode: The command code
func (*Command) GetData ¶
GetData returns the data of the command
Returns:
- *data.Data: The data of the command
func (*Command) GetNextCommand ¶
func (c *Command) GetNextCommand() CommandInterface
GetNextCommand returns the next command in the chain If the command is not an AndX, it returns nil
Returns:
- CommandInterface: The next command in the chain
func (*Command) GetParameters ¶
func (c *Command) GetParameters() *parameters.Parameters
GetParameters returns the parameters of the command
Returns:
- *parameters.Parameters: The parameters of the command
func (*Command) Init ¶
func (c *Command) Init()
Init initializes the command
Parameters:
- commandCode: The command code to set
func (*Command) IsAndX ¶
IsAndX returns true if the command is an AndX
Returns:
- bool: True if the command is an AndX, false otherwise
func (*Command) Marshal ¶
Marshal returns the marshalled command
Returns:
- []byte: The marshalled command
- error: An error if the marshalling fails
func (*Command) SetCommandCode ¶
func (c *Command) SetCommandCode(commandCode codes.CommandCode)
SetCommandCode sets the command code
Parameters:
- commandCode: The command code to set
func (*Command) SetNextCommand ¶
func (c *Command) SetNextCommand(nextCommand CommandInterface)
SetNextCommand sets the next command in the chain
Parameters:
- nextCommand: The next command to set
func (*Command) SetParameters ¶
func (c *Command) SetParameters(parameters *parameters.Parameters)
SetParameters sets the parameters of the command
Parameters:
- parameters: The parameters to set
type CommandInterface ¶
type CommandInterface interface {
// GetCommandCode returns the command code
GetCommandCode() codes.CommandCode
// SetCommandCode sets the command code
SetCommandCode(codes.CommandCode)
// GetAndX returns the AndX of the command
GetAndX() *andx.AndX
// SetAndX sets the AndX of the command
SetAndX(*andx.AndX)
// IsAndX returns true if the command is an AndX
IsAndX() bool
// GetParameters returns the parameters of the command
GetParameters() *parameters.Parameters
// SetParameters sets the parameters of the command
SetParameters(*parameters.Parameters)
// GetData returns the data of the command
GetData() *data.Data
// SetData sets the data of the command
SetData(*data.Data)
// GetNextCommand returns the next command in the chain
// If the command is not an AndX, it returns nil
GetNextCommand() CommandInterface
// SetNextCommand sets the next command in the chain
SetNextCommand(CommandInterface)
// AddCommandToChain adds a command to the chain
AddCommandToChain(CommandInterface)
// GetChainLength returns the length of the chain of commands
GetChainLength() uint
// Marshal returns the marshalled command
Marshal() ([]byte, error)
// Unmarshal unmarshals the command
Unmarshal([]byte) (int, error)
// Init initializes the command
Init()
}