Documentation
¶
Index ¶
- func NewServer(config Config) *yoda
- func NewServerWithConfig(config atreugo.Config) *yoda
- type Config
- type Context
- func (c *Context) Bind(i interface{}) error
- func (c *Context) Created(obj interface{}) error
- func (c *Context) Error(err vader.Error) error
- func (c *Context) FromContext(key string) interface{}
- func (c *Context) GetHeader(key string) []byte
- func (c *Context) JSON(status int, obj interface{}) error
- func (c *Context) NewResponse(status int, message string) error
- func (c *Context) Next() error
- func (c *Context) OK(obj interface{}) error
- type Handler
- type Response
- type Router
- func (r *Router) Delete(path string, handler Handler)
- func (r *Router) Get(path string, handler Handler)
- func (r *Router) Patch(path string, handler Handler)
- func (r *Router) Post(path string, handler Handler)
- func (r *Router) Put(path string, handler Handler)
- func (r *Router) Use(middlewares ...Handler)
- type Yoda
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func NewServer ¶ added in v0.2.0
func NewServer(config Config) *yoda
Creates a new standard yoda server
func NewServerWithConfig ¶ added in v0.2.0
Creates a yoda server with config
Types ¶
type Config ¶ added in v0.2.0
type Config struct {
Addr string
Name string
CORS cors.Config
IdleTimeout time.Duration
WriteTimeout time.Duration
ReadTimeout time.Duration
}
Config
type Context ¶ added in v0.2.0
type Context struct {
Parent *atreugo.RequestCtx
}
Context struct
func (*Context) FromContext ¶ added in v0.2.0
Returns a value from a context using the key
func (*Context) NewResponse ¶ added in v0.2.0
Creates a default response with a message
type Response ¶
type Response struct {
Message string `json:"message,omitempty"`
Error string `json:"error,omitempty"`
}
Response struct
Click to show internal directories.
Click to hide internal directories.