Versions in this module Expand all Collapse all v0 v0.1.0 Dec 30, 2019 Changes in this version + func GetRoute(name string) string + func NewRouteNameList() routeNameList + type App struct + func GetApp() *App + func (a *App) Assets(path string) string + func (a *App) Auth() *Auth + func (a *App) Config() Config + func (a *App) DB() *gorm.DB + func (a *App) GetDBURL(dbType DBType) string + func (a *App) GetRouteByName(name string) string + func (a *App) GetSessionKey() string + func (a *App) Log() Log + func (a *App) Middleware(m MiddlewareInterface) + func (a *App) Route() Route + func (a *App) Run() + func (a *App) ServeHTTP(rw http.ResponseWriter, req *http.Request) + func (a *App) SetDB(db *gorm.DB) + func (a *App) SetLogger(logger Log) + type Auth struct + Model ModelInterface + func (a *Auth) Check(request *Request) bool + func (a *Auth) LoginById(id int, request *Request) + func (a *Auth) User(request *Request) ModelInterface + type Config struct + func NewConfig() Config + func (c Config) Get(key string, defaultValue interface{}) interface{} + func (c Config) Set(key string, value interface{}) + func (c Config) SetFromMap(config map[string]interface{}) + type Context map[string]interface + type Controller struct + type ControllerFunc func(*Request) *Response + type Cookie struct + Duration int + Name string + Path string + Value string + func NewCookie() *Cookie + func (c *Cookie) Get(r *Request, name string) (bool, *Cookie) + func (c *Cookie) Set(r *Response) + type DBType string + const MSSQL + const MYSQL + const NONE + const POSTGRES + const SQLITE3 + type Log interface + Alert func(message string, context map[string]interface{}) + Critical func(message string, context map[string]interface{}) + Debug func(message string, context map[string]interface{}) + Emergency func(message string, context map[string]interface{}) + Error func(message string, context map[string]interface{}) + Info func(message string, context map[string]interface{}) + Notice func(message string, context map[string]interface{}) + Warning func(message string, context map[string]interface{}) + type Method string + const DELETE + const GET + const PATCH + const POST + const PUT + type Middleware struct + func NewMiddleware() *Middleware + func (m Middleware) Handle(request *Request) *Response + func (m Middleware) Terminate(response *Response) + type MiddlewareInterface interface + Handle func(request *Request) *Response + Terminate func(request *Response) + type MiddlewareNode struct + func NewMiddlewareNode() *MiddlewareNode + func (node *MiddlewareNode) AddChild(childNode *MiddlewareNode) + func (node *MiddlewareNode) AddParent(parentNode *MiddlewareNode) + func (node *MiddlewareNode) Child() *MiddlewareNode + func (node *MiddlewareNode) Handle(request *Request) (*Response, *MiddlewareNode) + func (node *MiddlewareNode) Parent() *MiddlewareNode + func (node *MiddlewareNode) Terminate(response *Response) + type ModelInterface interface + type Request struct + Request *http.Request + func NewRequest(req *http.Request, routeParams RouteParams) *Request + func (r *Request) GetParameter(key string) interface{} + func (r *Request) Input(key string) []string + func (r *Request) Json(dataModel *interface{}) + type Response struct + func NewResponse() *Response + func (r *Response) AddCookie(c *Cookie) *Response + func (r *Response) Error(content string) *Response + func (r *Response) Ok(content string) *Response + type Route struct + func NewRoute() Route + func (r *Route) Middleware(m MiddlewareInterface) *Route + func (r *Route) Name(name string) *Route + func (r Route) Delete(address string, controller ControllerFunc) *Route + func (r Route) Get(address string, controller ControllerFunc) *Route + func (r Route) Group(prefix string) *RouteGroup + func (r Route) Patch(address string, controller ControllerFunc) *Route + func (r Route) Post(address string, controller ControllerFunc) *Route + func (r Route) Put(address string, controller ControllerFunc) *Route + type RouteGroup struct + func NewRouteGroup() RouteGroup + func (rg *RouteGroup) Middleware(m MiddlewareInterface) *RouteGroup + func (rg *RouteGroup) Name(name string) *RouteGroup + func (rg *RouteGroup) Route() Route + func (rg RouteGroup) Group(prefix string) RouteGroup + type RouteNode struct + func NewRouteTree() *RouteNode + func (node *RouteNode) AddChild(key string, route *Route) *RouteNode + func (node *RouteNode) AddFromPath(path []string, route *Route) + func (node *RouteNode) AddNext(key string, route *Route) *RouteNode + func (node *RouteNode) FindFromPath(path []string) (*RouteNode, RouteParams) + func (node *RouteNode) FindNext(key string) *RouteNode + func (node *RouteNode) GetRoute() *Route + type RouteParams map[string]interface + type Session struct + Duration time.Duration + Id string + Key string + Value interface{} + func NewSession(r *Request) *Session + func (s *Session) Delete() + func (s *Session) Get(key string, defaultValue interface{}) interface{} + func (s *Session) Set() + type SessionInterface interface + Delete func() + Get func(key string, defaultValue interface{}) interface{} + Set func(key string, value interface{}) + type View struct + Context Context + Filename string + func NewView(fileName string, context Context) *View + func (v *View) Render() string