Skip to content

Commit

Permalink
Add docs for "commands".Command.Run
Browse files Browse the repository at this point in the history
To clarify that if you want to access the request body after writing need to use
multipart requests.

License: MIT
Signed-off-by: Jan Winkelmann <[email protected]>
  • Loading branch information
keks committed Nov 14, 2016
1 parent d5c716a commit 1d7e9bf
Showing 1 changed file with 8 additions and 3 deletions.
11 changes: 8 additions & 3 deletions commands/command.go
Original file line number Diff line number Diff line change
Expand Up @@ -52,9 +52,14 @@ type HelpText struct {
// Command is a runnable command, with input arguments and options (flags).
// It can also have Subcommands, to group units of work into sets.
type Command struct {
Options []Option
Arguments []Argument
PreRun func(req Request) error
Options []Option
Arguments []Argument
PreRun func(req Request) error

// Run is the function that processes the request to generate a response.
// Note that you can only read after writing when using multipart requests.
// The request body will not be available for reading after the HTTP
// connection has been written to.
Run Function
PostRun Function
Marshalers map[EncodingType]Marshaler
Expand Down

0 comments on commit 1d7e9bf

Please sign in to comment.