Versions in this module Expand all Collapse all v0 v0.5.2 Apr 21, 2015 Changes in this version + const ContentDefaultLanguage + const ContentDefaultVersion + const ContentMediaType + const LogFormatCommon + const LogFormatExtended + const LogFormatReferer + const LogFormatRelax + const StatusNetworkAuthenticationRequired + const StatusPreconditionRequired + const StatusRequestHeaderFieldsTooLarge + const StatusTooManyRequests + const Version + var ErrAuthInvalidRequest = errors.New("auth: Invalid authorization request") + var ErrAuthInvalidSyntax = errors.New("auth: Invalid credentials syntax") + var ErrBodyTooLarge = errors.New("encoder: Body too large") + var ErrRouteBadMethod = &StatusError + var ErrRouteNotFound = &StatusError + func InternalServerError(w http.ResponseWriter, r *http.Request) + func LinkHeader(uri string, param ...string) (string, string) + func MustAuthenticate(w http.ResponseWriter, challenge string) + func NewRequestID(id string) string + func ParsePreferences(values string) (map[string]float32, error) + func PathExt(path string) string + type CRUD interface + Create func(*Context) + Delete func(*Context) + Read func(*Context) + Update func(*Context) + type Context struct + Buffer *ResponseBuffer + Decode func(io.Reader, interface{}) error + Encode func(io.Writer, interface{}) error + Info *environ.Env + PathValues url.Values + Request *http.Request + func NewContext(w http.ResponseWriter, r *http.Request) *Context + func (ctx *Context) Bytes() int + func (ctx *Context) Capture() *Context + func (ctx *Context) Clone(w http.ResponseWriter) *Context + func (ctx *Context) Error(code int, message string, details ...interface{}) + func (ctx *Context) Format(f fmt.State, c rune) + func (ctx *Context) Free() + func (ctx *Context) Header() http.Header + func (ctx *Context) IsSSL() bool + func (ctx *Context) ProxyClient() string + func (ctx *Context) Release() + func (ctx *Context) Respond(v interface{}, code ...int) error + func (ctx *Context) Status() int + func (ctx *Context) Write(b []byte) (int, error) + func (ctx *Context) WriteHeader(code int) + type Encoder interface + Accept func() string + ContentType func() string + Decode func(io.Reader, interface{}) error + Encode func(io.Writer, interface{}) error + type EncoderJSON struct + AcceptHeader string + ContentTypeHeader string + Indented bool + MaxBodySize int64 + func NewEncoderJSON() *EncoderJSON + func (e *EncoderJSON) Accept() string + func (e *EncoderJSON) ContentType() string + func (e *EncoderJSON) Decode(reader io.Reader, v interface{}) error + func (e *EncoderJSON) Encode(writer io.Writer, v interface{}) error + type Filter interface + Run func(HandlerFunc) HandlerFunc + type FilterAuthBasic struct + Authenticate func(string, string) bool + Realm string + func (f *FilterAuthBasic) Run(next HandlerFunc) HandlerFunc + type FilterCORS struct + AllowAnyOrigin bool + AllowCredentials bool + AllowHeaders []string + AllowMethods []string + AllowOrigin []string + ExposeHeaders []string + MaxAge int + Strict bool + func (f *FilterCORS) Run(next HandlerFunc) HandlerFunc + type FilterETag struct + DisableConditionals bool + func (f *FilterETag) Run(next HandlerFunc) HandlerFunc + type FilterGzip struct + CompressionLevel int + MinLength int + func (f *FilterGzip) Run(next HandlerFunc) HandlerFunc + type FilterLog struct + PostLogFormat string + PreLogFormat string + func (f *FilterLog) Run(next HandlerFunc) HandlerFunc + type FilterOverride struct + Header string + Methods map[string]string + QueryVar string + func (f *FilterOverride) Run(next HandlerFunc) HandlerFunc + type FilterSecurity struct + CacheDisable bool + CacheOptions string + HSTSDisable bool + HSTSOptions string + PragmaDisable bool + UACheckDisable bool + UACheckErrMsg string + XCTODisable bool + XFrameDisable bool + XFrameOptions string + func (f *FilterSecurity) Run(next HandlerFunc) HandlerFunc + type HandlerFunc func(*Context) + type Link struct + Anchor string + HrefLang string + Media string + Rel string + Rev string + Title string + Type string + URI string + func (l *Link) String() string + type Logger interface + Print func(...interface{}) + Printf func(string, ...interface{}) + Println func(...interface{}) + type Resource struct + func (r *Resource) CRUD(pse string) *Resource + func (r *Resource) DELETE(path string, h HandlerFunc, filters ...Filter) *Resource + func (r *Resource) GET(path string, h HandlerFunc, filters ...Filter) *Resource + func (r *Resource) MethodNotAllowed(ctx *Context) + func (r *Resource) NotImplemented(ctx *Context) + func (r *Resource) OPTIONS(path string, h HandlerFunc, filters ...Filter) *Resource + func (r *Resource) PATCH(path string, h HandlerFunc, filters ...Filter) *Resource + func (r *Resource) POST(path string, h HandlerFunc, filters ...Filter) *Resource + func (r *Resource) PUT(path string, h HandlerFunc, filters ...Filter) *Resource + func (r *Resource) Route(method, path string, h HandlerFunc, filters ...Filter) *Resource + type Resourcer interface + Index func(*Context) + type ResponseBuffer struct + func NewResponseBuffer(w http.ResponseWriter) *ResponseBuffer + func (rb *ResponseBuffer) Flush(w http.ResponseWriter) (int64, error) + func (rb *ResponseBuffer) FlushHeader(w http.ResponseWriter) + func (rb *ResponseBuffer) Free() + func (rb *ResponseBuffer) Header() http.Header + func (rb *ResponseBuffer) Status() int + func (rb *ResponseBuffer) Write(b []byte) (int, error) + func (rb *ResponseBuffer) WriteHeader(code int) + func (rb *ResponseBuffer) WriteTo(w io.Writer) (int64, error) + type Router interface + AddRoute func(string, string, HandlerFunc) + FindHandler func(*Context) (HandlerFunc, error) + PathMethods func(string) string + type Service struct + Recovery http.HandlerFunc + URI *url.URL + func NewService(uri string, entities ...interface{}) *Service + func (svc *Service) Adapter() http.HandlerFunc + func (svc *Service) Content(next HandlerFunc) HandlerFunc + func (svc *Service) Handler() (string, http.Handler) + func (svc *Service) Logf(format string, args ...interface{}) + func (svc *Service) Logger() Logger + func (svc *Service) Options() *ServiceOptions + func (svc *Service) Resource(collection Resourcer, filters ...Filter) *Resource + func (svc *Service) Router() Router + func (svc *Service) Run(args ...string) + func (svc *Service) ServeHTTP(w http.ResponseWriter, r *http.Request) + func (svc *Service) Uptime() int + func (svc *Service) Use(entities ...interface{}) *Service + type ServiceOptions struct + BaseURI string + Media struct{ ... } + type StatusError struct + Code int + Details interface{} + Message string + func (e *StatusError) Error() string