Documentation
¶
Index ¶
- Variables
- func Action(f cli.ActionFunc) cli.ActionFunc
- func Bytes(name string, buf []byte) gin.HandlerFunc
- func Host() string
- func IocAction(fn func(*cli.Context, *inject.Graph) error) cli.ActionFunc
- func IsProduction() bool
- func Logger() *logging.Logger
- func Loop(fn func(Engine) error) error
- func OpenDatabase() (*gorm.DB, error)
- func OpenRedis() *redis.Pool
- func RandomStr(n int) string
- func Register(ens ...Engine)
- func Rest(h HandlerFunc) gin.HandlerFunc
- func Run() error
- type Cache
- type CacheResponse
- type Engine
- type HandlerFunc
- type Link
- type Model
Constants ¶
This section is empty.
Variables ¶
View Source
var OK = gin.H{"ok": true}
OK success return
Functions ¶
Types ¶
type Cache ¶
type Cache struct { Redis *redis.Pool `inject:""` Logger *logging.Logger `inject:""` Prefix string `inject:"cache.prefix"` }
Cache cache model
func (*Cache) Page ¶
func (p *Cache) Page(exp time.Duration, fn gin.HandlerFunc) gin.HandlerFunc
Page cache page(by url and locale)
type CacheResponse ¶
CacheResponse page cache item
type Engine ¶
type Engine interface { Map(*inject.Graph) error Mount(*gin.Engine) Migrate(*gorm.DB) Seed() Worker() Shell() []cli.Command }
Engine web engine
type HandlerFunc ¶
HandlerFunc rest handler
Click to show internal directories.
Click to hide internal directories.