package
Version:
v1.3.1
Opens a new window with list of versions in this module.
Published: Mar 18, 2024
License: MIT
Opens a new window with license information.
Imports: 3
Opens a new window with list of imports.
Imported by: 0
Opens a new window with list of known importers.
Documentation
¶
type Annymous struct {
Enable bool `json:"enable" mapstructure:"enable"`
Paths []PathRole `json:"paths" mapstructure:"paths"`
}
type CloseConf struct {
MaxTimes int `json:"max_times"`
MaxDuration time.Duration `json:"max_duration"`
}
type CreateTokenParams struct {
PathRoles []PathRole `json:"path_roles" validate:"dive,required"`
Duration string `json:"duration" validate:"required"`
UploadSizeLimit string `json:"size_limit"`
UploadCountLimit int `json:"count_limit"`
}
create Token params
type Https struct {
Domain string `json:"domain" mapstructure:"domain"`
Cert string `json:"cert" mapstructure:"cert"`
Key string `json:"key" mapstructure:"key"`
}
type PathRole struct {
Path string `json:"path" mapstructure:"path"`
Mode string `json:"mode" mapstructure:"mode"`
}
Valid check PathRole, and clean path
type ResFileInfo struct {
Name string `json:"name"`
Size int64 `json:"size"`
IsDir bool `json:"is_dir"`
ModTimeStamp int64 `json:"mod_time"`
FileType string `json:"file_type"`
}
type Server struct {
Addr string `json:"addr" mapstructure:"addr"`
Https Https `json:"https" mapstructure:"https"`
Home string `json:"home" mapstructure:"home" validate:"required"`
}
type ServieConfig struct {
Server
CloseConf CloseConf `json:"close_conf" mapstructure:"close_conf"`
Users []UserAuths `json:"users" mapstructure:"users"`
Any Annymous `json:"any" mapstructure:"any"`
}
type TokenAuth struct {
Token string `json:"token"`
SignedUser User `json:"signed_user"`
PathRoles map[string]PathRole `json:"path_roles"`
SignAt time.Time `json:"sign_at"`
Duration time.Duration `json:"duration"`
UploadSizeLimit string `json:"size_limit"`
UploadCountLimit int `json:"count_limit"`
UploadUsedCount int `json:"used_count"`
}
type User struct {
UserName string `json:"username" mapstructure:"username" validate:"required"`
Password string `json:"password" mapstructure:"password" validate:"required"`
}
type UserAuths struct {
User `json:"user"`
PathRoles map[string]PathRole `json:"path_roles"`
}
UserAuths user 对路径的权限
Source Files
¶
Click to show internal directories.
Click to hide internal directories.