Versions in this module Expand all Collapse all v0 v0.1.0 Jan 3, 2017 Changes in this version + var ErrClientClosedRequest = &Error + var ErrConflict = &Error + var ErrGatewayTimeout = &Error + var ErrInvalidMethod = &Error + var ErrNotFound = &Error + var ErrNotImplemented = &Error + var ErrPreconditionFailed = &Error + var ErrUnauthorized = &Error + var ErrUnknown = &Error + func IndexFromContext(ctx context.Context) (resource.Index, bool) + type DefaultResponseFormatter struct + func (f DefaultResponseFormatter) FormatError(ctx context.Context, headers http.Header, err error, skipBody bool) (context.Context, interface{}) + func (f DefaultResponseFormatter) FormatItem(ctx context.Context, headers http.Header, i *resource.Item, skipBody bool) (context.Context, interface{}) + func (f DefaultResponseFormatter) FormatList(ctx context.Context, headers http.Header, l *resource.ItemList, skipBody bool) (context.Context, interface{}) + type DefaultResponseSender struct + func (s DefaultResponseSender) Send(ctx context.Context, w http.ResponseWriter, status int, headers http.Header, ...) + type Error struct + Code int + Issues map[string][]interface{} + Message string + func NewError(err error) *Error + func (e *Error) Error() string + type Handler struct + FallbackHandlerFunc func(ctx context.Context, w http.ResponseWriter, r *http.Request) + ResponseFormatter ResponseFormatter + ResponseSender ResponseSender + func NewHandler(i resource.Index) (*Handler, error) + func (h *Handler) ServeHTTP(w http.ResponseWriter, r *http.Request) + func (h *Handler) ServeHTTPC(ctx context.Context, w http.ResponseWriter, r *http.Request) + type ResourcePath []*ResourcePathComponent + func (p *ResourcePath) Prepend(rsrc *resource.Resource, field string, value interface{}) + func (p ResourcePath) ParentsExist(ctx context.Context) error + func (p ResourcePath) Path() string + func (p ResourcePath) Values() map[string]interface{} + type ResourcePathComponent struct + Field string + Name string + Resource *resource.Resource + Value interface{} + type ResponseFormatter interface + FormatError func(ctx context.Context, headers http.Header, err error, skipBody bool) (context.Context, interface{}) + FormatItem func(ctx context.Context, headers http.Header, i *resource.Item, skipBody bool) (context.Context, interface{}) + FormatList func(ctx context.Context, headers http.Header, l *resource.ItemList, skipBody bool) (context.Context, interface{}) + type ResponseSender interface + Send func(ctx context.Context, w http.ResponseWriter, status int, headers http.Header, ...) + type RouteMatch struct + Method string + Params url.Values + ResourcePath ResourcePath + func FindRoute(index resource.Index, req *http.Request) (*RouteMatch, error) + func RouteFromContext(ctx context.Context) (*RouteMatch, bool) + func (r RouteMatch) Lookup() (*resource.Lookup, *Error) + func (r RouteMatch) Release() + func (r RouteMatch) Resource() *resource.Resource + func (r RouteMatch) ResourceID() interface{}