fs

package
v0.0.0-...-9853328 Latest Latest
Warning

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

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

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func FormatPath

func FormatPath(path string) string

func ResolvePath

func ResolvePath(path string) string

func SplitPath

func SplitPath(fullpath string) (volume, path string)

Types

type DirectoryEntry

type DirectoryEntry struct {
	Dir  string
	Info FileInfo
}

func ParseDir

func ParseDir(real, virtual string) (ret []DirectoryEntry)

type File

type File interface {
	Open(owner, wanter string) ([]string, error)
	Close(fd string)
	Info(owner string) FileInfo
	Append(owner string, meta FileInfo)
}

type FileInfo

type FileInfo struct {
	Owner    string `json:"owner"`
	Size     int64  `json:"size"`
	Hash     string `json:"hash"`
	CreateAt int64  `json:"createAt"`
	Path     string `json:"path"`
}

type FileSystem

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

func NewFileSystem

func NewFileSystem() *FileSystem

func (*FileSystem) Find

func (fs *FileSystem) Find(path string) File

func (*FileSystem) Get

func (fs *FileSystem) Get(src, dst string) error

func (*FileSystem) List

func (fs *FileSystem) List(dir string) (ret []string)

func (*FileSystem) Put

func (fs *FileSystem) Put(src, dst string) error

type FileSystemCache

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

func (*FileSystemCache) Clean

func (fcache *FileSystemCache) Clean()

type SharedFile

type SharedFile struct {
	Files map[string]*atomicFileSet
	Name  string
}

func (*SharedFile) Append

func (fp *SharedFile) Append(producer string, meta FileInfo)

func (*SharedFile) Close

func (file *SharedFile) Close(fd string)

func (*SharedFile) Info

func (file *SharedFile) Info(producer string) FileInfo

func (*SharedFile) Open

func (fp *SharedFile) Open(producer, consumer string) (ret []string, err error)

func (*SharedFile) Save

func (f *SharedFile) Save() string

type Volume

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

func NewVolume

func NewVolume(name string) *Volume

func (*Volume) Get

func (v *Volume) Get(dir string) File

func (*Volume) List

func (v *Volume) List(dir string) []string

func (*Volume) Name

func (v *Volume) Name() string

func (*Volume) Put

func (v *Volume) Put(entry DirectoryEntry)

func (*Volume) SwapIn

func (v *Volume) SwapIn()

func (*Volume) SwapOut

func (v *Volume) SwapOut()

type VolumeEntry

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

func (*VolumeEntry) Free

func (entry *VolumeEntry) Free()

func (*VolumeEntry) Key

func (entry *VolumeEntry) Key() string

func (*VolumeEntry) SetKey

func (entry *VolumeEntry) SetKey(k string)

func (*VolumeEntry) SetValue

func (entry *VolumeEntry) SetValue(v *Volume)

func (*VolumeEntry) Value

func (entry *VolumeEntry) Value() *Volume

Jump to

Keyboard shortcuts

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