Documentation ¶
Index ¶
- type Authorization
- func (auth *Authorization) AddPermission(code, name string) error
- func (auth *Authorization) Configure(app gongo.App) error
- func (auth Authorization) LoggerFields(ctx context.Context) map[string]interface{}
- func (auth *Authorization) Login(w http.ResponseWriter, r *http.Request, id, name, email, avatarURL string) error
- func (auth *Authorization) Logout(w http.ResponseWriter, r *http.Request) error
- func (auth *Authorization) Middleware(next http.Handler) http.Handler
- func (auth Authorization) Resources() []interface{}
- type Group
- type Permission
- type User
- type UserID
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Authorization ¶
func New ¶
func New() *Authorization
func (*Authorization) AddPermission ¶
func (auth *Authorization) AddPermission(code, name string) error
func (Authorization) LoggerFields ¶
func (auth Authorization) LoggerFields(ctx context.Context) map[string]interface{}
func (*Authorization) Login ¶
func (auth *Authorization) Login(w http.ResponseWriter, r *http.Request, id, name, email, avatarURL string) error
func (*Authorization) Logout ¶
func (auth *Authorization) Logout(w http.ResponseWriter, r *http.Request) error
func (*Authorization) Middleware ¶
func (auth *Authorization) Middleware(next http.Handler) http.Handler
func (Authorization) Resources ¶
func (auth Authorization) Resources() []interface{}
type Group ¶
type Group struct { gorm.Model Name string `valid:"required"` Permissions []Permission `gorm:"many2many:group_permission"` }
Click to show internal directories.
Click to hide internal directories.