Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
View Source
var ( // ErrInternal is an internal server error. ErrInternal = errors.Wrap(errors.ErrInternal, "server") // ErrServer is an error related with server. ErrServer = errors.New("server") // ErrServerOptions is an error related with server options. ErrServerOptions = errors.Wrap(ErrServer, "options") // ErrURIParameter is an error related with uri parameters. ErrURIParameter = errors.Wrap(ErrServer, "uri parameter") // ErrServerClosed is an error thrown when the server is closed. ErrServerClosed = errors.Wrap(ErrServer, "closed") // ErrHeader errors.Minor ErrHeader = errors.Wrap(ErrServer, "header") // ErrHeaderNotAcceptable is an error related to not acceptable request header. ErrHeaderNotAcceptable = errors.Wrap(ErrHeader, "not acceptable") // ErrUnsupportedHeader is an error related to unsupported request header. ErrUnsupportedHeader = errors.Wrap(ErrHeader, "unsupported") // ErrMissingRequiredHeader is an error related to missing required header. ErrMissingRequiredHeader = errors.Wrap(ErrHeader, "missing required") // ErrHeaderValue is an error related to request header value. ErrHeaderValue = errors.Wrap(ErrHeader, "value") )
Functions ¶
This section is empty.
Types ¶
type Endpoint ¶
type Endpoint struct { Path string HTTPMethod string QueryMethod query.Method ModelStruct *mapping.ModelStruct Relation *mapping.StructField Roles []auth.Role }
Endpoint is a structure that represents api endpoint.
type EndpointsGetter ¶
type EndpointsGetter interface { // GetEndpoints is a method that gets server endpoints after initialization process. GetEndpoints() []*Endpoint }
EndpointsGetter is an interface that allows to get endpoint information.
type Middleware ¶
Middleware is a http middleware function.
type MiddlewareChain ¶
type MiddlewareChain []Middleware
MiddlewareChain is a middleware slice type that could be used as a http.Handler.
type Server ¶
type Server interface { EndpointsGetter // ListenAndServe starts listen and serve the requests. Serve() error // Shutdown defines gentle shutdown of the server and all it's connections. // The server shouldn't handle any more requests but let the remaining finish within given context. Shutdown(ctx context.Context) error }
Server is the interface used
Click to show internal directories.
Click to hide internal directories.