Documentation ¶
Index ¶
- Constants
- func ExtractFolder(objs []Obj, extractFolder string)
- func GetThumb(obj Obj) (thumb string, ok bool)
- func GetUrl(obj Obj) (url string, ok bool)
- func SortFiles(objs []Obj, orderBy, orderDirection string)
- func WrapObjsName(objs []Obj)
- type FileStream
- type FileStreamer
- type FsOtherArgs
- type IndexProgress
- type Link
- type LinkArgs
- type ListArgs
- type Meta
- type Obj
- type ObjMerge
- type ObjThumb
- type ObjThumbURL
- type ObjUnwrap
- type ObjWrapName
- type Object
- type ObjectURL
- type OtherArgs
- type PageReq
- type Proxy
- type SearchNode
- type SearchReq
- type SetPath
- type SettingItem
- type Sort
- type Storage
- type Thumb
- type Thumbnail
- type URL
- type Url
- type User
- func (u User) CanAccessWithoutPassword() bool
- func (u User) CanAddAria2Tasks() bool
- func (u User) CanCopy() bool
- func (u User) CanMove() bool
- func (u User) CanRemove() bool
- func (u User) CanRename() bool
- func (u User) CanSeeHides() bool
- func (u User) CanWebdavManage() bool
- func (u User) CanWebdavRead() bool
- func (u User) CanWrite() bool
- func (u User) IsAdmin() bool
- func (u User) IsGuest() bool
- func (u User) JoinPath(reqPath string) (string, error)
- func (u User) ValidatePassword(password string) error
Constants ¶
View Source
const ( SINGLE = iota SITE STYLE PREVIEW GLOBAL ARIA2 INDEX GITHUB )
View Source
const ( PUBLIC = iota PRIVATE READONLY DEPRECATED )
View Source
const ( GENERAL = iota GUEST // only one exists ADMIN )
View Source
const MaxInt = int(MaxUint >> 1)
View Source
const MaxUint = ^uint(0)
View Source
const MinInt = -MaxInt - 1
View Source
const MinUint = 0
Variables ¶
This section is empty.
Functions ¶
func ExtractFolder ¶
func WrapObjsName ¶ added in v3.7.1
func WrapObjsName(objs []Obj)
Types ¶
type FileStream ¶
func (*FileStream) GetMimetype ¶
func (f *FileStream) GetMimetype() string
func (*FileStream) GetOld ¶ added in v3.7.1
func (f *FileStream) GetOld() Obj
func (*FileStream) GetReadCloser ¶
func (f *FileStream) GetReadCloser() io.ReadCloser
func (*FileStream) NeedStore ¶
func (f *FileStream) NeedStore() bool
func (*FileStream) SetReadCloser ¶
func (f *FileStream) SetReadCloser(rc io.ReadCloser)
type FileStreamer ¶
type FileStreamer interface { io.ReadCloser Obj GetMimetype() string SetReadCloser(io.ReadCloser) NeedStore() bool GetReadCloser() io.ReadCloser GetOld() Obj }
type FsOtherArgs ¶
type IndexProgress ¶ added in v3.6.0
type Meta ¶
type Meta struct { ID uint `json:"id" gorm:"primaryKey"` Path string `json:"path" gorm:"unique" binding:"required"` Password string `json:"password"` PSub bool `json:"p_sub"` Write bool `json:"write"` WSub bool `json:"w_sub"` Hide string `json:"hide"` HSub bool `json:"h_sub"` Readme string `json:"readme"` RSub bool `json:"r_sub"` }
type Obj ¶
type Obj interface { GetSize() int64 GetName() string ModTime() time.Time IsDir() bool // The internal information of the driver. // If you want to use it, please understand what it means GetID() string GetPath() string }
func WrapObjName ¶ added in v3.7.1
type ObjMerge ¶ added in v3.7.1
type ObjMerge struct {
// contains filtered or unexported fields
}
func (*ObjMerge) InitHideReg ¶ added in v3.7.1
type ObjThumbURL ¶
type ObjWrapName ¶ added in v3.7.1
func (*ObjWrapName) GetName ¶ added in v3.7.1
func (o *ObjWrapName) GetName() string
func (*ObjWrapName) Unwrap ¶ added in v3.7.1
func (o *ObjWrapName) Unwrap() Obj
type Object ¶
type PageReq ¶ added in v3.6.0
type Proxy ¶
type Proxy struct { WebProxy bool `json:"web_proxy"` WebdavPolicy string `json:"webdav_policy"` DownProxyUrl string `json:"down_proxy_url"` }
func (Proxy) WebdavNative ¶
func (Proxy) WebdavProxy ¶
type SearchNode ¶ added in v3.6.0
type SearchNode struct { Parent string `json:"parent" gorm:"index"` Name string `json:"name"` IsDir bool `json:"is_dir"` Size int64 `json:"size"` }
func (*SearchNode) Type ¶ added in v3.6.0
func (s *SearchNode) Type() string
type SettingItem ¶
type SettingItem struct { Key string `json:"key" gorm:"primaryKey" binding:"required"` // unique key Value string `json:"value"` // value Help string `json:"help"` // help message Type string `json:"type"` // string, number, bool, select Options string `json:"options"` // values for select Group int `json:"group"` // use to group setting in frontend Flag int `json:"flag"` // 0 = public, 1 = private, 2 = readonly, 3 = deprecated, etc. }
func (SettingItem) IsDeprecated ¶
func (s SettingItem) IsDeprecated() bool
type Storage ¶
type Storage struct { ID uint `json:"id" gorm:"primaryKey"` // unique key MountPath string `json:"mount_path" gorm:"unique" binding:"required"` // must be standardized Order int `json:"order"` // use to sort Driver string `json:"driver"` // driver used CacheExpiration int `json:"cache_expiration"` // cache expire time Status string `json:"status"` Addition string `json:"addition" gorm:"type:text"` // Additional information, defined in the corresponding driver Remark string `json:"remark"` Modified time.Time `json:"modified"` Disabled bool `json:"disabled"` // if disabled Sort Proxy }
func (*Storage) GetStorage ¶
func (*Storage) SetStorage ¶ added in v3.7.1
type User ¶
type User struct { ID uint `json:"id" gorm:"primaryKey"` // unique key Username string `json:"username" gorm:"unique" binding:"required"` // username Password string `json:"password"` // password BasePath string `json:"base_path"` // base path Role int `json:"role"` // user's role // Determine permissions by bit // 0: can see hidden files // 1: can access without password // 2: can add aria2 tasks // 3: can mkdir and upload // 4: can rename // 5: can move // 6: can copy // 7: can remove // 8: webdav read // 9: webdav write Permission int32 `json:"permission"` OtpSecret string `json:"-"` GithubID int `json:"github_id"` }
func (User) CanAccessWithoutPassword ¶
func (User) CanAddAria2Tasks ¶
func (User) CanSeeHides ¶
func (User) CanWebdavManage ¶
func (User) CanWebdavRead ¶
func (User) ValidatePassword ¶
Click to show internal directories.
Click to hide internal directories.