handlers

package
v0.4.7 Latest Latest
Warning

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

Go to latest
Published: Sep 26, 2021 License: LGPL-3.0 Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	// dirs
	UploadDir = "uploadings"
	FsDir     = "files"
	FsRootDir = "files"

	UserIDParam    = "uid"
	UserParam      = "user"
	PwdParam       = "pwd"
	NewPwdParam    = "newpwd"
	RoleParam      = "role"
	ExpireParam    = "expire"
	CaptchaIDParam = "capid"
	TokenCookie    = "tk"
	LastID         = "lid"

	ErrAccessDenied = errors.New("access denied")
	ErrUnauthorized = errors.New("unauthorized")
)

Functions

func ErrResp

func ErrResp(c *gin.Context, code int, err error) (int, interface{})

func FsRootPath

func FsRootPath(userName, relFilePath string) string

func GetUserInfo

func GetUserInfo(tokenStr string, tokenEncDec cryptoutil.ITokenEncDec) (map[string]string, error)

func NewMsgResp

func NewMsgResp(code int, msg string) (int, interface{})

func Resp

func Resp(code int) (int, interface{})

func UploadFolder

func UploadFolder(userName string) string

func UploadPath

func UploadPath(userName, relFilePath string) string

Types

type MsgResp

type MsgResp struct {
	Msg string `json:"msg"`
}

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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