Documentation ¶
Index ¶
- Variables
- type Approval
- type ApprovalMap
- type Approver
- type Context
- func (c *Context) Body(b []byte)
- func (c *Context) ClientIP() string
- func (c *Context) Err(err Error)
- func (c *Context) Form(name string) string
- func (c *Context) HTTPErr(err string, code int)
- func (c *Context) Header(name string) string
- func (c *Context) JSON(v any)
- 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) Redirect(url string, code int)
- func (c *Context) SetHeader(name, value string)
- func (c *Context) Var(name string) string
- type ContextData
- type CtxHandler
- type Err
- type Error
- type Route
- type Status
Constants ¶
This section is empty.
Variables ¶
View Source
var ( ErrInvalidAPIRoute = newError("invalid api route", http.StatusNotFound) ErrInvalid = newError("invalid data", http.StatusBadRequest) ErrBadreq = newError("bad request", http.StatusBadRequest) ErrForbidden = newError("forbidden", http.StatusForbidden) ErrNotFound = newError("not found", http.StatusNotFound) ErrKeyNotFound = newError("key not found", http.StatusNotFound) ErrReqNotFound = newError("key request not found", http.StatusNotFound) ErrTooManyApprovals = newError("too many approvals pending", http.StatusConflict) ErrKeyRequestRejected = newError("key request rejected", http.StatusForbidden) ErrMNA = newError("method not allowed", http.StatusMethodNotAllowed) ErrISE = newError("internal server error", http.StatusInternalServerError) )
Functions ¶
This section is empty.
Types ¶
type ApprovalMap ¶
type Approver ¶
type Approver struct {
// contains filtered or unexported fields
}
func NewApprover ¶
func NewApprover() *Approver
func (*Approver) List ¶
func (a *Approver) List() (m ApprovalMap)
type Context ¶
type Context struct { Code int Request *http.Request Response http.ResponseWriter Data *ContextData Log logr.Logger // contains filtered or unexported fields }
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.