Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func Patch ¶ added in v2.2.0
func Patch(newConfig ConfigStruct)
func Set ¶ added in v2.2.0
func Set(newConfig ConfigStruct)
Types ¶
type ConfigStruct ¶
type ConfigStruct struct { Cost int64 `yaml:"cost" json:"cost,omitempty"` // bcrypt-cost Users map[string]string `yaml:"users" json:"users,omitempty"` }
func (*ConfigStruct) MarshalZerologObject ¶ added in v2.2.0
func (c *ConfigStruct) MarshalZerologObject(e *zerolog.Event)
type Middleware ¶
type Middleware struct {
// contains filtered or unexported fields
}
func (*Middleware) CheckPassword ¶
func (mdw *Middleware) CheckPassword(username, password string) (err error)
return error of user not exist or password is wrong
to avoid spoofing, we not differe between not existing user and a wrong password
func (*Middleware) Init ¶
func (mdw *Middleware) Init()
func (*Middleware) Patch ¶ added in v2.2.0
func (mdw *Middleware) Patch(newConfig ConfigStruct)
func (*Middleware) Set ¶ added in v2.2.0
func (mdw *Middleware) Set(newConfig ConfigStruct)
Click to show internal directories.
Click to hide internal directories.