multiusers

package
v0.4.14 Latest Latest
Warning

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

Go to latest
Published: Nov 7, 2021 License: LGPL-3.0 Imports: 15 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")
)

Functions

This section is empty.

Types

type AddRoleReq

type AddRoleReq struct {
	Role string `json:"role"`
}

type AddUserReq

type AddUserReq struct {
	Name string `json:"name"`
	Pwd  string `json:"pwd"`
	Role string `json:"role"`
}

type AddUserResp

type AddUserResp struct {
	ID string `json:"id"`
}

type DelRoleReq

type DelRoleReq struct {
	Role string `json:"role"`
}

type DelUserResp

type DelUserResp struct {
	ID string `json:"id"`
}

type ForceSetPwdReq

type ForceSetPwdReq struct {
	ID     string `json:"id"`
	NewPwd string `json:"newPwd"`
}

type GetCaptchaIDResp

type GetCaptchaIDResp struct {
	CaptchaID string `json:"id"`
}

type ListRolesReq

type ListRolesReq struct{}

type ListRolesResp

type ListRolesResp struct {
	Roles map[string]bool `json:"roles"`
}

type ListUsersResp

type ListUsersResp struct {
	Users []*userstore.User `json:"users"`
}

type LoginReq

type LoginReq struct {
	User         string `json:"user"`
	Pwd          string `json:"pwd"`
	CaptchaID    string `json:"captchaId"`
	CaptchaInput string `json:"captchaInput"`
}

type LogoutReq

type LogoutReq struct{}

type MultiUsersSvc

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

func NewMultiUsersSvc

func NewMultiUsersSvc(cfg gocfg.ICfg, deps *depidx.Deps) (*MultiUsersSvc, error)

func (*MultiUsersSvc) APIAccessControl

func (h *MultiUsersSvc) APIAccessControl() gin.HandlerFunc

func (*MultiUsersSvc) AddRole

func (h *MultiUsersSvc) AddRole(c *gin.Context)

func (*MultiUsersSvc) AddUser

func (h *MultiUsersSvc) AddUser(c *gin.Context)

func (*MultiUsersSvc) AuthN

func (h *MultiUsersSvc) AuthN() gin.HandlerFunc

func (*MultiUsersSvc) DelRole

func (h *MultiUsersSvc) DelRole(c *gin.Context)

func (*MultiUsersSvc) DelUser

func (h *MultiUsersSvc) DelUser(c *gin.Context)

func (*MultiUsersSvc) ForceSetPwd

func (h *MultiUsersSvc) ForceSetPwd(c *gin.Context)

func (*MultiUsersSvc) GetCaptchaID

func (h *MultiUsersSvc) GetCaptchaID(c *gin.Context)

func (*MultiUsersSvc) GetCaptchaImg

func (h *MultiUsersSvc) GetCaptchaImg(c *gin.Context)

path: /captchas/imgs?id=xxx

func (*MultiUsersSvc) Init

func (h *MultiUsersSvc) Init(adminName, adminPwd string) (string, error)

func (*MultiUsersSvc) IsAuthed

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

func (*MultiUsersSvc) IsInited

func (h *MultiUsersSvc) IsInited() bool

func (*MultiUsersSvc) ListRoles

func (h *MultiUsersSvc) ListRoles(c *gin.Context)

func (*MultiUsersSvc) ListUsers

func (h *MultiUsersSvc) ListUsers(c *gin.Context)

func (*MultiUsersSvc) Login

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

func (*MultiUsersSvc) Logout

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

func (*MultiUsersSvc) Self

func (h *MultiUsersSvc) Self(c *gin.Context)

func (*MultiUsersSvc) SetPreferences added in v0.4.13

func (h *MultiUsersSvc) SetPreferences(c *gin.Context)

func (*MultiUsersSvc) SetPwd

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

func (*MultiUsersSvc) SetUser

func (h *MultiUsersSvc) SetUser(c *gin.Context)

type SelfResp

type SelfResp struct {
	ID          string                 `json:"id"`
	Name        string                 `json:"name"`
	Role        string                 `json:"role"`
	Quota       *userstore.Quota       `json:"quota"`
	UsedSpace   int64                  `json:"usedSpace,string"`
	Preferences *userstore.Preferences `json:"preferences"`
}

type SetPreferencesReq added in v0.4.13

type SetPreferencesReq struct {
	Preferences *userstore.Preferences `json:"preferences"`
}

type SetPwdReq

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

type SetUserReq

type SetUserReq struct {
	ID        uint64           `json:"id,string"`
	Role      string           `json:"role"`
	UsedSpace int64            `json:"usedSpace,string"`
	Quota     *userstore.Quota `json:"quota"`
}

Jump to

Keyboard shortcuts

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