vfsadapter

package
v1.0.2 Latest Latest
Warning

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

Go to latest
Published: Mar 23, 2025 License: Apache-2.0 Imports: 10 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type VFSAdapter

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

VFSAdapter adapts a VFS implementation to the webdav.FileSystem interface

func NewVFSAdapter

func NewVFSAdapter(vfsImpl vfs.VFSImplementation) *VFSAdapter

NewVFSAdapter creates a new VFS adapter for WebDAV

func (*VFSAdapter) Mkdir

func (a *VFSAdapter) Mkdir(ctx context.Context, name string, perm os.FileMode) error

Mkdir creates a directory

func (*VFSAdapter) OpenFile

func (a *VFSAdapter) OpenFile(ctx context.Context, name string, flag int, perm os.FileMode) (webdav.File, error)

OpenFile opens a file or directory

func (*VFSAdapter) RemoveAll

func (a *VFSAdapter) RemoveAll(ctx context.Context, name string) error

RemoveAll removes a file or directory and any children it contains

func (*VFSAdapter) Rename

func (a *VFSAdapter) Rename(ctx context.Context, oldName, newName string) error

Rename renames a file or directory

func (*VFSAdapter) Stat

func (a *VFSAdapter) Stat(ctx context.Context, name string) (os.FileInfo, error)

Stat returns file info for a file or directory

type WebDAVServer

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

WebDAVServer represents a WebDAV server that uses a VFS implementation

func NewWebDAVServer

func NewWebDAVServer(vfsImpl vfs.VFSImplementation, addr string) *WebDAVServer

NewWebDAVServer creates a new WebDAV server using the given VFS implementation

func (*WebDAVServer) Handler

func (s *WebDAVServer) Handler() http.Handler

Handler returns the HTTP handler for the WebDAV server

func (*WebDAVServer) Start

func (s *WebDAVServer) Start() error

Start starts the WebDAV server

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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