Documentation ¶
Overview ¶
Package cmdclient implements execution of commands using a remote service.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func AddHostCommandSet ¶
func AddHostCommandSet(tree *iradix.Tree, hcs *ipc.HostCommandSet, mutator Mutator) *iradix.Tree
AddHostCommandSet adds commands provided by a (remote) host to the command tree.
Types ¶
type CommandContext ¶
type CommandContext struct { Command ipc.Command ArgValidator *regexp.Regexp Executor Executor Tag string }
A CommandContext holds information on a command.
func (*CommandContext) ValidateArgs ¶
func (cctx *CommandContext) ValidateArgs(s string) bool
type Executor ¶
type LocalCommand ¶
type LocalCommand struct {
Handler func(context.Context, ipc.TwitchMessageContext) (ipc.TwitchMessageResponse, error)
}
A LocalCommand is command that is executed locally.
func (*LocalCommand) Exec ¶
func (lc *LocalCommand) Exec(ctx context.Context, tmc ipc.TwitchMessageContext) (tmr ipc.TwitchMessageResponse, err error)
type Mutator ¶
A Mutator is used to mutate commands before inserting them into the command tree.
Click to show internal directories.
Click to hide internal directories.