Documentation ¶
Index ¶
- type Context
- func (wc *Context) AddFieldError(field string, err apierrors.FieldErrors)
- func (wc *Context) Commit() error
- func (wc *Context) GetValue(key string) (obj any, exists bool)
- func (wc *Context) HasErrors() bool
- func (wc *Context) JSON(status int, response any)
- func (wc *Context) MustGetValue(key string) any
- func (wc *Context) PrepareRequest(w http.ResponseWriter, r *http.Request) *Context
- func (wc *Context) QueryParams() url.Values
- func (wc *Context) Reject(status int, err *apierrors.APIError)
- func (wc *Context) ResponseHeader() http.Header
- func (wc *Context) SetStatus(status int)
- func (wc *Context) SetValue(key string, value any)
- func (wc *Context) UrlParameters() map[string]string
- func (wc *Context) Write(data []byte) (int, error)
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Context ¶
type Context struct { context.Context Writer http.ResponseWriter Request *http.Request URLParams map[string]string Tracer trace.Tracer // contains filtered or unexported fields }
func NewTestContext ¶
func NewTestContext(writer http.ResponseWriter, r *http.Request) *Context
func (*Context) AddFieldError ¶
func (wc *Context) AddFieldError(field string, err apierrors.FieldErrors)
func (*Context) MustGetValue ¶
func (*Context) PrepareRequest ¶
func (*Context) QueryParams ¶
func (*Context) ResponseHeader ¶
func (*Context) UrlParameters ¶
Click to show internal directories.
Click to hide internal directories.