singleuserhdr

package
v0.6.2 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Mar 11, 2022 License: LGPL-3.0 Imports: 10 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	ErrInvalidUser   = errors.New("invalid user name or password")
	ErrInvalidConfig = errors.New("invalid user config")
	UserParam        = "user"
	PwdParam         = "pwd"
	NewPwdParam      = "newpwd"
	RoleParam        = "role"
	ExpireParam      = "expire"
	InitTimeParam    = "initTime"
	TokenCookie      = "tk"
	AdminRole        = "admin"
	VisitorRole      = "visitor"
	InitNs           = "usersInit"
	UsersNs          = "users"
	RolesNs          = "roles"
)

Functions

func GetHandlerName

func GetHandlerName(fullname string) (string, error)

func IsPublicPath

func IsPublicPath(accessPath string) bool

Types

type LoginReq

type LoginReq struct {
	User string `json:"user"`
	Pwd  string `json:"pwd"`
}

type LogoutReq

type LogoutReq struct {
}

type SetPwdReq

type SetPwdReq struct {
	OldPwd string `json:"oldPwd"`
	NewPwd string `json:"newPwd"`
}

type SimpleUserHandlers

type SimpleUserHandlers struct {
	// contains filtered or unexported fields
}

func NewSimpleUserHandlers

func NewSimpleUserHandlers(cfg gocfg.ICfg, deps *depidx.Deps) (*SimpleUserHandlers, error)

func (*SimpleUserHandlers) Auth

func (*SimpleUserHandlers) Init

func (h *SimpleUserHandlers) Init(userName, pwd string) (string, error)

func (*SimpleUserHandlers) IsAuthed

func (h *SimpleUserHandlers) IsAuthed(c *gin.Context)

func (*SimpleUserHandlers) IsInited

func (h *SimpleUserHandlers) IsInited() bool

func (*SimpleUserHandlers) Login

func (h *SimpleUserHandlers) Login(c *gin.Context)

func (*SimpleUserHandlers) Logout

func (h *SimpleUserHandlers) Logout(c *gin.Context)

func (*SimpleUserHandlers) SetPwd

func (h *SimpleUserHandlers) SetPwd(c *gin.Context)

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL