webdav

package
v1.4.1 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jun 9, 2019 License: MIT Imports: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Config

type Config struct {
	*User
	Auth  bool
	Cors  CorsCfg
	Users map[string]*User
}

Config is the configuration of a WebDAV instance.

func (*Config) ServeHTTP

func (c *Config) ServeHTTP(w http.ResponseWriter, r *http.Request)

ServeHTTP determines if the request is for this plugin, and if all prerequisites are met.

type CorsCfg added in v1.4.0

type CorsCfg struct {
	Enabled      bool
	AllowedHosts []string
}

CorsCfg is the CORS config.

type Rule

type Rule struct {
	Regex  bool
	Allow  bool
	Path   string
	Regexp *regexp.Regexp
}

Rule is a dissalow/allow rule.

type User

type User struct {
	Username string
	Password string
	Scope    string
	Modify   bool
	Rules    []*Rule
	Handler  *webdav.Handler
}

User contains the settings of each user.

func (User) Allowed

func (u User) Allowed(url string) bool

Allowed checks if the user has permission to access a directory/file

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL