backend

package
v0.0.0-...-e8b74a0 Latest Latest
Warning

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

Go to latest
Published: Sep 15, 2019 License: MIT Imports: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Provider

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

Provider provides the ability to make requests to a backend through a pool of connections. This package does not provide goroutines on top of connections; if you make multiple calls to ReadFile in a single goroutine, it's basically the same thing as calling ReadFile on a connection in serial. What this package does provide is a guarantee that if you call ReadFile from multiple goroutines, no two concurrent calls will share the same connection.

func NewProvider

func NewProvider(remoteAddr string, clientConfig *ssh.ClientConfig, logger *log.Logger) *Provider

NewProvider creates a new instance of a Provider

func (*Provider) ReadDir

func (p *Provider) ReadDir(path string) ([]os.FileInfo, error)

ReadDir acquires a connection from the connection pool and calls ReadDir on the acquired SFTP connection.

func (*Provider) ReadFile

func (p *Provider) ReadFile(path string) ([]byte, error)

ReadFile acquires a connection from the connection pool and calls ReadFile on the acquired SFTP connection.

func (*Provider) Stat

func (p *Provider) Stat(path string) (os.FileInfo, error)

Stat acquires a connection from the connection pool and calls Stat on the acquired SFTP connection.

Jump to

Keyboard shortcuts

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