fs

package
v1.0.2 Latest Latest
Warning

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

Go to latest
Published: Nov 24, 2024 License: MIT Imports: 10 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Fs

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

func NewFs

func NewFs(cfg *conf.Conf, library *conf.LibraryConf) *Fs

func (*Fs) Mkdir

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

func (*Fs) OpenFile

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

func (*Fs) RemoveAll

func (f *Fs) RemoveAll(ctx context.Context, name string) error

func (*Fs) Rename

func (f *Fs) Rename(ctx context.Context, oldName, newName string) error

func (*Fs) Stat

func (f *Fs) Stat(ctx context.Context, name string) (os.FileInfo, error)

type MatchDir

type MatchDir string

func (MatchDir) Match

func (m MatchDir) Match(path string) bool

type MatchFile

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

func (*MatchFile) Match

func (m *MatchFile) Match(path string) bool

type MatchGroup

type MatchGroup []Matcher

func NewMatchGroup

func NewMatchGroup(patterns []string) (MatchGroup, error)

func (MatchGroup) Match

func (m MatchGroup) Match(path string) bool

type Matcher

type Matcher interface {
	Match(path string) bool
}

func NewMatcher

func NewMatcher(pattern string) (Matcher, error)

type Perm

type Perm int
const (
	PermNone         Perm = 0
	PermRead         Perm = 1 << 1
	PermWrite        Perm = 1 << 2
	PermDelete       Perm = 1 << 3
	PermCreateFolder Perm = 1 << 4
	PermCreateFile   Perm = 1 << 5
	PermRename       Perm = 1 << 6
)

func (*Perm) Check

func (p *Perm) Check(needPerm Perm) bool

func (*Perm) FromString

func (p *Perm) FromString(perms []string)

func (*Perm) String

func (p *Perm) String() string

type Scope

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

func NewScope

func NewScope(scp *conf.ScopeConf) *Scope

func (*Scope) Match

func (s *Scope) Match(name string, perm Perm) (matched, permission bool)

type ScopeGroup

type ScopeGroup []*Scope

func (ScopeGroup) Match

func (s ScopeGroup) Match(path string, perm Perm) (bool, bool)

Jump to

Keyboard shortcuts

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