Documentation ¶
Index ¶
- type NewSSHStorageParams
- type SSHStorage
- func (s *SSHStorage) Close() error
- func (s *SSHStorage) DefaultConsistencyStrategy() utils.AttemptStrategy
- func (s *SSHStorage) Get(name string) (io.ReadCloser, error)
- func (s *SSHStorage) List(prefix string) ([]string, error)
- func (s *SSHStorage) Put(name string, r io.Reader, length int64) error
- func (s *SSHStorage) Remove(name string) error
- func (s *SSHStorage) RemoveAll() error
- func (s *SSHStorage) ShouldRetry(err error) bool
- func (s *SSHStorage) URL(name string) (string, error)
- type SSHStorageError
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) 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.
type SSHStorageError ¶
func (SSHStorageError) Error ¶
func (e SSHStorageError) Error() string