Documentation
¶
Overview ¶
subcommand_server exposes subcommands defined in the 'subcommand' package as a HTTP server.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Server ¶
type Server struct {
Commands []subcommand.SubCommand
}
type UserRequest ¶
type UserRequest struct { SubCommandName string `json:"subcommand"` Arguments []string `json:"arguments"` }
UserRequest is a request to run a specific sub-command with args.
func NewUserRequest ¶
func NewUserRequest(postBody []byte) (*UserRequest, error)
func (*UserRequest) Run ¶
func (r *UserRequest) Run(cmds []subcommand.SubCommand) (string, error, error)
Run runs the underlying subcommand, matching with the given subcommands list.
Click to show internal directories.
Click to hide internal directories.