Documentation ¶
Index ¶
- Constants
- func AddMiddlewares(es ...Entry)
- type Authorizer
- type BasicAuthorizer
- func (a *BasicAuthorizer) Abort(c *gin.Context, code int, msg string)
- func (a *BasicAuthorizer) CheckPermission(r *http.Request, id int64) (bool, error)
- func (a *BasicAuthorizer) GetUser(c *gin.Context) (id int64, state bool, role string)
- func (a *BasicAuthorizer) RequireLogIn(c *gin.Context)
- func (a *BasicAuthorizer) RequirePermission(c *gin.Context)
- func (a *BasicAuthorizer) RequireReLogIn(c *gin.Context)
- func (a *BasicAuthorizer) TryAgainLater(c *gin.Context)
- type Cors
- type Entry
- type Limiter
- type Log
- type Middleware
- type Session
Constants ¶
View Source
const ( // Masked session invalid Masked = "masked" // Guest no session Guest = "guest" )
View Source
const (
SessionName = "session"
)
Variables ¶
This section is empty.
Functions ¶
func AddMiddlewares ¶
func AddMiddlewares(es ...Entry)
Types ¶
type Authorizer ¶
type Authorizer struct{}
func (*Authorizer) Init ¶
func (a *Authorizer) Init() ([]gin.HandlerFunc, error)
type BasicAuthorizer ¶
type BasicAuthorizer struct{}
func (*BasicAuthorizer) Abort ¶
func (a *BasicAuthorizer) Abort(c *gin.Context, code int, msg string)
func (*BasicAuthorizer) CheckPermission ¶
func (*BasicAuthorizer) RequireLogIn ¶
func (a *BasicAuthorizer) RequireLogIn(c *gin.Context)
func (*BasicAuthorizer) RequirePermission ¶
func (a *BasicAuthorizer) RequirePermission(c *gin.Context)
func (*BasicAuthorizer) RequireReLogIn ¶
func (a *BasicAuthorizer) RequireReLogIn(c *gin.Context)
func (*BasicAuthorizer) TryAgainLater ¶
func (a *BasicAuthorizer) TryAgainLater(c *gin.Context)
type Entry ¶
type Entry struct {
// contains filtered or unexported fields
}
func NewEntry ¶
func NewEntry(m Middleware, orders ...int) Entry
func (*Entry) Middleware ¶
func (e *Entry) Middleware() Middleware
type Middleware ¶
type Middleware interface {
Init() ([]gin.HandlerFunc, error)
}
Click to show internal directories.
Click to hide internal directories.