lfs

package
v1.0.0 Latest Latest
Warning

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

Go to latest
Published: Feb 27, 2024 License: MIT Imports: 13 Imported by: 0

Documentation

Overview

Package lfs inclues a local file system

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Check

func Check(source string, destination string) error

Check returns an error if there is a cycle error.

func Dir

func Dir(p string) string

Dir returns all but the last element of path

func Split

func Split(p string) []string

Split splits the path using the path separator for the local operating system

Types

type LocalDirectoryEntry

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

func (*LocalDirectoryEntry) IsDir

func (lde *LocalDirectoryEntry) IsDir() bool

func (*LocalDirectoryEntry) MarshalJSON

func (lde *LocalDirectoryEntry) MarshalJSON() ([]byte, error)

func (*LocalDirectoryEntry) ModTime

func (lde *LocalDirectoryEntry) ModTime() time.Time

func (*LocalDirectoryEntry) Name

func (lde *LocalDirectoryEntry) Name() string

func (*LocalDirectoryEntry) Size

func (lde *LocalDirectoryEntry) Size() int64

func (*LocalDirectoryEntry) String

func (lde *LocalDirectoryEntry) String() string

type LocalFile

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

func NewLocalFile

func NewLocalFile(file afero.File) *LocalFile

func (*LocalFile) Close

func (lf *LocalFile) Close() error

func (*LocalFile) Name

func (lf *LocalFile) Name() string

func (*LocalFile) Read

func (lf *LocalFile) Read(s []byte) (int, error)

func (*LocalFile) Seek

func (lf *LocalFile) Seek(offset int64, whence int) (int64, error)

func (*LocalFile) Write

func (lf *LocalFile) Write(s []byte) (int, error)

func (*LocalFile) WriteAt

func (lf *LocalFile) WriteAt(s []byte, o int64) (int, error)

func (*LocalFile) WriteTo

func (lf *LocalFile) WriteTo(ctx context.Context, w fs.Writer) (int64, error)

type LocalFileInfo

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

func NewLocalFileInfo

func NewLocalFileInfo(name string, modTime time.Time, dir bool, size int64) *LocalFileInfo

func (*LocalFileInfo) IsDir

func (fi *LocalFileInfo) IsDir() bool

func (*LocalFileInfo) ModTime

func (fi *LocalFileInfo) ModTime() time.Time

func (*LocalFileInfo) Name

func (fi *LocalFileInfo) Name() string

func (*LocalFileInfo) Size

func (fi *LocalFileInfo) Size() int64

func (*LocalFileInfo) String

func (fi *LocalFileInfo) String() string

type LocalFileSystem

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

func NewLocalFileSystem

func NewLocalFileSystem(rootPath string) *LocalFileSystem

func NewReadOnlyLocalSystem

func NewReadOnlyLocalSystem(rootPath string) *LocalFileSystem

func (*LocalFileSystem) Chtimes

func (lfs *LocalFileSystem) Chtimes(ctx context.Context, name string, atime time.Time, mtime time.Time) error

func (*LocalFileSystem) Copy

func (lfs *LocalFileSystem) Copy(ctx context.Context, input *fs.CopyInput) error

func (*LocalFileSystem) Dir

func (lfs *LocalFileSystem) Dir(name string) string

func (*LocalFileSystem) IsNotExist

func (lfs *LocalFileSystem) IsNotExist(err error) bool

func (*LocalFileSystem) Join

func (lfs *LocalFileSystem) Join(name ...string) string

func (*LocalFileSystem) MagicNumber

func (lfs *LocalFileSystem) MagicNumber(ctx context.Context, name string) ([]byte, error)

func (*LocalFileSystem) MagicNumbers

func (lfs *LocalFileSystem) MagicNumbers(ctx context.Context, names []string, threads int) ([][]byte, error)

MagicNumbers retrieves the magic numbers for the files with the names in the array. If an element is empty, then skips.

func (*LocalFileSystem) MkdirAll

func (lfs *LocalFileSystem) MkdirAll(ctx context.Context, name string, mode os.FileMode) error

func (*LocalFileSystem) MustRelative

func (lfs *LocalFileSystem) MustRelative(ctx context.Context, base string, target string) string

func (*LocalFileSystem) Open

func (lfs *LocalFileSystem) Open(ctx context.Context, name string) (fs.Object, error)

func (*LocalFileSystem) OpenFile

func (lfs *LocalFileSystem) OpenFile(ctx context.Context, name string, flag int, perm os.FileMode) (fs.File, error)

func (*LocalFileSystem) OpenObject

func (lfs *LocalFileSystem) OpenObject(ctx context.Context, name string, flag int, perm os.FileMode) (fs.Object, error)

func (*LocalFileSystem) ReadDir

func (lfs *LocalFileSystem) ReadDir(ctx context.Context, name string, recursive bool) ([]fs.DirectoryEntryInterface, error)

func (*LocalFileSystem) ReadFile

func (lfs *LocalFileSystem) ReadFile(ctx context.Context, name string, data []byte) (int, error)

func (*LocalFileSystem) Relative

func (lfs *LocalFileSystem) Relative(ctx context.Context, basepath string, targetpath string) (string, error)

func (*LocalFileSystem) RemoveDirectories

func (lfs *LocalFileSystem) RemoveDirectories(ctx context.Context, names []string, recursive bool) error

func (*LocalFileSystem) RemoveDirectory

func (lfs *LocalFileSystem) RemoveDirectory(ctx context.Context, name string, recursive bool) error

func (*LocalFileSystem) RemoveFile

func (lfs *LocalFileSystem) RemoveFile(ctx context.Context, name string) error

func (*LocalFileSystem) RemoveFiles

func (lfs *LocalFileSystem) RemoveFiles(ctx context.Context, names []string) error

func (*LocalFileSystem) Root

func (lfs *LocalFileSystem) Root() string

func (*LocalFileSystem) Size

func (lfs *LocalFileSystem) Size(ctx context.Context, name string) (int64, error)

func (*LocalFileSystem) Stat

func (lfs *LocalFileSystem) Stat(ctx context.Context, name string) (fs.FileInfo, error)

func (*LocalFileSystem) Sync

func (lfs *LocalFileSystem) Sync(ctx context.Context, input *fs.SyncInput) (int, error)

Sync synchronizes the input directory to the output directory in the local file system

func (*LocalFileSystem) SyncDirectory

func (lfs *LocalFileSystem) SyncDirectory(ctx context.Context, input *fs.SyncDirectoryInput) (int, error)

Jump to

Keyboard shortcuts

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