Documentation ¶
Index ¶
- type Dir
- type File
- type Filebox
- func (filebox *Filebox) AccessDir(dirPath string, roles ...string) *Dir
- func (filebox *Filebox) AccessFile(filePath string, roles ...string) *File
- func (filebox *Filebox) Download(w http.ResponseWriter, req *http.Request)
- func (filebox *Filebox) MountTo(mountTo string, mux *http.ServeMux)
- func (filebox *Filebox) ServeHTTP(w http.ResponseWriter, req *http.Request)
- func (filebox *Filebox) SetAuth(auth admin.Auth)
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Dir ¶
Dir is a object to access a specific directory
func (*Dir) HasPermission ¶
func (dir *Dir) HasPermission(mode roles.PermissionMode) bool
HasPermission used to check current user whether have permission to access directory
func (*Dir) SetPermission ¶
func (dir *Dir) SetPermission(permission *roles.Permission) (err error)
SetPermission used to set a Permission to directory
type File ¶
File is a object to access a specific file
func (*File) HasPermission ¶
func (f *File) HasPermission(mode roles.PermissionMode) bool
HasPermission used to check current user whether have permission to access file
func (*File) Read ¶
func (f *File) Read() (io.ReadSeeker, error)
Read will get a io reader for a specific file
func (*File) SetPermission ¶
func (f *File) SetPermission(permission *roles.Permission) (err error)
SetPermission used to set a Permission to file
type Filebox ¶
Filebox is a based object contains download folder path and admin.Auth used to get current user
func (*Filebox) AccessFile ¶
AccessFile will return a specific File object
func (*Filebox) Download ¶
func (filebox *Filebox) Download(w http.ResponseWriter, req *http.Request)
Download is a handler will return a specific file
Click to show internal directories.
Click to hide internal directories.