Documentation ¶
Index ¶
- Constants
- Variables
- func AddModelHook(modelName, hookType string, fn func(*gorm.DB))
- func DeleteSession(key string)
- func PutSession(key string, session *Session)
- type AppHooks
- type Hook
- type KeySet
- type ModelHook
- type Session
- func (s *Session) Check(c *gin.Context, permissions ...string) message.Message
- func (s *Session) CheckOne(c *gin.Context, permissions ...string) message.Message
- func (s *Session) Get(key string) interface{}
- func (s *Session) Has(permissions ...string) bool
- func (s *Session) HasOne(permissions ...string) bool
- func (s *Session) IsExpired() bool
- func (s *Session) RefreshExpiration()
- func (s *Session) Set(key string, value interface{})
- func (s *Session) SetExpired()
- type SessionModel
- type Webhook
Constants ¶
View Source
const AfterUpdateHook = "AfterUpdate"
Variables ¶
View Source
var DB *gorm.DB
View Source
var FS *embed.FS
View Source
var Flags = KeySet{/* contains filtered or unexported fields */}
View Source
var Hooks = AppHooks{Models: map[string]map[string]*ModelHook{}}
View Source
var Properties = map[string]string{}
Functions ¶
func AddModelHook ¶
func DeleteSession ¶
func DeleteSession(key string)
func PutSession ¶
Types ¶
type KeySet ¶
type KeySet struct {
// contains filtered or unexported fields
}
type ModelHook ¶
func GetModelHook ¶
type Session ¶
type Session struct {
// contains filtered or unexported fields
}
func CreateSession ¶
func CreateSession() *Session
func FindSession ¶
func (*Session) RefreshExpiration ¶
func (s *Session) RefreshExpiration()
func (*Session) SetExpired ¶
func (s *Session) SetExpired()
type SessionModel ¶
type SessionModel struct { KEY string `gorm:"primaryKey"` EXPIRES_AT time.Time PROPERTIES string `gorm:"type:text"` }
func (SessionModel) TableName ¶
func (s SessionModel) TableName() string
type Webhook ¶
Click to show internal directories.
Click to hide internal directories.