sshstorage

package
v0.0.0-...-f19ae85 Latest Latest
Warning

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

Go to latest
Published: Mar 12, 2015 License: AGPL-3.0 Imports: 14 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type NewSSHStorageParams

type NewSSHStorageParams struct {
	// Host is the host to connect to, in the format [user@]hostname.
	Host string

	// StorageDir is the root of the remote storage directory.
	StorageDir string

	// TmpDir is the remote temporary directory for storage.
	// A temporary directory must be specified, and should be located on the
	// same filesystem as the storage directory to ensure atomic writes.
	// The temporary directory will be created when NewSSHStorage is invoked
	// if it doesn't already exist; it will never be removed. NewSSHStorage
	// will attempt to reassign ownership to the login user, and will return
	// an error if it cannot do so.
	TmpDir string
}

type SSHStorage

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

SSHStorage implements storage.Storage.

The storage is created under sudo, and ownership given over to the login uid/gid. This is done so that we don't require sudo, and by consequence, don't require a pty, so we can interact with a script via stdin.

func NewSSHStorage

func NewSSHStorage(params NewSSHStorageParams) (*SSHStorage, error)

NewSSHStorage creates a new SSHStorage, connected to the specified host, managing state under the specified remote path.

func (*SSHStorage) Close

func (s *SSHStorage) Close() error

Close cleanly terminates the underlying SSH connection.

func (*SSHStorage) DefaultConsistencyStrategy

func (s *SSHStorage) DefaultConsistencyStrategy() utils.AttemptStrategy

DefaultConsistencyStrategy implements storage.StorageReader.ConsistencyStrategy.

func (*SSHStorage) Get

func (s *SSHStorage) Get(name string) (io.ReadCloser, error)

Get implements storage.StorageReader.Get.

func (*SSHStorage) List

func (s *SSHStorage) List(prefix string) ([]string, error)

List implements storage.StorageReader.List.

func (*SSHStorage) Put

func (s *SSHStorage) Put(name string, r io.Reader, length int64) error

Put implements storage.StorageWriter.Put

func (*SSHStorage) Remove

func (s *SSHStorage) Remove(name string) error

Remove implements storage.StorageWriter.Remove

func (*SSHStorage) RemoveAll

func (s *SSHStorage) RemoveAll() error

RemoveAll implements storage.StorageWriter.RemoveAll

func (*SSHStorage) ShouldRetry

func (s *SSHStorage) ShouldRetry(err error) bool

ShouldRetry is specified in the StorageReader interface.

func (*SSHStorage) URL

func (s *SSHStorage) URL(name string) (string, error)

URL implements storage.StorageReader.URL.

type SSHStorageError

type SSHStorageError struct {
	Output   string
	ExitCode int
}

func (SSHStorageError) Error

func (e SSHStorageError) Error() string

Jump to

Keyboard shortcuts

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