Documentation
¶
Index ¶
- Constants
- type Action
- type ActionFunc
- type Context
- type Header
- type Middleware
- type Request
- type RequestCtx
- type Response
- type Route
- type Server
- func (s *Server) AddAuthMiddleware(m Middleware)
- func (s *Server) AddDataRoute(method, path, query, params string) (*Route, error)
- func (s *Server) AddFunc(f ActionFunc) (*Route, error)
- func (s *Server) AddMiddleware(m Middleware)
- func (s *Server) AddPostRoute(path string) (*Route, error)
- func (s *Server) AddRoute(method, path string) (*Route, error)
- func (s *Server) AddSecureFunc(f ActionFunc) (*Route, error)
- func (s *Server) Connect() error
- func (s *Server) Database() *db.Connection
- func (s *Server) Execute(method, url, header, body []byte) (Response, error)
- func (s *Server) GetRoute(method, path string) (*Route, error)
- func (s *Server) OpenDatabase(host string, port uint16, username, password, name string) error
- func (s *Server) SetDatabase(host string, port uint16, username, password, name string)
- func (s *Server) SetDebug()
- func (s *Server) SetLogger(debug func(v ...interface{}), warn func(v ...interface{}), ...)
- func (s *Server) SetProduction()
- func (s *Server) SetRoute(method, path string, route *Route) error
- type Session
Constants ¶
View Source
const ( //MethodGet GET MethodGet = `GET` //MethodPost POST MethodPost = `POST` //StatusBadRequest ... StatusBadRequest = 400 StatusUnauthorized = 401 //StatusNotFound ... StatusNotFound = 404 //StatusOK ... StatusOK = 200 //StatusInternalServerError ... StatusInternalServerError = 500 )
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type ActionFunc ¶ added in v0.2.1
ActionFunc ...
type RequestCtx ¶
RequestCtx ..
type Route ¶
type Route struct {
// contains filtered or unexported fields
}
Route ...
func (*Route) AddFuncAction ¶ added in v0.2.1
func (r *Route) AddFuncAction(f ActionFunc, property string) (Action, error)
AddFuncAction ...
func (*Route) AddQueryAction ¶
AddQueryAction ...
type Server ¶
type Server struct {
// contains filtered or unexported fields
}
Server ...
func (*Server) AddAuthMiddleware ¶
func (s *Server) AddAuthMiddleware(m Middleware)
AddAuthMiddleware ..
func (*Server) AddDataRoute ¶
AddDataRoute add query with action result to property named "data"
func (*Server) AddFunc ¶ added in v0.2.1
func (s *Server) AddFunc(f ActionFunc) (*Route, error)
AddFunc add insecure route with single func action, insecure means this route will not validated by auth middlewares.
func (*Server) AddPostRoute ¶ added in v0.2.1
AddPostRoute ...
func (*Server) AddSecureFunc ¶ added in v0.2.2
func (s *Server) AddSecureFunc(f ActionFunc) (*Route, error)
AddSecureFunc add secure route with single func action, secure means this route will validated using auth middlewares if any.
func (*Server) OpenDatabase ¶
OpenDatabase call SetDatabase and Connect
func (*Server) SetDatabase ¶
SetDatabase ...
Click to show internal directories.
Click to hide internal directories.