subcommand_server

package
v3.6.0+incompatible Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Nov 18, 2014 License: Apache-2.0 Imports: 6 Imported by: 0

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
}

func (Server) Handler

func (srv Server) Handler(w http.ResponseWriter, r *http.Request)

func (Server) Start

func (srv Server) Start(addr string) error

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.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL