core

package
v0.0.0-...-e38a99a Latest Latest
Warning

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

Go to latest
Published: Feb 24, 2022 License: Apache-2.0 Imports: 7 Imported by: 0

Documentation

Index

Constants

View Source
const (
	RemoteServerScheme      = "rs://"
	RemoteServerDefaultPort = 8105
)

Variables

This section is empty.

Functions

func VFSVar

func VFSVar(p *VFS, name string, value VFS, usage string)

VFSVar defines a VFS flag with specified name, default value, and usage string. The argument p points to a VFS variable in which to store the value of the flag.

Types

type VFS

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

VFS virtual file system

func NewDiskVFS

func NewDiskVFS(path string) VFS

NewDiskVFS create an instance of VFS for the local disk file system

func NewEmptyVFS

func NewEmptyVFS() VFS

NewEmptyVFS create an instance of VFS for the unknown file system

func NewVFS

func NewVFS(path string) VFS

NewVFS auto recognition the file system and create an instance of VFS according to the path

func VFSFlag

func VFSFlag(name string, value VFS, usage string) *VFS

VFSFlag defines a VFS flag with specified name, default value, and usage string. The return value is the address of a VFS variable that stores the value of the flag.

func (*VFS) Abs

func (vfs *VFS) Abs() (string, error)

Abs returns an absolute representation of path

func (*VFS) FsServer

func (vfs *VFS) FsServer() string

FsServer file server access addr

func (*VFS) Host

func (vfs *VFS) Host() string

Host server or client host

func (*VFS) Is

func (vfs *VFS) Is(t VFSType) bool

Is current VFS is type of t

func (*VFS) IsDisk

func (vfs *VFS) IsDisk() bool

IsDisk is local file system

func (*VFS) IsEmpty

func (vfs *VFS) IsEmpty() bool

IsEmpty whether the file path is empty

func (*VFS) LocalSyncDisabled

func (vfs *VFS) LocalSyncDisabled() bool

LocalSyncDisabled is local disk sync disabled

func (*VFS) Path

func (vfs *VFS) Path() string

Path file path

func (*VFS) Port

func (vfs *VFS) Port() int

Port server or client port

func (*VFS) Server

func (vfs *VFS) Server() bool

Server is server mode

func (*VFS) Type

func (vfs *VFS) Type() VFSType

Type file system type

type VFSType

type VFSType int

VFSType the file data source type

const (
	// Unknown the unknown file data source
	Unknown VFSType = iota
	// Disk the local disk file system data source
	Disk
	// RemoteDisk the remote disk file system data source
	RemoteDisk
	// FTP the ftp data source
	FTP
	// SFTP the sftp data source
	SFTP
	// NetworkDisk the network disk data source
	NetworkDisk
	// SharedFolder the shared folder data source
	SharedFolder
)

func (VFSType) String

func (t VFSType) String() string

String return the VFSType name

Jump to

Keyboard shortcuts

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