Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type Branding ¶
type Branding struct {
Name string `json:"name"`
DisableExternal bool `json:"disableExternal"`
Files string `json:"files"`
Theme string `json:"theme"`
}
Branding contains the branding settings of the app.
type Server ¶
type Server struct {
Root string `json:"root"`
BaseURL string `json:"baseURL"`
Socket string `json:"socket"`
TLSKey string `json:"tlsKey"`
TLSCert string `json:"tlsCert"`
Port string `json:"port"`
Address string `json:"address"`
Log string `json:"log"`
EnableThumbnails bool `json:"enableThumbnails"`
ResizePreview bool `json:"resizePreview"`
EnableExec bool `json:"enableExec"`
TypeDetectionByHeader bool `json:"typeDetectionByHeader"`
}
Server specific settings.
type Settings ¶
type Settings struct {
Key []byte `json:"key"`
Signup bool `json:"signup"`
CreateUserDir bool `json:"createUserDir"`
Defaults UserDefaults `json:"defaults"`
AuthMethod AuthMethod `json:"authMethod"`
Branding Branding `json:"branding"`
Commands map[string][]string `json:"commands"`
Shell []string `json:"shell"`
Rules []rules.Rule `json:"rules"`
}
Settings contain the main settings of the application.
type Storage ¶
type Storage struct {
// contains filtered or unexported fields
}
Storage is a settings storage.
func NewStorage ¶
func NewStorage(back StorageBackend) *Storage
NewStorage creates a settings storage from a backend.
func (*Storage) SaveServer ¶
SaveServer wraps StorageBackend.SaveServer and adds some verification.
type StorageBackend ¶
type StorageBackend interface {
Get() (*Settings, error)
Save(*Settings) error
GetServer() (*Server, error)
SaveServer(*Server) error
}
StorageBackend is a settings storage backend.
type UserDefaults ¶
type UserDefaults struct {
Scope string `json:"scope"`
Locale string `json:"locale"`
ViewMode users.ViewMode `json:"viewMode"`
SingleClick bool `json:"singleClick"`
Sorting files.Sorting `json:"sorting"`
Perm users.Permissions `json:"perm"`
Commands []string `json:"commands"`
HideDotfiles bool `json:"hideDotfiles"`
}
UserDefaults is a type that holds the default values for some fields on User.
func (*UserDefaults) Apply ¶
func (d *UserDefaults) Apply(u *users.User)
Apply applies the default options to a user.
Click to show internal directories.
Click to hide internal directories.