Documentation ¶
Overview ¶
Package app provides all app related stuff like config parsing, serving, etc.
Index ¶
- func GenHash(password []byte) string
- func NewBasicAuthWebdavHandler(a *App) http.Handler
- type App
- type AuthInfo
- type Config
- type Cors
- type Dir
- func (d Dir) Mkdir(ctx context.Context, name string, perm os.FileMode) error
- func (d Dir) OpenFile(ctx context.Context, name string, flag int, perm os.FileMode) (webdav.File, error)
- func (d Dir) RemoveAll(ctx context.Context, name string) error
- func (d Dir) Rename(ctx context.Context, oldName, newName string) error
- func (d Dir) Stat(ctx context.Context, name string) (os.FileInfo, error)
- type Logging
- type TLS
- type UserInfo
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func NewBasicAuthWebdavHandler ¶
NewBasicAuthWebdavHandler creates a new http handler with basic auth features. The handler will use the application config for user and password lookups.
Types ¶
type AuthInfo ¶ added in v0.4.0
AuthInfo holds the username and authentication status
func AuthFromContext ¶ added in v0.4.0
AuthFromContext returns information about the authentication state of the current user.
type Config ¶
type Config struct { Address string Port string Prefix string Dir string TLS *TLS Log Logging Realm string Users map[string]*UserInfo Cors Cors }
Config represents the configuration of the server application.
func ParseConfig ¶
func ParseConfig() *Config
ParseConfig parses the application configuration an sets defaults.
func (*Config) AuthenticationNeeded ¶ added in v0.4.0
type Cors ¶ added in v0.4.0
type Cors struct {
Origin string
}
Cors contains settings related to Cross-Origin Resource Sharing (CORS)
type Dir ¶
type Dir struct {
Config *Config
}
Dir is specialization of webdav.Dir with respect of an authenticated user to allow configuration access.
func (Dir) OpenFile ¶
func (d Dir) OpenFile(ctx context.Context, name string, flag int, perm os.FileMode) (webdav.File, error)
OpenFile resolves the physical file and delegates this to an os.OpenFile execution
func (Dir) RemoveAll ¶
RemoveAll resolves the physical file and delegates this to an os.RemoveAll execution