core

package
v0.7.2 Latest Latest
Warning

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

Go to latest
Published: Aug 21, 2023 License: Apache-2.0 Imports: 8 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Duration added in v0.3.3

type Duration time.Duration

Duration a duration with custom encoding

func (Duration) Duration added in v0.3.3

func (d Duration) Duration() time.Duration

Duration return the origin time.Duration

func (Duration) MarshalText added in v0.3.3

func (d Duration) MarshalText() (text []byte, err error)

MarshalText implement interface encoding.TextMarshaler

func (*Duration) UnmarshalText added in v0.3.3

func (d *Duration) UnmarshalText(data []byte) error

UnmarshalText implement interface encoding.TextUnmarshaler

type FlagSet added in v0.6.1

type FlagSet struct {
	*flag.FlagSet
}

FlagSet is a custom flag.FlagSet

func NewFlagSet added in v0.6.1

func NewFlagSet(name string, errorHandling flag.ErrorHandling) *FlagSet

NewFlagSet returns a new, empty flag set with the specified name and error handling property. If the name is not empty, it will be printed in the default usage message and in error messages.

func (*FlagSet) DurationVar added in v0.6.1

func (f *FlagSet) DurationVar(p *Duration, name string, value time.Duration, usage string)

DurationVar defines a core.Duration flag with specified name, default value, and usage string. The argument p points to a core.Duration variable in which to store the value of the flag. The flag accepts a value acceptable to time.ParseDuration.

func (*FlagSet) VFSFlag added in v0.6.1

func (f *FlagSet) 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 (*FlagSet) VFSVar added in v0.6.1

func (f *FlagSet) 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.

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 (*VFS) Abs added in v0.2.4

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

Abs returns an absolute representation of Path

func (*VFS) Addr added in v0.4.3

func (vfs *VFS) Addr() string

Addr returns the server address

func (*VFS) FsServer

func (vfs *VFS) FsServer() string

FsServer file server access addr

func (*VFS) Host

func (vfs *VFS) Host() string

Host returns the server 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 added in v0.2.4

func (vfs *VFS) IsEmpty() bool

IsEmpty whether the local file path is empty

func (*VFS) LocalSyncDisabled

func (vfs *VFS) LocalSyncDisabled() bool

LocalSyncDisabled is local disk sync disabled

func (VFS) MarshalText added in v0.3.3

func (vfs VFS) MarshalText() (text []byte, err error)

MarshalText implement interface encoding.TextMarshaler

func (*VFS) Path

func (vfs *VFS) Path() string

Path the local file path

func (*VFS) Port

func (vfs *VFS) Port() int

Port returns the server port

func (*VFS) RemotePath added in v0.4.3

func (vfs *VFS) RemotePath() string

RemotePath the remote file path

func (*VFS) Secure added in v0.4.4

func (vfs *VFS) Secure() bool

Secure use secure connection

func (*VFS) Server

func (vfs *VFS) Server() bool

Server is server mode

func (*VFS) Type

func (vfs *VFS) Type() VFSType

Type file system type

func (*VFS) UnmarshalText added in v0.3.3

func (vfs *VFS) UnmarshalText(data []byte) error

UnmarshalText implement interface encoding.TextUnmarshaler

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
	// MinIO the MinIO data source
	MinIO
	// 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