Documentation ¶
Index ¶
- Variables
- type Auth
- type Context
- func (c *Context) Body(b []byte)
- func (c *Context) Err(err Error)
- func (c *Context) Form(name string) string
- func (c *Context) GetHeader(name string) string
- func (c *Context) HTTPErr(err string, status int)
- func (c *Context) JSON(v interface{})
- func (c *Context) Leader() bool
- func (c *Context) Method() string
- func (c *Context) NotFound()
- func (c *Context) OK()
- func (c *Context) Path() string
- func (c *Context) ReadBody() (b []byte, err error)
- func (c *Context) SetHeader(name, value string)
- func (c *Context) Var(name string) (ret string)
- type ContextData
- type CtxHandler
- type Err
- type Error
- type Route
Constants ¶
This section is empty.
Variables ¶
View Source
var ( ErrInvalidAPIRoute = newError("invalid api route", http.StatusNotFound) ErrBadreq = newError("bad request", http.StatusBadRequest) ErrInvalid = newError("invalid data", http.StatusBadRequest) ErrForbidden = newError("forbidden", http.StatusForbidden) ErrNotFound = newError("not found", http.StatusNotFound) ErrLBNotFound = newError("loadbalancer not found", http.StatusNotFound) ErrMNA = newError("method not allowed", http.StatusMethodNotAllowed) ErrExists = newError("resource already exists", http.StatusConflict) ErrISE = newError("internal server error", http.StatusInternalServerError) ErrFollower = newError("follower write forbidden", http.StatusForbidden) ErrClusterNotFound = newError("cluster not found", http.StatusNotFound) ErrLBsNotFound = newError("loadbalancers not found", http.StatusNotFound) )
Functions ¶
This section is empty.
Types ¶
type Context ¶
type Context struct { Status int Request *http.Request Response http.ResponseWriter Data *ContextData Log logr.Logger }
Context is the context object shared between http handlers
func NewContext ¶
func NewContext(w http.ResponseWriter, r *http.Request, data *ContextData, log logr.Logger) *Context
type ContextData ¶
type CtxHandler ¶
type CtxHandler func(*Context)
type Err ¶
type Err struct {
// contains filtered or unexported fields
}
Err implements the Error interface
type Route ¶
type Route struct { Path string Handler CtxHandler Methods []string }
Click to show internal directories.
Click to hide internal directories.