Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Context ¶
type Context interface {
// Bind is a helper function which binds the request body to a provided value to be parsed as JSON
Bind(value interface{}) (err error)
// Param will return the associated parameter value with the provided key
Param(key string) (value string)
// AddHook will append a new hook to the Context
AddHook(hook Hook)
// Get will retrieve a value for a provided key from the Context's internal storage
Get(key string) (value string)
// Put will set a value for a provided key into the Context's internal storage
Put(key, value string)
// WriteString will write as a string value
WriteString(status int, contentType, str string)
// WriteBytes will write as a byteslice value
WriteBytes(status int, contentType string, str []byte)
// WriteReader will write as a reader value
WriteReader(status int, contentType string, r io.Reader)
// WriteJSON will write as JSON
WriteJSON(status int, value interface{})
// WriteNoContent will write a no content response
WriteNoContent()
// Redirect will redirect the client
Redirect(status int, destination string)
// Request will return the underlying http.Request
Request() (req *http.Request)
// Writer will return the underlying response writer.
Writer() (writer http.ResponseWriter)
}
Context is the http context plugins need to support handlers
type Group ¶ added in v0.5.2
type Group interface {
GET(route string, hs ...Handler)
POST(route string, hs ...Handler)
PUT(route string, hs ...Handler)
DELETE(route string, hs ...Handler)
OPTIONS(route string, hs ...Handler)
Group(route string, hs ...Handler) Group
Handle(method, route string, hs ...Handler)
}
Group is a grouping interface
type Hook ¶ added in v0.1.6
Hook is a function called after the response has been completed to the requester
type Plugins ¶
Plugins represents the plugins library interface. This allows for plugins and libraries to not be affected by vroomy/plugins version changes.
type Response ¶
type Response struct {
StatusCode int
ContentType string
Value interface{}
// Optional fields used by a minority of responses
Adopted bool
Callback string
}
Response determines how the server will respond
func NewAdopedtResponse ¶ added in v0.2.0
func NewAdopedtResponse() *Response
NewAdopedtResponse will return a new adopted Response
func NewResponse ¶ added in v0.2.0
NewResponse will return a new Response
Click to show internal directories.
Click to hide internal directories.