Versions in this module Expand all Collapse all v1 v1.0.0 Jan 5, 2018 Changes in this version + const DateFormat + const LOCALE + const PRODUCTION + const TypeHTML + const TypeMARKDOWN + const TypeTEXT + var AuthorEmail string + var AuthorName string + var BuildTime string + var Copyright string + var Usage string + var Version string + func ConfigAction(f cli.ActionFunc) cli.ActionFunc + func FuncName(f interface{}) string + func InjectAction(f cli.ActionFunc) cli.ActionFunc + func LoggerMiddleware(wrt http.ResponseWriter, req *http.Request, next http.HandlerFunc) + func MODE() string + func Main(args ...string) error + func RandomBytes(l int) ([]byte, error) + func Register(args ...Plugin) + func SECRET() ([]byte, error) + func Shell(cmd string, args ...string) error + type Cache struct + Pool *redis.Pool + func NewCache(prefix string) *Cache + func (p *Cache) Flush() error + func (p *Cache) Get(key string, val interface{}) error + func (p *Cache) Keys() ([]string, error) + func (p *Cache) Set(key string, val interface{}, ttl time.Duration) error + type Consumer func(id string, body []byte) error + type I18n struct + Cache *Cache + DB *gorm.DB + Languages []string + func (p *I18n) All(lang string) (map[string]string, error) + func (p *I18n) E(lang, code string, args ...interface{}) error + func (p *I18n) H(lang, code string, obj interface{}) (string, error) + func (p *I18n) Middleware() (gin.HandlerFunc, error) + func (p *I18n) Set(db *gorm.DB, lang, code, message string) error + func (p *I18n) Sync(dir string) error + func (p *I18n) T(lang, code string, args ...interface{}) string + type Jobber struct + func NewJobber(url, queue string) (*Jobber, error) + func (p *Jobber) Receive(consumer string) error + func (p *Jobber) Register(_type string, hnd Consumer) + func (p *Jobber) Send(_type string, priority uint8, body interface{}) error + func (p *Jobber) Status() map[string]interface{} + type Jwt struct + func NewJwt(key []byte, method crypto.SigningMethod) *Jwt + func (p *Jwt) Parse(r *http.Request) (jwt.Claims, error) + func (p *Jwt) Sum(cm jws.Claims, exp time.Duration) ([]byte, error) + func (p *Jwt) Validate(buf []byte) (jwt.Claims, error) + type Locale struct + Code string + CreatedAt time.Time + ID uint + Lang string + Message string + UpdatedAt time.Time + func (p Locale) TableName() string + type Plugin interface + Init func(*inject.Graph) error + Mount func() error + Shell func() []cli.Command + type RSS struct + func NewRSS() *RSS + func (p *RSS) Register(handlers ...RSSHandler) + func (p *RSS) ToAtom(host, lang, title, dest string, author *feeds.Author, wrt io.Writer) error + type RSSHandler func(l string) ([]*feeds.Item, error) + type S3 struct + func NewS3(accessKeyID, secretAccessKey, region, bucket string) (*S3, error) + func (p *S3) Write(name string, body []byte, size int64) (string, string, error) + type Security struct + func NewSecurity(key []byte) (*Security, error) + func (p *Security) Check(encode, plain []byte) bool + func (p *Security) Decrypt(buf []byte) ([]byte, error) + func (p *Security) Encrypt(buf []byte) ([]byte, error) + func (p *Security) Hash(plain []byte) ([]byte, error) + type Setting struct + CreatedAt time.Time + Encode bool + ID uint + Key string + UpdatedAt time.Time + Value []byte + func (p Setting) TableName() string + type Settings struct + Security *Security + func (p *Settings) Get(db *gorm.DB, key string, obj interface{}) error + func (p *Settings) Set(db *gorm.DB, key string, obj interface{}, encode bool) error + type Sitemap struct + func NewSitemap() *Sitemap + func (p *Sitemap) Register(handlers ...SitemapHandler) + func (p *Sitemap) ToXMLGz(h string, w io.Writer) error + type SitemapHandler func() ([]stm.URL, error) + type UEditor struct + func (p *UEditor) Upload(wrt UEditorWriter, images UEditorManager, files UEditorManager) gin.HandlerFunc + type UEditorManager func(c *gin.Context) (urls []string, err error) + type UEditorWriter func(c *gin.Context, name string, buf []byte, size int64) (url string, err error)