core

package
v0.8.2 Latest Latest
Warning

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

Go to latest
Published: Feb 28, 2024 License: Apache-2.0 Imports: 9 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) SizeVar added in v0.8.2

func (f *FlagSet) SizeVar(p *Size, name string, value string, usage string)

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

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 Path added in v0.8.1

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

func (Path) Base added in v0.8.1

func (p Path) Base() string

Base returns base path

func (Path) Bucket added in v0.8.1

func (p Path) Bucket() string

Bucket returns bucket name

func (Path) String added in v0.8.1

func (p Path) String() string

String return the origin path

type SSHConfig added in v0.8.0

type SSHConfig struct {
	// Username the username for SSH
	Username string
	// Password the password for SSH
	Password string
	// Key the key file for SSH
	Key string
	// KeyPass the passphrase for the key file
	KeyPass string
	// HostKey the host key file used to validate the server's host key
	HostKey string
}

SSHConfig the config info for SSH authentication

type Size added in v0.8.2

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

Size represent the size of data

func NewSize added in v0.8.2

func NewSize(size uint64) Size

NewSize create an instance of Size from bytes size

func (Size) Bytes added in v0.8.2

func (s Size) Bytes() int64

Bytes return the bytes of the size

func (Size) MarshalText added in v0.8.2

func (s Size) MarshalText() (text []byte, err error)

MarshalText implement interface encoding.TextMarshaler

func (*Size) Set added in v0.8.2

func (s *Size) Set(str string) error

Set implement the Set function for the flag.Value interface

func (*Size) String added in v0.8.2

func (s *Size) String() string

String implement the String function for the flag.Value interface

func (*Size) UnmarshalText added in v0.8.2

func (s *Size) UnmarshalText(data []byte) error

UnmarshalText implement interface encoding.TextUnmarshaler

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() Path

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() Path

RemotePath the remote file path

func (*VFS) SSHConfig added in v0.8.0

func (vfs *VFS) SSHConfig() SSHConfig

SSHConfig returns the SSH config

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
)

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