lib

package
v0.3.1 Latest Latest
Warning

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

Go to latest
Published: Jul 31, 2019 License: Apache-2.0 Imports: 23 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func GoConnect added in v0.3.1

func GoConnect(ctx context.Context, sshParams params.SSHParams, terminal bool, privkey, cert *memguard.LockedBuffer, env map[string]string, l *zap.SugaredLogger) error

func GoConnectAuth added in v0.3.1

func GoConnectAuth(ctx context.Context, sshParams params.SSHParams, terminal bool, auth []ssh.AuthMethod, env map[string]string, l *zap.SugaredLogger) error

func NativeConnect added in v0.3.1

func NativeConnect(ctx context.Context, sshParams params.SSHParams, terminal, verbose bool, priv *memguard.LockedBuffer, pub *crypto.PublicKey, cert *memguard.LockedBuffer, env map[string]string, l *zap.SugaredLogger) error

func SFTPClient added in v0.3.1

func SFTPClient(gparams params.SSHParams, methods []ssh.AuthMethod, l *zap.SugaredLogger) (*sftp.Client, error)

func SFTPGet added in v0.3.1

func SFTPGet(ctx context.Context, srcs []string, gparams params.SSHParams, privkey, cert *memguard.LockedBuffer, cb Callback, l *zap.SugaredLogger) error

func SFTPGetAuth added in v0.3.1

func SFTPGetAuth(ctx context.Context, srcs []string, gparams params.SSHParams, auth []ssh.AuthMethod, cb Callback, l *zap.SugaredLogger) error

func SFTPList added in v0.3.1

func SFTPList(ctx context.Context, gparams params.SSHParams, privkey, cert *memguard.LockedBuffer, l *zap.SugaredLogger, cb remoteops.ListCallback) error

func SFTPListAuth added in v0.3.1

func SFTPListAuth(ctx context.Context, gparams params.SSHParams, auth []ssh.AuthMethod, l *zap.SugaredLogger, cb remoteops.ListCallback) error

func SFTPPut added in v0.3.1

func SFTPPut(ctx context.Context, sources []Source, remotePath string, gparams params.SSHParams, privkey, cert *memguard.LockedBuffer, l *zap.SugaredLogger) error

func SFTPPutAuth added in v0.3.1

func SFTPPutAuth(ctx context.Context, sources []Source, remotePath string, gparams params.SSHParams, auth []ssh.AuthMethod, l *zap.SugaredLogger) error

func ScpGet added in v0.3.1

func ScpGet(ctx context.Context, srcs []string, gparams params.SSHParams, privkey, cert *memguard.LockedBuffer, cb Callback, l *zap.SugaredLogger) error

func ScpGetAuth added in v0.3.1

func ScpGetAuth(ctx context.Context, srcs []string, gparams params.SSHParams, auth []ssh.AuthMethod, cb Callback, l *zap.SugaredLogger) error

func ScpPut added in v0.3.1

func ScpPut(ctx context.Context, sources []Source, remotePath string, gparams params.SSHParams, privkey, cert *memguard.LockedBuffer, l *zap.SugaredLogger) error

func ScpPutAuth added in v0.3.1

func ScpPutAuth(ctx context.Context, sources []Source, remotePath string, gparams params.SSHParams, auth []ssh.AuthMethod, l *zap.SugaredLogger) error

Types

type Callback added in v0.3.0

type Callback func(isDir, endOfDir bool, name string, perms os.FileMode, mtime, atime time.Time, content io.Reader) error

Callback is a function type that is used by ScpGet to return the remote SSH directories and files.

type Source added in v0.3.0

type Source interface {
	IsSource()
	Close() error
}

func MakeSource added in v0.3.0

func MakeSource(filename string) (Source, error)

TODO: support globs

type UploadDirSource added in v0.3.0

type UploadDirSource struct {
	Path string
}

func (*UploadDirSource) Close added in v0.3.0

func (s *UploadDirSource) Close() error

func (*UploadDirSource) IsSource added in v0.3.0

func (s *UploadDirSource) IsSource()

type UploadFileSource added in v0.3.0

type UploadFileSource struct {
	Name        string
	Reader      io.Reader
	Size        int64
	Permissions os.FileMode
	CloseFunc   func() error
}

func (*UploadFileSource) Close added in v0.3.0

func (s *UploadFileSource) Close() error

func (*UploadFileSource) IsSource added in v0.3.0

func (s *UploadFileSource) IsSource()

Jump to

Keyboard shortcuts

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