Documentation
¶
Index ¶
- Constants
- Variables
- type CooldownLimiter
- type Copier
- type Driver
- type Entry
- type EntryType
- type FlattenMove
- type FlattenOptions
- type FlattenResult
- type Limiter
- type Mkdirer
- type Mover
- type RateLimitedDriver
- func (d *RateLimitedDriver) Copy(ctx context.Context, targetDirID, entryID string) error
- func (d *RateLimitedDriver) Delete(ctx context.Context, entryID string) error
- func (d *RateLimitedDriver) List(ctx context.Context, dirID string) ([]Entry, error)
- func (d *RateLimitedDriver) Lookup(ctx context.Context, parentID, name string) (Entry, error)
- func (d *RateLimitedDriver) Mkdir(ctx context.Context, parentID, name string) (Entry, error)
- func (d *RateLimitedDriver) Move(ctx context.Context, targetDirID, entryID string) (Entry, error)
- func (d *RateLimitedDriver) Provider() string
- func (d *RateLimitedDriver) Rename(ctx context.Context, entryID, newName string) (Entry, error)
- func (d *RateLimitedDriver) Root(ctx context.Context) (Entry, error)
- func (d *RateLimitedDriver) Stat(ctx context.Context, entryID string) (Entry, error)
- type Reader
- type Remover
- type Renamer
- type SearchOptions
- type Searcher
- type Session
- func (s *Session) Cd(ctx context.Context, target string) (Entry, error)
- func (s *Session) Cp(ctx context.Context, targetDir string, sources ...string) error
- func (s *Session) Cwd() Entry
- func (s *Session) Flatten(ctx context.Context, target string, opts FlattenOptions) (FlattenResult, error)
- func (s *Session) ListCacheTTL() time.Duration
- func (s *Session) Ls(ctx context.Context, target string) ([]Entry, error)
- func (s *Session) Mkdir(ctx context.Context, target string) (Entry, error)
- func (s *Session) Mv(ctx context.Context, targetDir string, sources ...string) ([]Entry, error)
- func (s *Session) Provider() string
- func (s *Session) Pwd() string
- func (s *Session) Refresh()
- func (s *Session) Rename(ctx context.Context, target, newName string) (Entry, error)
- func (s *Session) Resolve(ctx context.Context, target string) (Entry, string, error)
- func (s *Session) Rm(ctx context.Context, targets ...string) error
- func (s *Session) Search(ctx context.Context, searchRoot, keyword string, opts SearchOptions) ([]Entry, error)
- func (s *Session) SearchMove(ctx context.Context, searchRoot, keyword, targetDir string, opts SearchOptions) ([]Entry, error)
- func (s *Session) SetListCacheTTL(ttl time.Duration)
- func (s *Session) Stat(ctx context.Context, target string) (Entry, error)
Constants ¶
View Source
const DefaultListCacheTTL = 5 * time.Second
Variables ¶
View Source
var ( ErrNotFound = errors.New("cloudfs: not found") ErrNotDirectory = errors.New("cloudfs: not a directory") ErrAlreadyExists = errors.New("cloudfs: already exists") ErrInvalidPath = errors.New("cloudfs: invalid path") ErrInvalidName = errors.New("cloudfs: invalid name") ErrAmbiguousPath = errors.New("cloudfs: ambiguous path") ErrUnsupported = errors.New("cloudfs: unsupported operation") ErrRateLimited = errors.New("cloudfs: rate limited") ErrProviderFailure = errors.New("cloudfs: provider failure") )
Functions ¶
This section is empty.
Types ¶
type CooldownLimiter ¶
type CooldownLimiter struct {
// contains filtered or unexported fields
}
func NewCooldownLimiter ¶
func NewCooldownLimiter(min, max time.Duration) *CooldownLimiter
type Driver ¶
Driver is the aggregate facade combining all capability interfaces.
func NewRateLimitedDriver ¶
type Entry ¶
type FlattenMove ¶
type FlattenMove struct {
Source Entry
}
FlattenMove describes one future move from a nested path into the target dir.
type FlattenOptions ¶
FlattenOptions controls future flatten execution behaviour.
type FlattenResult ¶
type FlattenResult struct {
Target Entry
PlannedMoves []FlattenMove
PlannedRemovals []Entry
Moved []Entry
RemovedDirs []Entry
}
FlattenResult is the long-term result model for the flatten composite command.
type RateLimitedDriver ¶
type RateLimitedDriver struct {
// contains filtered or unexported fields
}
func (*RateLimitedDriver) Copy ¶
func (d *RateLimitedDriver) Copy(ctx context.Context, targetDirID, entryID string) error
func (*RateLimitedDriver) Delete ¶
func (d *RateLimitedDriver) Delete(ctx context.Context, entryID string) error
func (*RateLimitedDriver) Provider ¶
func (d *RateLimitedDriver) Provider() string
type SearchOptions ¶
type Session ¶
type Session struct {
// contains filtered or unexported fields
}
func (*Session) Flatten ¶
func (s *Session) Flatten(ctx context.Context, target string, opts FlattenOptions) (FlattenResult, error)
Flatten expands descendant files into the target directory and optionally removes emptied descendant directories.
func (*Session) ListCacheTTL ¶
func (*Session) Search ¶
func (s *Session) Search(ctx context.Context, searchRoot, keyword string, opts SearchOptions) ([]Entry, error)
Search resolves searchRoot as a directory and returns provider search results.
func (*Session) SearchMove ¶
func (s *Session) SearchMove( ctx context.Context, searchRoot, keyword, targetDir string, opts SearchOptions, ) ([]Entry, error)
SearchMove searches files under searchRoot and moves matched files into targetDir. It pre-checks basename conflicts in targetDir before applying moves.
func (*Session) SetListCacheTTL ¶
Click to show internal directories.
Click to hide internal directories.