Documentation
¶
Index ¶
- func BuildAndExecuteSBCommand(log *models.Log, user *models.User, args ...string) (err error)
- func BuildSBCommand(log *models.Log, user *models.User, args ...string) (bc Command, ct *Context, err error)
- func DisplayHelpers(helpers helpers.Helper, arguments map[string]Argument)
- func GetCommands() map[string]Factory
- func IsAPublicCommand(command string) bool
- func IsReplicableCommand(command string) bool
- func RegisterCommand(name string, command Factory)
- type Argument
- type ArgumentType
- type Command
- type Context
- type Factory
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func BuildAndExecuteSBCommand ¶
BuildAndExecuteSBCommand builds the command
func BuildSBCommand ¶
func BuildSBCommand(log *models.Log, user *models.User, args ...string) (bc Command, ct *Context, err error)
BuildSBCommand builds the command
func DisplayHelpers ¶
DisplayHelpers displays the helper for a command
func GetCommands ¶
func IsAPublicCommand ¶
IsAPublicCommand returns true if the argument passed is a public trusted command
func IsReplicableCommand ¶
func RegisterCommand ¶
Types ¶
type Argument ¶
type Argument struct { Required bool Description string AllowedValues []string DefaultValue string Type ArgumentType }
Argument describes the basic properties of a sb command argument
type ArgumentType ¶
type ArgumentType int32
ArgumentType describes the type of the argument
const ( STRING ArgumentType = iota BOOL )
type Command ¶
type Command interface { Checks(ct *Context) error Execute(ct *Context) (models.ReplicationData, error, error) PostExecute(repl models.ReplicationData) error Replicate(repl models.ReplicationData) error }
Command descibes the required functions of a sb command interface
Click to show internal directories.
Click to hide internal directories.