fs

package
v0.0.0-...-8d3529a Latest Latest
Warning

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

Go to latest
Published: Nov 20, 2019 License: Apache-2.0 Imports: 21 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	GearPath            = "/var/lib/gear/"
	GearPublicCachePath = filepath.Join(GearPath, "public")

	ManagerIp   string
	ManagerPort string

	RecordChan chan types.MonitorFile

	NeedMonitor bool

	ValidTime = 600 * time.Second
)

Functions

func ValidatePath

func ValidatePath(path string) (string, error)

Types

type Dir

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

func (*Dir) Access

func (d *Dir) Access(ctx context.Context, req *fuse.AccessRequest) error

func (*Dir) Attr

func (d *Dir) Attr(ctx context.Context, attr *fuse.Attr) error

TODO: 实际获取每个目录的属性

func (*Dir) Lookup

func (d *Dir) Lookup(ctx context.Context, req *fuse.LookupRequest, resp *fuse.LookupResponse) (fs.Node, error)

func (*Dir) ReadDirAll

func (d *Dir) ReadDirAll(ctx context.Context) ([]fuse.Dirent, error)

type FS

type FS struct {
	IndexImagePath   string
	PrivateCachePath string
	UpperPath        string

	InitLayerPath string
}

func Init

func Init(indexImagePath, privateCachePath, upperPath, initLayerPath, managerIp, managerPort string, rChan chan types.MonitorFile, needMonitor bool) *FS

func (*FS) Root

func (f *FS) Root() (fs.Node, error)

type File

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

func (*File) Access

func (f *File) Access(ctx context.Context, req *fuse.AccessRequest) error

func (*File) Attr

func (f *File) Attr(ctx context.Context, attr *fuse.Attr) error

func (*File) Open

func (f *File) Open(ctx context.Context, req *fuse.OpenRequest, resp *fuse.OpenResponse) (fs.Handle, error)
func (f *File) Readlink(ctx context.Context, req *fuse.ReadlinkRequest) (string, error)

type FileHandler

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

func (*FileHandler) Flush

func (fh *FileHandler) Flush(ctx context.Context, req *fuse.FlushRequest) error

func (*FileHandler) Read

func (fh *FileHandler) Read(ctx context.Context, req *fuse.ReadRequest, resp *fuse.ReadResponse) error

func (*FileHandler) ReadAll

func (fh *FileHandler) ReadAll(ctx context.Context) ([]byte, error)

func (*FileHandler) Release

func (fh *FileHandler) Release(ctx context.Context, req *fuse.ReleaseRequest) error

type GearFS

type GearFS struct {
	MountPoint string

	IndexImagePath   string
	PrivateCachePath string
	UpperPath        string

	ManagerIp   string
	ManagerPort string

	RecordChan chan types.MonitorFile

	InitLayerPath string

	NeedMonitor bool
}

func (*GearFS) Start

func (g *GearFS) Start()

func (*GearFS) StartAndNotify

func (g *GearFS) StartAndNotify(notify chan int, monitor bool)

Jump to

Keyboard shortcuts

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