gg_vfs

package
v0.2.80 Latest Latest
Warning

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

Go to latest
Published: Sep 23, 2024 License: BSD-3-Clause Imports: 7 Imported by: 4

Documentation

Index

Constants

View Source
const (
	DriverOS  = "os"
	DriverFTP = "ftp"
)

Variables

This section is empty.

Functions

This section is empty.

Types

type IVFSConstructor

type IVFSConstructor func(args ...interface{}) (controller IVFSController, err error)

type IVFSController

type IVFSController interface {
	Stat(path string) (*VfsFile, error)
	ListAll(dir string) ([]*VfsFile, error)
	Read(source string) ([]byte, error)
	Write(data []byte, target string) (int, error)
	Remove(source string) error
	MkDir(path string) error
	Exists(path string) (bool, error)
}

func NewVfsDriverOS

func NewVfsDriverOS(args ...interface{}) (controller IVFSController, err error)

type VFSHelper

type VFSHelper struct {
	// contains filtered or unexported fields
}
var VFS *VFSHelper

func (*VFSHelper) AddConstructor

func (instance *VFSHelper) AddConstructor(driverName string, ctr func(args ...interface{}) (controller IVFSController, err error))

func (*VFSHelper) New

func (instance *VFSHelper) New(driverName string, args ...interface{}) (response IVFSController, err error)

func (*VFSHelper) NewOS

func (instance *VFSHelper) NewOS() (response IVFSController)

type VfsDriverOS

type VfsDriverOS struct {
}

VfsDriverOS ( Operating System )

func (*VfsDriverOS) Exists

func (instance *VfsDriverOS) Exists(path string) (response bool, err error)

func (*VfsDriverOS) ListAll

func (instance *VfsDriverOS) ListAll(dir string) (response []*VfsFile, err error)

func (*VfsDriverOS) MkDir

func (instance *VfsDriverOS) MkDir(path string) (err error)

func (*VfsDriverOS) NewFile

func (instance *VfsDriverOS) NewFile(path string) (response *VfsFile, err error)

func (*VfsDriverOS) Read

func (instance *VfsDriverOS) Read(source string) (response []byte, err error)

func (*VfsDriverOS) Remove

func (instance *VfsDriverOS) Remove(source string) (err error)

func (*VfsDriverOS) Stat

func (instance *VfsDriverOS) Stat(path string) (response *VfsFile, err error)

func (*VfsDriverOS) Write

func (instance *VfsDriverOS) Write(data []byte, target string) (response int, err error)

type VfsFile

type VfsFile struct {
	AbsolutePath string    `json:"absolute-path"`
	RelativePath string    `json:"relative-path"`
	Root         string    `json:"root"`
	Name         string    `json:"name"`
	Size         int64     `json:"size"`
	ModTime      time.Time `json:"mod_time"`
	IsDir        bool      `json:"is_dir"`
	Mode         string    `json:"mode"`
}

func (*VfsFile) MatchAll

func (instance *VfsFile) MatchAll(filters ...string) bool

func (*VfsFile) MatchOne

func (instance *VfsFile) MatchOne(filters ...string) bool

func (*VfsFile) SetAbsolutePath

func (instance *VfsFile) SetAbsolutePath(path string) *VfsFile

func (*VfsFile) SetRoot

func (instance *VfsFile) SetRoot(path string) *VfsFile

func (*VfsFile) String

func (instance *VfsFile) String() string

Jump to

Keyboard shortcuts

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