rfs

package module
v0.2.1 Latest Latest
Warning

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

Go to latest
Published: Jun 29, 2021 License: MIT Imports: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	ErrConnect       = errors.New("connect error")
	ErrEmptyCmd      = errors.New("empty cmd")
	ErrInvalidWrite  = errors.New("invalid write result")
	ErrTimeout       = errors.New("request timeout")
	ErrMissingCmd    = errors.New("missing stdout or stdout")
	ErrRequest       = errors.New("request exception")
	ErrNotExists     = errors.New("file does not exist")
	ErrAlreadyExists = errors.New("file already exists")
)

Functions

This section is empty.

Types

type Cmd

type Cmd struct {
	Name string
	Args []string
	Env  []string

	Stdin  io.Reader
	Stdout io.Writer
	Stderr io.Writer
}

func NewCmd added in v0.2.0

func NewCmd(name string, args []string, writer io.Writer) *Cmd

type ExecOption

type ExecOption func(*ExecOptions)

type ExecOptions

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

type GetOption

type GetOption func(*GetOptions)

type GetOptions

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

type IOFn

type IOFn func(*IOMetric)

type IOMetric

type IOMetric struct {
	Name  string
	From  string
	To    string
	Total int64
	Block int64
	Speed int64
}

type ListOption

type ListOption func(*ListOptions)

type ListOptions

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

type PutOption

type PutOption func(*PutOptions)

type PutOptions

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

type Rfs

type Rfs interface {
	Init() error
	Exec(ctx context.Context, cmd *Cmd, opts ...ExecOption) error
	List(ctx context.Context, remotePath string, opts ...ListOption) ([]os.FileInfo, error)
	Get(ctx context.Context, remotePath, localPath string, fn IOFn, opts ...GetOption) error
	Put(ctx context.Context, localPath, remotePath string, fn IOFn, opts ...PutOption) error
}

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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