Versions in this module Expand all Collapse all v1 v1.11.0 Jan 5, 2019 Changes in this version + const ListViewMode + const MosaicViewMode + const Version + var DefaultUser = User + var ErrEmptyPassword = errors.New("password is empty") + var ErrEmptyRequest = errors.New("request body is empty") + var ErrEmptyScope = errors.New("scope is empty") + var ErrEmptyUsername = errors.New("username is empty") + var ErrExist = errors.New("the resource already exists") + var ErrInvalidOption = errors.New("invalid option") + var ErrInvalidUpdateField = errors.New("invalid field to update") + var ErrNotExist = errors.New("the resource does not exist") + var ErrWrongDataType = errors.New("wrong data type") + func CheckPasswordHash(password, hash string) bool + func GenerateRandomBytes(n int) ([]byte, error) + func HashPassword(password string) (string, error) + type Auth struct + Header string + Method string + type Command func(r *http.Request, m *FileBrowser, u *User) error + type ConfigStore interface + Get func(name string, to interface{}) error + Save func(name string, from interface{}) error + type Context struct + File *File + Router string + User *User + type FSBuilder func(scope string) FileSystem + type File struct + Content string + Extension string + IsDir bool + Kind string + Language string + Metadata string + ModTime time.Time + Mode os.FileMode + Name string + Path string + Size int64 + Type string + URL string + VirtualPath string + func GetInfo(url *url.URL, c *FileBrowser, u *User) (*File, error) + func (i *File) GetEditor() error + func (i *File) GetFileType(checkContent bool) error + func (i *File) GetListing(u *User, r *http.Request) error + func (i File) CanBeEdited() bool + func (i File) Checksum(algo string) (string, error) + type FileBrowser struct + Assets *rice.Box + Auth *Auth + BaseURL string + CSS string + Commands map[string][]string + Cron *cron.Cron + DefaultUser *User + Key []byte + NewFS FSBuilder + PrefixURL string + ReCaptcha *ReCaptcha + StaticGen StaticGen + Store *Store + func (m *FileBrowser) Attach(s StaticGen) error + func (m *FileBrowser) SetBaseURL(url string) + func (m *FileBrowser) SetPrefixURL(url string) + func (m *FileBrowser) Setup() error + func (m FileBrowser) RootURL() string + func (m FileBrowser) Runner(event string, path string, destination string, user *User) error + func (m FileBrowser) ShareCleaner() + type FileSystem interface + Copy func(src, dst string) error + Mkdir func(name string, perm os.FileMode) error + OpenFile func(name string, flag int, perm os.FileMode) (*os.File, error) + RemoveAll func(name string) error + Rename func(oldName, newName string) error + Stat func(name string) (os.FileInfo, error) + type Listing struct + Items []*File + NumDirs int + NumFiles int + Order string + Sort string + func (l Listing) ApplySort() + type ReCaptcha struct + Host string + Key string + Secret string + type Regexp struct + Raw string + func (r *Regexp) MatchString(s string) bool + type Rule struct + Allow bool + Path string + Regex bool + Regexp *Regexp + type ShareLink struct + ExpireDate time.Time + Expires bool + Hash string + Path string + type ShareStore interface + Delete func(hash string) error + Get func(hash string) (*ShareLink, error) + GetByPath func(path string) ([]*ShareLink, error) + GetPermanent func(path string) (*ShareLink, error) + Gets func() ([]*ShareLink, error) + Save func(s *ShareLink) error + type StaticGen interface + Hook func(c *Context, w http.ResponseWriter, r *http.Request) (int, error) + Name func() string + Preview func(c *Context, w http.ResponseWriter, r *http.Request) (int, error) + Publish func(c *Context, w http.ResponseWriter, r *http.Request) (int, error) + SettingsPath func() string + Setup func() error + type Store struct + Config ConfigStore + Share ShareStore + Users UsersStore + type User struct + Admin bool + AllowCommands bool + AllowEdit bool + AllowNew bool + AllowPublish bool + CSS string + Commands []string + FileSystem FileSystem + ID int + Locale string + LockPassword bool + Password string + Rules []*Rule + Scope string + Username string + ViewMode string + func (u User) Allowed(url string) bool + type UsersStore interface + Delete func(id int) error + Get func(id int, builder FSBuilder) (*User, error) + GetByUsername func(username string, builder FSBuilder) (*User, error) + Gets func(builder FSBuilder) ([]*User, error) + Save func(u *User) error + Update func(u *User, fields ...string) error