Documentation ¶
Index ¶
- func InitProf(engine *GinEngine)
- func InitSession()
- func InitWeb()
- func NewRedirectFileServer(fs embed.FS, prefix []string) func(ctx *gin.Context)
- type EntitySessions
- type ErrorHandler
- type GinEngine
- func (domain *GinEngine) GetXXHandler(handler XXHandlerFunc) gin.HandlerFunc
- func (domain *GinEngine) With404JSON() *GinEngine
- func (domain *GinEngine) WithCors(allowHeaders ...string) *GinEngine
- func (domain *GinEngine) WithLogger() *GinEngine
- func (domain *GinEngine) WithMiddleware(listens ...gin.RecoveryFunc) *GinEngine
- func (domain *GinEngine) XXDel(relativePath string, handler XXHandlerFunc)
- func (domain *GinEngine) XXGet(relativePath string, handler XXHandlerFunc)
- func (domain *GinEngine) XXHandler(httpMethod, relativePath string, handler XXHandlerFunc)
- func (domain *GinEngine) XXLoader(loaders ...LoaderHandler)
- func (domain *GinEngine) XXPost(relativePath string, handler XXHandlerFunc)
- func (domain *GinEngine) XXPut(relativePath string, handler XXHandlerFunc)
- func (domain *GinEngine) XXRun()
- type LoaderHandler
- type MysqlStore
- type RedirectFileServer
- type RedisStore
- type ResultFunc
- type SessionCtx
- type SessionCtxDefault
- type SessionCtxFunc
- type XXHandlerFunc
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func InitSession ¶
func InitSession()
Types ¶
type EntitySessions ¶ added in v0.1.4
type EntitySessions struct { ID int64 `xorm:"pk id autoincr bigint(20) notnull comment('id') "` SessionId string `xorm:"varchar(255) key('session_id') comment('sessionId')" json:"sessionId"` ServerName string `xorm:"varchar(255) comment('服务名称')" json:"serverName"` ContentType string `xorm:"varchar(1000) comment('请求头')" json:"ContentType"` Value string `xorm:"varchar(500) comment('值')" json:"value"` Expire *time.Time `xorm:"varchar(500) comment('过期时间')" json:"expire"` CreateTime *time.Time `xorm:"created varchar(500) comment('创建时间')" json:"CreateTime"` UpdateTime *time.Time `xorm:"updated created varchar(500) comment('修改时间')" json:"UpdateTime"` }
func (*EntitySessions) TableName ¶ added in v0.1.4
func (ce *EntitySessions) TableName() string
type ErrorHandler ¶ added in v0.3.0
type ErrorHandler func(err error, stx SessionCtx, ctx *gin.Context)
type GinEngine ¶ added in v0.0.8
type GinEngine struct { *gin.Engine BasePath string SessionId string Port int64 Stx SessionCtxFunc ResFunc ResultFunc ErrHandler ErrorHandler }
var Engine *GinEngine
func (*GinEngine) GetXXHandler ¶ added in v0.0.8
func (domain *GinEngine) GetXXHandler(handler XXHandlerFunc) gin.HandlerFunc
func (*GinEngine) With404JSON ¶ added in v0.0.8
func (*GinEngine) WithLogger ¶ added in v0.0.8
func (*GinEngine) WithMiddleware ¶ added in v0.0.8
func (domain *GinEngine) WithMiddleware(listens ...gin.RecoveryFunc) *GinEngine
func (*GinEngine) XXDel ¶ added in v0.0.8
func (domain *GinEngine) XXDel(relativePath string, handler XXHandlerFunc)
func (*GinEngine) XXGet ¶ added in v0.0.8
func (domain *GinEngine) XXGet(relativePath string, handler XXHandlerFunc)
func (*GinEngine) XXHandler ¶ added in v0.0.8
func (domain *GinEngine) XXHandler(httpMethod, relativePath string, handler XXHandlerFunc)
func (*GinEngine) XXLoader ¶ added in v0.0.8
func (domain *GinEngine) XXLoader(loaders ...LoaderHandler)
func (*GinEngine) XXPost ¶ added in v0.0.8
func (domain *GinEngine) XXPost(relativePath string, handler XXHandlerFunc)
func (*GinEngine) XXPut ¶ added in v0.0.8
func (domain *GinEngine) XXPut(relativePath string, handler XXHandlerFunc)
type LoaderHandler ¶ added in v0.0.8
type LoaderHandler interface {
Loader(engine *GinEngine)
}
type MysqlStore ¶ added in v0.1.4
type MysqlStore struct { Options *sessions.Options MySqlClient *xorm.Engine Codecs []securecookie.Codec // contains filtered or unexported fields }
func NewMysqlStore ¶ added in v0.1.4
func NewMysqlStore(mysqlClient *xorm.Engine, prefix string, keyPairs ...[]byte) *MysqlStore
func (*MysqlStore) Save ¶ added in v0.1.4
func (domain *MysqlStore) Save(r *http.Request, w http.ResponseWriter, session *sessions.Session) error
type RedirectFileServer ¶ added in v0.2.9
type RedirectFileServer struct { FS embed.FS Dir string Ignore []string Adapter func(ctx *gin.Context) bool }
func (RedirectFileServer) Create ¶ added in v0.2.9
func (ew RedirectFileServer) Create() func(ctx *gin.Context)
type RedisStore ¶
type RedisStore struct { Options *sessions.Options RedisClient *redis.Client Codecs []securecookie.Codec // contains filtered or unexported fields }
func NewRedisStore ¶
func NewRedisStore(redisClient *redis.Client, prefix string, keyPairs ...[]byte) *RedisStore
func (*RedisStore) Save ¶
func (domain *RedisStore) Save(r *http.Request, w http.ResponseWriter, session *sessions.Session) error
type ResultFunc ¶ added in v0.0.6
type ResultFunc func(stx SessionCtx, ctx *gin.Context, result any, err error)
type SessionCtx ¶ added in v0.0.6
SessionCtx Stx 此处是获取session 的前置句柄,如需要对session进行安全验证操作请在初始化完成后覆盖
type SessionCtxDefault ¶ added in v0.0.6
type SessionCtxDefault struct {
// contains filtered or unexported fields
}
func (*SessionCtxDefault) GetSession ¶ added in v0.0.6
func (domain *SessionCtxDefault) GetSession() (*sessions.Session, error)
func (*SessionCtxDefault) Save ¶ added in v0.0.6
func (domain *SessionCtxDefault) Save()
type SessionCtxFunc ¶ added in v0.0.6
type SessionCtxFunc func(ctx *gin.Context) SessionCtx
type XXHandlerFunc ¶
type XXHandlerFunc func(stx SessionCtx, ctx *gin.Context) (result any, err error)
Click to show internal directories.
Click to hide internal directories.