Documentation ¶
Index ¶
Constants ¶
View Source
const ( Admin = iota // Reader + Writer + register auth Reader Writer )
auth role
Variables ¶
This section is empty.
Functions ¶
func Authentication ¶
func Authentication() gin.HandlerFunc
func GetAuthRoleIntFromStr ¶
Types ¶
type AuthCancelOption ¶
type AuthCenter ¶
type AuthCenter struct {
// contains filtered or unexported fields
}
func GetAuthCenter ¶
func GetAuthCenter() *AuthCenter
func NewAuthCenter ¶
func NewAuthCenter(option *AuthCenterOption) *AuthCenter
func (*AuthCenter) Cancel ¶
func (a *AuthCenter) Cancel(option *AuthCancelOption) error
func (*AuthCenter) GetReaders ¶
func (a *AuthCenter) GetReaders() map[string]string
func (*AuthCenter) GetWriters ¶
func (a *AuthCenter) GetWriters() map[string]string
func (*AuthCenter) Register ¶
func (a *AuthCenter) Register(option *AuthRegisterOption) error
type AuthCenterOption ¶
type AuthRegisterOption ¶
type WareAuthOption ¶
type WareAuthOption struct { Open bool `yaml:"Open"` Root struct { Username string `yaml:"Username"` Password string `yaml:"Password"` } `yaml:"Root"` Others []struct { Username string `yaml:"Username"` Password string `yaml:"Password"` Role string `yaml:"Role"` } `yaml:"Others"` }
func DefaultOption ¶
func DefaultOption() *WareAuthOption
Click to show internal directories.
Click to hide internal directories.