system

package
v1.0.17 Latest Latest
Warning

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

Go to latest
Published: May 20, 2024 License: Apache-2.0 Imports: 10 Imported by: 0

Documentation

Index

Constants

View Source
const (
	FileType_Invalid int = iota + 1
	FileType_Object
	FileType_Directory
)

Variables

View Source
var (
	ErrObjectNotFound = fmt.Errorf("Object Not Found")
)

Functions

func GetAllParents

func GetAllParents(path, base string) []string

func Register

func Register(system ISystem)

Types

type Attrs

type Attrs struct {
	Size         int64
	CRC32        uint32
	ModTime      time.Time
	RelativePath string
}

func (*Attrs) Same

func (a *Attrs) Same(b *Attrs, forceChecksum bool) bool

type DUTree

type DUTree struct {
	Name     string
	Size     int64
	Children map[string]*DUTree
}

func NewDUTree

func NewDUTree(name string, size int64, folder bool) *DUTree

func (*DUTree) GetSize

func (t *DUTree) GetSize() int64

func (*DUTree) ToDiskUsages

func (t *DUTree) ToDiskUsages() []DiskUsage

type DiskUsage

type DiskUsage struct {
	Size int64
	Name string
}

type FileObject

type FileObject struct {
	System ISystem
	Bucket string
	Prefix string
	Remote bool

	Attributes *Attrs
	// contains filtered or unexported fields
}

func ParseFileObject

func ParseFileObject(path string) *FileObject

func (*FileObject) FileType

func (fo *FileObject) FileType() int

func (*FileObject) GetFullPath added in v1.0.5

func (fo *FileObject) GetFullPath() string

func (*FileObject) SetAttributes

func (fo *FileObject) SetAttributes(attrs *Attrs)

func (*FileObject) SetInvalid

func (fo *FileObject) SetInvalid()

type ISystem

type ISystem interface {
	Init(buckets ...string) error
	Scheme() string
	Attributes(bucket, prefix string) (*Attrs, error)
	BatchAttributes(bucket, prefix string, recursive bool) ([]*Attrs, error)
	List(bucket, prefix string, recursive bool) ([]*FileObject, error)
	DiskUsage(bucket, prefix string, recursive bool) ([]DiskUsage, error)
	Delete(bucket, prefix string) error
	Copy(srcBucket, srcPrefix, dstBucket, dstPrefix string) error
	Download(bucket, prefix, dstFile string, forceChecksum bool, ctx RunContext) error
	Upload(srcFile, bucket, object string, ctx RunContext) error
	Move(srcBucket, srcPrefix, dstBucket, dstPrefix string) error
	Cat(bucket, prefix string) ([]byte, error)
	IsObject(bucket, prefix string) (bool, error)
	IsDirectory(bucket, prefix string) (bool, error)
}

func Lookup

func Lookup(scheme string) ISystem

type RunContext

type RunContext struct {
	Bars *bar.Container
	Pool *worker.Pool
}

Jump to

Keyboard shortcuts

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