fs

package
v0.0.0-...-e013615 Latest Latest
Warning

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

Go to latest
Published: Feb 22, 2023 License: MIT Imports: 0 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Attributes

type Attributes struct {
	Size         int64
	LastModified int64
}

type BaseOperation

type BaseOperation interface {
	Put(file string, content []byte, visibility Visibility) error
	Get(file string) ([]byte, error)
	Attributes(file string) Attributes
	Exists(file string) bool
	Delete(files ...string) error
	Directories(dir string) []Disk
	Files(dir string) []*File
}

type Disk

type Disk interface {
	BaseOperation
	Missing(file string) bool
	Size(file string) int64
	LastModified(file string) int64
	Path(file string) string
	Prepend(file string, content []byte) error
	Append(file string, content []byte) error
	Copy(source string, destination string) error
	Move(source string, destination string) error
	MakeDirectory(dir string, visibility Visibility) error
	DeleteDirectory(dir string) error
	AllFiles(dir string) []*File
	AllDirectories(dir string) []Disk
	File(file string) *File
	Prefix(prefix string) Disk
	Cwd() string
}

type File

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

func NewFile

func NewFile(store Disk, path string, name string) *File

func (*File) Append

func (f *File) Append(content []byte) error

func (*File) Copy

func (f *File) Copy(target string) error

func (*File) Delete

func (f *File) Delete() error

func (*File) Get

func (f *File) Get() ([]byte, error)

func (*File) LastModified

func (f *File) LastModified() int64

func (*File) Move

func (f *File) Move(target string) error

func (*File) Name

func (f *File) Name() string

func (*File) Path

func (f *File) Path() string

func (*File) Prepend

func (f *File) Prepend(content []byte) error

func (*File) Put

func (f *File) Put(content []byte, visibility Visibility) error

func (*File) Size

func (f *File) Size() int64

func (*File) Write

func (f *File) Write(p []byte) (n int, err error)

type Visibility

type Visibility uint32
const (
	PUBLIC  Visibility = 0755
	PRIVATE            = 0600
)

Jump to

Keyboard shortcuts

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