webdav

package
v0.0.0-...-a6c168f Latest Latest
Warning

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

Go to latest
Published: Dec 13, 2020 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 {
	Auth  bool
	Cors  CorsCfg
	Users map[string]*User
}

Config is the configuration of a WebDAV instance.

type ConfigBasedWebdavHandler

type ConfigBasedWebdavHandler struct {
	// contains filtered or unexported fields
}

ConfigBasedWebdavHandler is a wrapper around config to expose ServeHTTP only

func HandlerFromConfig

func HandlerFromConfig(c *Config) *ConfigBasedWebdavHandler

HandlerFromConfig generates config based handler

func (*ConfigBasedWebdavHandler) ServeHTTP

type CorsCfg

type CorsCfg struct {
	Enabled        bool
	Credentials    bool
	AllowedHeaders []string
	AllowedHosts   []string
	AllowedMethods []string
	ExposedHeaders []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
}

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