Documentation ¶
Overview ¶
Package sftp implements repository storage in a directory on a remote server via the sftp protocol.
Index ¶
- type SFTP
- func (s *SFTP) Close() error
- func (r *SFTP) Create() (backend.Blob, error)
- func (r *SFTP) Get(t backend.Type, name string) (io.ReadCloser, error)
- func (r *SFTP) GetReader(t backend.Type, name string, offset, length uint) (io.ReadCloser, error)
- func (r *SFTP) List(t backend.Type, done <-chan struct{}) <-chan string
- func (r *SFTP) Location() string
- func (r *SFTP) Remove(t backend.Type, name string) error
- func (r *SFTP) Test(t backend.Type, name string) (bool, error)
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type SFTP ¶
type SFTP struct {
// contains filtered or unexported fields
}
func Create ¶
Create creates all the necessary files and directories for a new sftp backend at dir. Afterwards a new config blob should be created.
func Open ¶
Open opens an sftp backend. When the command is started via exec.Command, it is expected to speak sftp on stdin/stdout. The backend is expected at the given path.
func (*SFTP) Create ¶
Create creates a new Blob. The data is available only after Finalize() has been called on the returned Blob.
func (*SFTP) Get ¶
Get returns a reader that yields the content stored under the given name. The reader should be closed after draining it.
func (*SFTP) GetReader ¶
GetReader returns an io.ReadCloser for the Blob with the given name of type t at offset and length. If length is 0, the reader reads until EOF.
func (*SFTP) List ¶
List returns a channel that yields all names of blobs of type t. A goroutine is started for this. If the channel done is closed, sending stops.