Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
var ErrAppHandlerAlreadyAdded = errors.New("application handler has already been added")
var ErrExtensionNotFound = errors.NewError("required extesnion dependency not found")
ErrExtensionNotFound is returned when a request is made to the ExtensionManager to load an extension whose dependencies cannot be fulfilled.
var ErrIncompleteWrite = errors.NewError("data not completely written to client")
ErrIncompleteWrite is returned whenever an error condition has been encountered where the response was not written in its entirety to the client.
var ErrInvalidContentType = errors.NewError("invalid content type")
ErrInvalidContentType is returned in cases where an invalid content-type header was received by the client and the application or server has refused to handle it. This may be due to an implementation-speicfic failure to handle a particular content-type or may be used by implementers who wish to reject certain content-types at the controller level.
var ErrInvalidHost = errors.NewError("invalid host or host name provided")
ErrInvalidHost is returned if an invalid host or host name is supplied to Capstan. Presently, this is returned by the URLBuilder if the configured host name cannot be parsed.
var ErrInvalidInterface = errors.NewError("invalid interface: method not supported")
ErrInvalidInterface is returned, typically, if an interface type conversion has failed.
var ErrInvalidParam = errors.NewError("invalid parameter type or value")
ErrInvalidParam is returned by the Context when a typed parameter is requested that does not exist or if its value could not be cast to the requested type.
var ErrInvalidPath = errors.NewError("invalid path")
ErrInvalidPath is returned by template interfaces that interact with the file system, such as the TemplateReader. Other interfaces may also return this error when a path is considered invalid. At present, this may typically be due to empty path names.
var ErrInvalidPattern = errors.NewError("invalid pattern")
ErrInvalidPattern is returned by readers or templaters that accept matching patterns for acceptable files for parsing. If no pattern is provided or the pattern is invalid, this error will be returned.
var ErrJSONDecoding = errors.NewError("error decoding JSON")
ErrJSONDecoding is returned whenever JSON input cannot be decoded.
var ErrMissingParam = errors.NewError("missing parameter")
ErrMissingParam is returned by the URLMapper/URLBuilder if a required parameter was not provided a value.
var ErrNilDependency = errors.NewError("attempt to assign nil dependency to struct field (ErrOnNil: true)")
var ErrNoHostname = errors.NewError("no hostname configured")
ErrNoHostname is returned if the server expects the caller to have configured a hostname but one was not provided.
var ErrNoPortsFound = errors.NewError("no ports found")
ErrNoPortsFound is returned if the free port scanner is unable to find a free port.
var ErrNoRendererConfigured = errors.NewError("no renderer configured")
ErrNoRendererConfigured is returned whenever context.Renderer or context.Render is called when no renderer has been configured.
var ErrNotJSON = errors.NewError("request does not contain a valid content-type header for JSON input")
ErrNotJSON is returned whenever decoded JSON is requested from the Context on a request that does not contain a valid content type or if the JSON decoding process fails.
var ErrNotMaster = errors.NewError("not master server")
ErrNotMaster is returned if a method is called on a server instance that is not the master. This will be the case, for example, on subservers in which Listen() has been called.
var ErrPathNotFound = errors.NewError("path not found")
ErrPathNotFound is returned by template interfaces that interact with the file system whenever a path is requested that does not exist.
var ErrReadingTemplate = errors.NewError("error reading template")
ErrReadingTemplate is returned whenever a template file cannot be read or if the template backend is unable to read the template source. Backends should return this whenever the read fails.
var ErrTemplateValue = errors.NewError("invalid value passed to Render()")
ErrTemplateValue is returned if the value passed to Render() on a given template cannot be cast to the data type expected by the template backend.
Functions ¶
func Consume ¶
func Consume(v interface{}, err error) interface{}
Consume and ignore the error argument. This may be used as a temporary means of silently dropping error values.
Use this function with care. Errors are almost always returned for a reason and indicate a condition that should not be ignored. Usage of this function is recommended only when you fully understand all possible error conditions returned by a call and whether they can be safely ignored.
Types ¶
type Internal ¶
type Internal struct { Controller string Params url.Values // contains filtered or unexported fields }
Internal contains metadata to redirect processing to a different controller. Such a redirect occurs internally (hence the name) and does not return to the remote client until the controller processing has finished.
Controller may be the automatically generated controller name, a manually-configured name, and may include the request method.
Note: This will not work for unnamed routes.
type Redirect ¶
Redirect contains metadata associated with an HTTP redirect (default 301) that, when returned from a controller, will interrupt further processing and redirect the client to `URL`.