Documentation ¶
Index ¶
Constants ¶
View Source
const ( DefaultCacheSize = 1024 * 1024 DefaultDialTimeout = time.Second * 15 )
View Source
const ( SSHClient = "ssh" WinRMClient = "winrm" GRPCClient = "grpc" )
Variables ¶
View Source
var ( ErrConnect = errors.New("connect error") ErrInvalidWrite = errors.New("invalid write result") ErrTimeout = errors.New("request timeout") 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 ExecOption ¶
type ExecOption func(*ExecOptions)
func ExecWithArgs ¶
func ExecWithArgs(args ...string) ExecOption
func ExecWithEnv ¶
func ExecWithEnv(key, value string) ExecOption
func ExecWithRootDir ¶ added in v0.3.8
func ExecWithRootDir(root string) ExecOption
func ExecWithValue ¶
func ExecWithValue(key string, value any) ExecOption
ExecWithValue set key-value at options.Context
type ExecOptions ¶
type ExecOptions struct { Context context.Context Root string Args []string Environments map[string]string }
func NewExecOptions ¶
func NewExecOptions() *ExecOptions
type GetOption ¶
type GetOption func(*GetOptions)
func GetWithDir ¶
func GetWithTrace ¶
func GetWithValue ¶
type GetOptions ¶
func NewGetOptions ¶
func NewGetOptions() *GetOptions
type IClient ¶
type IClient interface { Name() string Stat(ctx context.Context, name string) (*Stat, error) // ReadFile reads file content from remote connection ReadFile(ctx context.Context, name string) ([]byte, error) // Get gets io.ReadCloser from remote connection Get(ctx context.Context, src, dst string, opts ...GetOption) error // Put uploads local file to remote host Put(ctx context.Context, src, dst string, opts ...PutOption) error // Execute executes a given command on remote host Execute(ctx context.Context, shell string, opts ...ExecOption) (ICmd, error) // Close closes all remote connections Close() error }
type PutOption ¶
type PutOption func(*PutOptions)
func PutWithDir ¶
func PutWithMkdir ¶
func PutWithTrace ¶
func PutWithValue ¶
type PutOptions ¶
type PutOptions struct { Context context.Context Dir bool Mkdir bool CacheSize int64 Trace IOTraceFn }
func NewPutOptions ¶
func NewPutOptions() *PutOptions
Click to show internal directories.
Click to hide internal directories.