context

package
v0.0.0-...-37a2e4e Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: May 10, 2022 License: MIT Imports: 4 Imported by: 3

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Context

type Context struct {
	Request  *http.Request
	Response http.ResponseWriter

	Status int
	// contains filtered or unexported fields
}

func (*Context) AddData

func (c *Context) AddData(key string, value interface{})

func (*Context) AddParam

func (c *Context) AddParam(name, value string)

func (*Context) Data

func (c *Context) Data(key string) (interface{}, bool)

func (*Context) Error

func (c *Context) Error(status int, err error) error

func (*Context) NewError

func (c *Context) NewError(status int, message string, kv ...interface{}) error

func (*Context) Param

func (c *Context) Param(name string) string

func (*Context) Render

func (c *Context) Render(status int, data interface{}) error

func (*Context) RenderData

func (c *Context) RenderData(data []byte) error

func (*Context) RenderJSON

func (c *Context) RenderJSON(status int, data interface{}) error

func (*Context) RenderStatus

func (c *Context) RenderStatus(status int)

func (*Context) RenderStatusInternalServerError

func (c *Context) RenderStatusInternalServerError()

func (*Context) RenderStatusMethodNotAllowed

func (c *Context) RenderStatusMethodNotAllowed()

func (*Context) RenderStatusNoContent

func (c *Context) RenderStatusNoContent()

func (*Context) RenderStatusNotFound

func (c *Context) RenderStatusNotFound()

func (*Context) RenderStatusOK

func (c *Context) RenderStatusOK()

func (*Context) RenderStatusUnauthorized

func (c *Context) RenderStatusUnauthorized()

func (*Context) RequestID

func (c *Context) RequestID() string

func (*Context) SetHeader

func (c *Context) SetHeader(key, value string)

func (*Context) SetHeaderContentType

func (c *Context) SetHeaderContentType(ct string)

func (*Context) SetHeaderWWWAuthenticate

func (c *Context) SetHeaderWWWAuthenticate()

func (*Context) SetRequestID

func (c *Context) SetRequestID(rID string)

type Error

type Error struct {
	Status  int    `json:"status"`
	Message string `json:"message"`
}

func (*Error) Error

func (e *Error) Error() string

type MSI

type MSI map[string]interface{}

type Pool

type Pool struct {
	// contains filtered or unexported fields
}

func NewPool

func NewPool() *Pool

func (*Pool) Get

func (p *Pool) Get(rw http.ResponseWriter, req *http.Request, rrType RendererType) *Context

func (*Pool) Put

func (p *Pool) Put(c *Context)

type RendererType

type RendererType string
const RendererTypeJSON RendererType = "JSON"

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL