Improve godocs all around

These will be used in the new automated documentation system
This commit is contained in:
Matthew Holt
2019-12-23 12:45:35 -07:00
parent cbb405f6aa
commit 95ed603de7
26 changed files with 388 additions and 99 deletions

View File

@ -27,8 +27,18 @@ func init() {
}
// StaticError implements a simple handler that returns an error.
// This handler returns an error value, but does not write a response.
// This is useful when you want the server to act as if an error
// occurred; for example, to invoke your custom error handling logic.
//
// Since this handler does not write a response, the error information
// is for use by the server to know how to handle the error.
type StaticError struct {
Error string `json:"error,omitempty"`
// The recommended HTTP status code. Can be either an integer or a
// string if placeholders are needed. Optional. Default is 500.
Error string `json:"error,omitempty"`
// The error message. Optional. Default is no error message.
StatusCode WeakString `json:"status_code,omitempty"`
}