connector

package
v0.1.7 Latest Latest
Warning

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

Go to latest
Published: Feb 19, 2016 License: Apache-2.0 Imports: 21 Imported by: 4

Documentation

Index

Constants

View Source
const (
	TIMEOUT            time.Duration = time.Duration(10 * time.Second)
	KEEPALIVE_INTERVAL time.Duration = time.Duration(3 * time.Second)
)

Variables

This section is empty.

Functions

func DialSSHTimeout added in v0.1.3

func DialSSHTimeout(network, addr string, config *ssh.ClientConfig, timeout time.Duration) (*ssh.Client, error)

func KeyAuth added in v0.1.3

func KeyAuth(file string) (ssh.AuthMethod, error)

Types

type Connection

type Connection interface {
	String() string
	GetCacheDirectory() string
	ListObjectsAsFolders(prefix string) ([]Object, error)
	ListObjectsAsAll(prefix string) ([]Object, error)
	Get(key string) (string, error)
	CachedGet(key string) (string, error)
	Close() error
}

type GoogleCloudStorageConnection

type GoogleCloudStorageConnection struct {
	Context        context.Context
	BucketName     string
	CacheDirectory string
}

func NewGoogleCloudStorageConnection

func NewGoogleCloudStorageConnection(jsonPrivateKeyFilepath string, projectID string, bucketName string,
	cacheDirectory string) (GoogleCloudStorageConnection, error)

func (GoogleCloudStorageConnection) CachedGet

func (conn GoogleCloudStorageConnection) CachedGet(name string) (string, error)

func (GoogleCloudStorageConnection) Close added in v0.1.3

func (GoogleCloudStorageConnection) Get

func (conn GoogleCloudStorageConnection) Get(name string) (string, error)

func (GoogleCloudStorageConnection) GetCacheDirectory

func (c GoogleCloudStorageConnection) GetCacheDirectory() string

func (GoogleCloudStorageConnection) ListObjectsAsAll

func (conn GoogleCloudStorageConnection) ListObjectsAsAll(prefix string) ([]Object, error)

func (GoogleCloudStorageConnection) ListObjectsAsFolders

func (conn GoogleCloudStorageConnection) ListObjectsAsFolders(prefix string) ([]Object, error)

func (GoogleCloudStorageConnection) String

type GoogleCloudStorageObject

type GoogleCloudStorageObject struct {
	Name string
}

func (GoogleCloudStorageObject) GetPath

func (o GoogleCloudStorageObject) GetPath() string

func (GoogleCloudStorageObject) String

func (o GoogleCloudStorageObject) String() string

type Object

type Object interface {
	GetPath() string
}

type S3Connection

type S3Connection struct {
	Connection     *s3.S3
	BucketName     string
	CacheDirectory string
	Downloader     *s3manager.Downloader
}

func NewS3Connection

func NewS3Connection(connection *s3.S3, cacheDirectory string, s3BucketName string,
	options *s3manager.DownloadOptions) S3Connection

func (S3Connection) CachedGet

func (conn S3Connection) CachedGet(key string) (string, error)

func (S3Connection) Close added in v0.1.3

func (c S3Connection) Close() error

func (S3Connection) Get

func (conn S3Connection) Get(key string) (string, error)

func (S3Connection) GetCacheDirectory

func (c S3Connection) GetCacheDirectory() string

func (S3Connection) ListObjectsAsAll

func (conn S3Connection) ListObjectsAsAll(prefix string) ([]Object, error)

func (S3Connection) ListObjectsAsFolders

func (conn S3Connection) ListObjectsAsFolders(prefix string) ([]Object, error)

func (S3Connection) String

func (c S3Connection) String() string

type S3Object

type S3Object struct {
	S3FullPath string
}

func (S3Object) GetPath

func (s3Obj S3Object) GetPath() string

func (S3Object) String

func (s3Obj S3Object) String() string

type SFTPConnection added in v0.1.3

type SFTPConnection struct {
	SSHClient      *ssh.Client
	SFTPClient     *sftp.Client
	RemotePath     string
	CacheDirectory string
}

func NewSFTPConnection added in v0.1.3

func NewSFTPConnection(host string, port int, remotePath string, username string, password *string,
	privateKeyFilepath *string, cacheDirectory string) (*SFTPConnection, error)

func (SFTPConnection) CachedGet added in v0.1.3

func (conn SFTPConnection) CachedGet(key string) (string, error)

func (SFTPConnection) Close added in v0.1.3

func (c SFTPConnection) Close() error

func (SFTPConnection) Get added in v0.1.3

func (conn SFTPConnection) Get(key string) (string, error)

func (SFTPConnection) GetCacheDirectory added in v0.1.3

func (c SFTPConnection) GetCacheDirectory() string

func (SFTPConnection) ListObjectsAsAll added in v0.1.3

func (conn SFTPConnection) ListObjectsAsAll(prefix string) ([]Object, error)

func (SFTPConnection) ListObjectsAsFolders added in v0.1.3

func (conn SFTPConnection) ListObjectsAsFolders(prefix string) ([]Object, error)

func (SFTPConnection) String added in v0.1.3

func (c SFTPConnection) String() string

type SFTPObject added in v0.1.3

type SFTPObject struct {
	Fullpath string
}

func (SFTPObject) GetPath added in v0.1.3

func (o SFTPObject) GetPath() string

func (SFTPObject) String added in v0.1.3

func (o SFTPObject) String() string

type SSHConn added in v0.1.3

type SSHConn struct {
	net.Conn
	ReadTimeout  time.Duration
	WriteTimeout time.Duration
}

func (*SSHConn) Read added in v0.1.3

func (c *SSHConn) Read(b []byte) (int, error)

func (*SSHConn) Write added in v0.1.3

func (c *SSHConn) Write(b []byte) (int, error)

Jump to

Keyboard shortcuts

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