multiusers

package
v0.8.2 Latest Latest
Warning

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

Go to latest
Published: Apr 19, 2022 License: LGPL-3.0 Imports: 19 Imported by: 0

Documentation

Index

Constants

View Source
const (
	MsgTypeResetUsedSpace = "reset-used-space"
)

Variables

View Source
var (
	ErrInvalidUser   = errors.New("invalid user name or password")
	ErrInvalidConfig = errors.New("invalid user config")
)
View Source
var ErrExpired = errors.New("token is expired")

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 []*db.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) ResetUsedSpace added in v0.6.1

func (h *MultiUsersSvc) ResetUsedSpace(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 ResetUsedSpaceReq added in v0.6.1

type ResetUsedSpaceReq struct {
	UserID uint64 `json:"userID,string"`
}

type SelfResp

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

type SetPreferencesReq added in v0.4.13

type SetPreferencesReq struct {
	Preferences *db.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     *db.Quota `json:"quota"`
}

type UsedSpaceParams added in v0.6.1

type UsedSpaceParams struct {
	UserID       uint64
	UserHomePath string
}

Jump to

Keyboard shortcuts

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