Documentation
¶
Index ¶
- Constants
- Variables
- 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
- type Consumer
- type I18n
- func (p *I18n) E(lang, code string, args ...interface{}) error
- func (p *I18n) H(lang, code string, obj interface{}) (string, error)
- func (p *I18n) Languages() ([]string, error)
- func (p *I18n) Middleware(tags ...language.Tag) gin.HandlerFunc
- func (p *I18n) Set(tx *pg.Tx, lang, code, message string) error
- func (p *I18n) T(lang, code string, args ...interface{}) string
- type Jobber
- type Jwt
- type Locale
- type Plugin
- type S3
- type Security
- type Setting
- type Settings
- type UEditor
- type UEditorManager
- type UEditorWriter
Constants ¶
View Source
const ( // HTML html HTML = "html" // MARKDOWN markdown MARKDOWN = "markdown" // TEXT text TEXT = "text" )
View Source
const LOCALE = "locale"
LOCALE locale context key
View Source
const (
// PRODUCTION production mode
PRODUCTION = "production"
)
Variables ¶
Functions ¶
func ConfigAction ¶
func ConfigAction(f cli.ActionFunc) cli.ActionFunc
ConfigAction read config at first
func InjectAction ¶
func InjectAction(f cli.ActionFunc) cli.ActionFunc
InjectAction open beans at first
func LoggerMiddleware ¶
func LoggerMiddleware(wrt http.ResponseWriter, req *http.Request, next http.HandlerFunc)
LoggerMiddleware logger middleware
Types ¶
type I18n ¶
type I18n struct {
// contains filtered or unexported fields
}
I18n i18n
func (*I18n) Middleware ¶
func (p *I18n) Middleware(tags ...language.Tag) gin.HandlerFunc
Middleware parse locales
type Jobber ¶
type Jobber struct {
// contains filtered or unexported fields
}
Jobber jobber
type Jwt ¶
type Jwt struct {
// contains filtered or unexported fields
}
Jwt jwt
type Locale ¶
type Locale struct { ID uint `json:"id"` Lang string `json:"lang"` Code string `json:"code"` Message string `json:"message"` UpdatedAt time.Time `json:"updatedAt"` CreatedAt time.Time `json:"createdAt"` // contains filtered or unexported fields }
Locale locale
type Plugin ¶
type Plugin interface { // init beans Init(*inject.Graph) error // console commands Shell() []cli.Command // register Mount() error }
Plugin plugin
type S3 ¶
type S3 struct {
// contains filtered or unexported fields
}
S3 amazon s3
type Security ¶
type Security struct {
// contains filtered or unexported fields
}
Security security helper
type Setting ¶
type Setting struct { ID uint Key string Value []byte Encode bool `sql:",notnull"` UpdatedAt time.Time CreatedAt time.Time // contains filtered or unexported fields }
Setting setting model
type Settings ¶
type Settings struct {
// contains filtered or unexported fields
}
Settings settings
type UEditor ¶
type UEditor struct { }
UEditor ueditor
func (*UEditor) Upload ¶
func (p *UEditor) Upload(wrt UEditorWriter, images UEditorManager, files UEditorManager) gin.HandlerFunc
Upload upload handler
type UEditorManager ¶
UEditorManager ueditor's file manager
Click to show internal directories.
Click to hide internal directories.