Documentation
¶
Index ¶
- Constants
- func Box2Http(b *B) http.Handler
- func GetError(ctx context.Context) error
- func GetRequest(ctx context.Context) *http.Request
- func GetResponse(ctx context.Context) http.ResponseWriter
- func SetError(ctx context.Context, err error)
- type A
- func Action(handler interface{}) *A
- func ActionPost(handler interface{}) *A
- func Connect(handler interface{}) *A
- func Delete(handler interface{}) *A
- func Get(handler interface{}) *A
- func Head(handler interface{}) *A
- func Options(handler interface{}) *A
- func Patch(handler interface{}) *A
- func Post(handler interface{}) *A
- func Put(handler interface{}) *A
- func Trace(handler interface{}) *A
- type Attr
- type B
- type C
- type E
- type H
- type I
- type R
Constants ¶
View Source
const ( AttrHttpMethod = "attr_http_method" AttrHttpBind = "attr_http_bind" AttrDoc = "attr_doc" )
Variables ¶
This section is empty.
Functions ¶
func GetResponse ¶
func GetResponse(ctx context.Context) http.ResponseWriter
Types ¶
type A ¶
An A stands for Action
func ActionPost ¶
func ActionPost(handler interface{}) *A
func (*A) WithAttribute ¶
func (*A) WithInterceptors ¶
type Attr ¶
type Attr map[string]interface{}
func (Attr) GetAttribute ¶
Get Attribute value using key string from Box, Resource or Action.
func (Attr) SetAttribute ¶
Set Attribute key-value to Box, Resource or Action.
type C ¶
type C struct {
Resource *R
Action *A
Parameters map[string]string
// TODO: add headers
// TODO: add query
// TODO: add box
// TODO: ¿add marshaler and unmarshaler?
Request *http.Request
Response http.ResponseWriter
// contains filtered or unexported fields
}
An C is a box context to store box related thing in context such as *R, *A, *E, etc
type R ¶
type R struct {
Attr
// contains filtered or unexported fields
}
R stands for Resource
func NewResource ¶
func NewResource() *R
func (*R) WithAttribute ¶
func (*R) WithInterceptors ¶
Add interceptor to this resource
Source Files
¶
Click to show internal directories.
Click to hide internal directories.