Documentation
¶
Index ¶
- Variables
- type App
- func (a *App) GetSession() (clientFunc func() *redis.Client, key, prefix string, expiration int64)
- func (a *App) GetSign() (secretKey, key, timeKey, dev string, expiration int64)
- func (a *App) GetVersion() (version, key string)
- func (a *App) Run(options ...func(app *App))
- func (a *App) SetMode(mode string) *App
- type Controller
- func (c *Controller) Context(ctx ...*gin.Context) *gin.Context
- func (c *Controller) DumpRequest() string
- func (c *Controller) GetContext() *gin.Context
- func (c *Controller) GetLoggedUserId() int
- func (c *Controller) GetQueryByMethod(key, defaultValue string) string
- func (c *Controller) GetQueryPostForm(keys ...string) string
- func (c *Controller) Json(a ...interface{})
- func (c *Controller) PostForm(keys ...string) string
- func (c *Controller) Query(keys ...string) string
- func (c *Controller) QueryPostNumber(key string, defaultValue ...int) int
- func (c *Controller) SetContext(ctx *gin.Context)
- func (c *Controller) TraceId() string
- type ICheck
- type IController
- type Logger
- type Model
- type Redis
- type RestHandler
- type RestHandlers
- type RestVersion
- type Restful
- type Sender
- type Server
- type Session
- type Sign
- type Version
Constants ¶
This section is empty.
Variables ¶
View Source
var DefaultApp = &App{ Name: "demo", Mode: consts.DevMode, Version: &Version{ Latest: "1.0.0", Key: "app_version", }, Session: &Session{ Key: "sess_token", KeyPrefix: "ci_session:", Expiration: 6 * 30 * 86400, }, Logger: &Logger{ Dir: "apps/logs/go/demo", LogTimeout: 10 * time.Second, SendTimeout: 5 * time.Second, }, Sign: &Sign{ SecretKey: "1234!@#$", Key: "sess_token", TimeKey: "utime", Dev: "zgin-dev-sign", Expiration: 60, }, Server: &Server{ Addr: "0.0.0.0:9999", ReadTimeout: 10 * time.Second, WriteTimeout: 15 * time.Second, ShutDownTimeout: 15 * time.Second, }, }
Functions ¶
This section is empty.
Types ¶
type App ¶ added in v1.5.0
type App struct { Name string Mode string Version *Version Logger *Logger Server *Server Sign *Sign Session *Session }
func (*App) GetSession ¶ added in v1.5.0
func (*App) GetVersion ¶ added in v1.5.0
type Controller ¶ added in v1.4.2
type Controller struct {
// contains filtered or unexported fields
}
func (*Controller) Context ¶ added in v1.6.8
func (c *Controller) Context(ctx ...*gin.Context) *gin.Context
func (*Controller) DumpRequest ¶ added in v1.4.2
func (c *Controller) DumpRequest() string
func (*Controller) GetContext ¶ added in v1.6.0
func (c *Controller) GetContext() *gin.Context
func (*Controller) GetLoggedUserId ¶ added in v1.4.2
func (c *Controller) GetLoggedUserId() int
func (*Controller) GetQueryByMethod ¶ added in v1.4.2
func (c *Controller) GetQueryByMethod(key, defaultValue string) string
func (*Controller) GetQueryPostForm ¶ added in v1.4.2
func (c *Controller) GetQueryPostForm(keys ...string) string
func (*Controller) Json ¶ added in v1.4.2
func (c *Controller) Json(a ...interface{})
func (*Controller) PostForm ¶ added in v1.5.4
func (c *Controller) PostForm(keys ...string) string
func (*Controller) Query ¶ added in v1.5.4
func (c *Controller) Query(keys ...string) string
func (*Controller) QueryPostNumber ¶ added in v1.5.4
func (c *Controller) QueryPostNumber(key string, defaultValue ...int) int
func (*Controller) SetContext ¶ added in v1.4.2
func (c *Controller) SetContext(ctx *gin.Context)
func (*Controller) TraceId ¶ added in v1.6.8
func (c *Controller) TraceId() string
type IController ¶ added in v1.4.2
type RestHandler ¶ added in v1.4.2
type RestHandler struct { Sort int Sign bool Login bool Path string Version RestVersion Http string Method string Https map[string]byte Handler IController }
type RestHandlers ¶ added in v1.4.2
type RestHandlers []*RestHandler
type RestVersion ¶ added in v1.6.0
type Restful ¶ added in v1.4.2
type Restful map[string]RestHandlers
Source Files
¶
Click to show internal directories.
Click to hide internal directories.