webdav

package
v0.0.1-alpha0 Latest Latest
Warning

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

Go to latest
Published: Sep 5, 2025 License: MIT Imports: 22 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func NewServer

func NewServer(
	config *Config,
	fs afero.Fs,
	mux *http.ServeMux,
	tokenService *token.Service,
	userRepo *database.UserRepository,
	configGetter config.ConfigGetter,
) (*webdavServer, error)

Types

type AuthCredentials

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

AuthCredentials holds the current WebDAV authentication credentials

func NewAuthCredentials

func NewAuthCredentials(username, password string) *AuthCredentials

NewAuthCredentials creates new authentication credentials

func (*AuthCredentials) GetCredentials

func (ac *AuthCredentials) GetCredentials() (string, string)

GetCredentials returns the current credentials (thread-safe)

func (*AuthCredentials) UpdateCredentials

func (ac *AuthCredentials) UpdateCredentials(username, password string)

UpdateCredentials updates the credentials (thread-safe)

type AuthUpdater

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

AuthUpdater provides methods to update WebDAV authentication

func NewAuthUpdater

func NewAuthUpdater() *AuthUpdater

NewAuthUpdater creates a new WebDAV auth updater

func (*AuthUpdater) SetAuthCredentials

func (u *AuthUpdater) SetAuthCredentials(credentials *AuthCredentials)

SetAuthCredentials sets the auth credentials reference for dynamic updates

func (*AuthUpdater) UpdateAuth

func (u *AuthUpdater) UpdateAuth(username, password string) error

UpdateAuth updates WebDAV authentication credentials

type Config

type Config struct {
	// Port is the port where the webdav server will be listening
	Port int `yaml:"port" default:"8080" mapstructure:"port"`
	// User is the user to access the webdav server
	User string `yaml:"username" default:"usenet" json:"-" mapstructure:"username"`
	// Pass is the password to access the webdav server
	Pass string `yaml:"password" default:"usenet" json:"-" mapstructure:"password"`
	// Debug enables debug mode and exposes profiler endpoints
	Debug bool `yaml:"debug" default:"false" mapstructure:"debug"`
	// Prefix is the URL path prefix for the WebDAV server
	Prefix string `yaml:"prefix" default:"/webdav/" mapstructure:"prefix"`
}

type HTTPError

type HTTPError struct {
	StatusCode int
	Message    string
	Err        error
}

HTTPError represents an HTTP error with a specific status code

func (*HTTPError) Error

func (e *HTTPError) Error() string

func (*HTTPError) Unwrap

func (e *HTTPError) Unwrap() error

Directories

Path Synopsis
xml

Jump to

Keyboard shortcuts

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