Documentation
¶
Index ¶
- func NewAMQPConfig(vhost string, channelMax int, heartbeat time.Duration) amqp.Config
- func NewAWSConfig() *aws.Config
- func NewAWSSession(config *aws.Config) *session.Session
- func NewS3Client(session *session.Session) *s3.S3
- func NewSFTPClient(sshClient *ssh.Client) (*sftp.Client, error)
- func NewSSHClient(host string, port uint32, sshConfig *ssh.ClientConfig) (*ssh.Client, error)
- func NewSSHConfig(user string, password string) *ssh.ClientConfig
- type AMQPChannel
- type AMQPConnection
- type AMQPConnectionConfig
- type AWSManager
- type DownloadOptions
- type RedisConfig
- type RedisManager
- type S3Manager
- type S3Wrapper
- func (s3w *S3Wrapper) Delete(path string, filename ...string) (*s3.DeleteObjectsOutput, error)
- func (s3w *S3Wrapper) Download(path string, filename string, data io.WriterAt, options *DownloadOptions) (int64, error)
- func (s3w *S3Wrapper) Read(path string, limit int64, readFrom string) (*s3.ListObjectsV2Output, error)
- func (s3w *S3Wrapper) Upload(path string, filename string, data io.Reader, options *UploadOptions) (string, error)
- type SFTPManager
- type SFTPWrapper
- type StorageAccessLayer
- type UploadOptions
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func NewAMQPConfig ¶ added in v0.6.0
NewAMQPConfig is a simple AMQP Config constructor
func NewAWSSession ¶
NewAWSSession is AWS Session constructor
func NewS3Client ¶
NewS3Client is AWS S3 constructor
func NewSFTPClient ¶
NewSFTPClient is SFTP client constructor
func NewSSHClient ¶
NewSSHClient is SSH client constructor
func NewSSHConfig ¶
func NewSSHConfig(user string, password string) *ssh.ClientConfig
NewSSHConfig is SSH ClientConfig constructor
Types ¶
type AMQPChannel ¶ added in v0.9.0
AMQPChannel is AMQP chan wrapper struct
func NewAMQPChannel ¶ added in v0.9.0
func NewAMQPChannel(channel *amqp.Channel) *AMQPChannel
NewAMQPChannel is wrapper for AMPQ channels constructor
func (*AMQPChannel) Close ¶ added in v0.9.0
func (ac *AMQPChannel) Close() error
Close closes running channel and change internal state
func (*AMQPChannel) IsClosed ¶ added in v0.9.0
func (ac *AMQPChannel) IsClosed() bool
IsClosed change internal channel state
type AMQPConnection ¶ added in v0.9.0
type AMQPConnection struct { *amqp.Connection // contains filtered or unexported fields }
AMQPConnection is a struct to handle AMQP connection
func NewAMQPConnection ¶ added in v0.9.0
func NewAMQPConnection(config *AMQPConnectionConfig) (*AMQPConnection, error)
NewAMQPConnection is AMQPConnection constructor
func (*AMQPConnection) Channel ¶ added in v0.9.0
func (ac *AMQPConnection) Channel() (*AMQPChannel, error)
type AMQPConnectionConfig ¶ added in v0.9.0
type AMQPConnectionConfig struct {
// contains filtered or unexported fields
}
AMQPConnection is a struct to manage AMQP connections
func NewAMQPConnectionConfig ¶ added in v0.9.0
func NewAMQPConnectionConfig(host string, port int, user, password string, config *amqp.Config) *AMQPConnectionConfig
NewAMQPConnectionConfig is AMQP client constructor
type AWSManager ¶
type AWSManager struct { S3Manager *S3Manager // contains filtered or unexported fields }
AWSManager is a struct to manage AWS SDK
func NewAWSManager ¶
func NewAWSManager(session *session.Session) *AWSManager
NewAWSManager is AWSManager constructor
type DownloadOptions ¶ added in v0.7.0
type DownloadOptions struct { IfMatch string IfModifiedSince *time.Time IfNoneMatch string IfUnmodifiedSince *time.Time ResponseCacheControl string ResponseContentDisposition string ResponseContentEncoding string ResponseContentLanguage string ResponseContentType string ResponseExpires *time.Time VersionId string }
type RedisConfig ¶
RedisConfig is a struct definition for Redis Client
func (*RedisConfig) ToOption ¶
func (rc *RedisConfig) ToOption() *redis.Options
ToOption is used by RedisConfig to generate Option struct from client
type RedisManager ¶
type RedisManager struct { Clients map[string]*redis.Client sync.RWMutex // contains filtered or unexported fields }
RedisManager is a struct to manage Redis clients
func NewRedisManager ¶
func NewRedisManager(config RedisConfig, logger *logrus.Logger) *RedisManager
NewRedisManager is RedisManager struct constructor
func (*RedisManager) AddClient ¶
func (rw *RedisManager) AddClient(category string) (*redis.Client, error)
AddClient pushes a new client in manager
func (*RedisManager) GetCategories ¶
func (rw *RedisManager) GetCategories() (clientsCat []string)
GetCategories fetches categories of client available
type S3Manager ¶
type S3Manager struct { S3 map[string]StorageAccessLayer sync.Mutex // contains filtered or unexported fields }
S3Manager is a struct to control S3 client
func NewS3Manager ¶
NewS3Manager is a S3Manager constructor
type S3Wrapper ¶
S3Wrapper is a S3 Adapter
func NewS3Wrapper ¶
NewS3Wrapper is S3Wrapper struct constructor
func (*S3Wrapper) Download ¶
func (s3w *S3Wrapper) Download(path string, filename string, data io.WriterAt, options *DownloadOptions) (int64, error)
Download fetches a file from S3
type SFTPManager ¶
SFTPManager is a struct to manage SFTP connections
func NewSFTPManager ¶
func NewSFTPManager(host string, port uint32, sshConfig *ssh.ClientConfig, maxCap uint) *SFTPManager
NewSFTPManager is SFTPManager constructor
func (*SFTPManager) AddClient ¶
func (sm *SFTPManager) AddClient() error
AddClient adds a new SFTP client in pool
func (*SFTPManager) GetClient ¶ added in v0.3.0
func (sm *SFTPManager) GetClient() (*SFTPWrapper, error)
GetClient get a new SFTP client in pool
func (*SFTPManager) PutClient ¶ added in v0.3.1
func (sm *SFTPManager) PutClient(client *SFTPWrapper)
PutClient add an existing SFTP client in pool
func (*SFTPManager) SetPoolFactory ¶ added in v0.5.0
func (sm *SFTPManager) SetPoolFactory(factory syncPkg.Factory)
SetPoolFactory adds func factory to pool
type SFTPWrapper ¶
type SFTPWrapper struct { sync.Mutex Client *sftp.Client Reconnects uint64 // contains filtered or unexported fields }
SFTPWrapper is SFTP client wrapper struct
func NewSFTPWrapper ¶
func NewSFTPWrapper(sshClient *ssh.Client, sftpClient *sftp.Client) *SFTPWrapper
NewSFTPWrapper is SFTPWrapper constructor
func (*SFTPWrapper) Close ¶
func (s *SFTPWrapper) Close() error
Close closes connection from SFTP => chan notify ssh connection to close
type StorageAccessLayer ¶
type StorageAccessLayer interface { Upload(path string, filename string, data io.Reader, options *UploadOptions) (string, error) Download(path string, filename string, data io.WriterAt, options *DownloadOptions) (int64, error) Read(path string, limit int64, readFrom string) (*s3.ListObjectsV2Output, error) Delete(path string, files ...string) (*s3.DeleteObjectsOutput, error) }
StorageAccessLayer is a common interface for AWS storage Specific to S3 for now...
type UploadOptions ¶ added in v0.7.0
type UploadOptions struct { ACL string CacheControl string ContentDisposition string ContentEncoding string ContentLanguage string ContentMD5 string ContentType string Expires *time.Time GrantFullControl string GrantRead string GrantReadACP string GrantWriteACP string Metadata map[string]string ObjectLockMode string ObjectLockRetainUntilDate *time.Time ServerSideEncryption string StorageClass string Tagging string }