Documentation ¶
Index ¶
- Constants
- func ExtractFolder(objs []Obj, extractFolder string)
- func SortFiles(objs []Obj, orderBy, orderDirection string)
- type FileStream
- type FileStreamer
- type FsOtherArgs
- type Link
- type LinkArgs
- type ListArgs
- type Meta
- type Obj
- type ObjThumb
- type ObjThumbURL
- type Object
- type ObjectURL
- type OtherArgs
- type Proxy
- 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) ValidatePassword(password string) error
Constants ¶
View Source
const ( SITE = iota STYLE PREVIEW GLOBAL SINGLE ARIA2 )
View Source
const ( PUBLIC = iota PRIVATE READONLY DEPRECATED )
View Source
const ( GENERAL = iota GUEST // only one exists ADMIN )
Variables ¶
This section is empty.
Functions ¶
func ExtractFolder ¶
Types ¶
type FileStream ¶
type FileStream struct { Obj io.ReadCloser Mimetype string WebPutAsTask bool }
func (*FileStream) GetMimetype ¶
func (f *FileStream) GetMimetype() string
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 }
type FsOtherArgs ¶
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 ObjThumbURL ¶
type Object ¶
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 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 ¶
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:"-"` }
func (User) CanAccessWithoutPassword ¶
func (User) CanAddAria2Tasks ¶
func (User) CanSeeHides ¶
func (User) CanWebdavManage ¶
func (User) CanWebdavRead ¶
func (User) ValidatePassword ¶
Source Files ¶
Click to show internal directories.
Click to hide internal directories.