Documentation ¶
Index ¶
- Variables
- func Connect(config *DatabaseOpts)
- func DropTable()
- type Context
- type DatabaseOpts
- type Handler
- type Route
- type Router
- func (r *Router) Get(path string, h ...Handler)
- func (r *Router) Head(path string, h ...Handler)
- func (r *Router) Options(path string, h ...Handler)
- func (r *Router) Patch(path string, h ...Handler)
- func (r *Router) Post(path string, h ...Handler)
- func (r *Router) Put(path string, h ...Handler)
- func (r *Router) ServeHTTP(wr http.ResponseWriter, req *http.Request)
- func (r *Router) SetRootDir(root string)
- func (r *Router) StartRouter(port string)
- func (r *Router) Trace(path string, h ...Handler)
- func (r *Router) With(h ...Handler)
- func (r *Router) WithDatabase(opts *DatabaseOpts)
Constants ¶
This section is empty.
Variables ¶
View Source
var DB *sql.DB
Functions ¶
func Connect ¶
func Connect(config *DatabaseOpts)
Types ¶
type Context ¶
type Context struct { Resp http.ResponseWriter Req *http.Request // contains filtered or unexported fields }
Context controls ResponseWriter and pointer to Request, used to extend methods
type DatabaseOpts ¶
type Handler ¶
Wok enforces its own handler to return an error, then wraps it into an http handler converter
type Router ¶
func (*Router) SetRootDir ¶
func (*Router) StartRouter ¶
func (*Router) WithDatabase ¶
func (r *Router) WithDatabase(opts *DatabaseOpts)
Click to show internal directories.
Click to hide internal directories.