Documentation
¶
Overview ¶
Package client contains struct for client third parties
Package client contains struct for client third parties ¶
Package client contains struct for client third parties ¶
Package client contains struct for client third parties ¶
Package client contains struct for client third parties
Index ¶
- func NewAMQPConfig(vhost string, channelMax uint16, 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
type AMQPChannel interface {
Close() error
IsClosed() bool
NotifyClose(c chan *amqp.Error) chan *amqp.Error
NotifyFlow(c chan bool) chan bool
NotifyReturn(c chan amqp.Return) chan amqp.Return
NotifyCancel(c chan string) chan string
NotifyConfirm(ack, nack chan uint64) (chan uint64, chan uint64)
NotifyPublish(confirm chan amqp.Confirmation) chan amqp.Confirmation
Qos(prefetchCount, prefetchSize int, global bool) error
Cancel(consumer string, noWait bool) error
QueueDeclare(name string, durable, autoDelete, exclusive, noWait bool, args amqp.Table) (amqp.Queue, error)
QueueDeclarePassive(name string, durable, autoDelete, exclusive, noWait bool, args amqp.Table) (amqp.Queue, error)
QueueInspect(name string) (amqp.Queue, error)
QueueBind(name, key, exchange string, noWait bool, args amqp.Table) error
QueueUnbind(name, key, exchange string, args amqp.Table) error
QueuePurge(name string, noWait bool) (int, error)
QueueDelete(name string, ifUnused, ifEmpty, noWait bool) (int, error)
Consume(queue, consumer string, autoAck, exclusive, noLocal, noWait bool, args amqp.Table) (<-chan amqp.Delivery, error)
ExchangeDeclare(name, kind string, durable, autoDelete, internal, noWait bool, args amqp.Table) error
ExchangeDeclarePassive(name, kind string, durable, autoDelete, internal, noWait bool, args amqp.Table) error
ExchangeDelete(name string, ifUnused, noWait bool) error
ExchangeBind(destination, key, source string, noWait bool, args amqp.Table) error
ExchangeUnbind(destination, key, source string, noWait bool, args amqp.Table) error
Publish(exchange, key string, mandatory, immediate bool, msg amqp.Publishing) error
PublishWithDeferredConfirm(exchange, key string, mandatory, immediate bool, msg amqp.Publishing) (*amqp.DeferredConfirmation, error)
Get(queue string, autoAck bool) (msg amqp.Delivery, ok bool, err error)
Tx() error
TxCommit() error
TxRollback() error
Flow(active bool) error
Confirm(noWait bool) error
Recover(requeue bool) error
Ack(tag uint64, multiple bool) error
Nack(tag uint64, multiple bool, requeue bool) error
Reject(tag uint64, requeue bool) error
GetNextPublishSeqNo() uint64
}
AMQPChannel is an interface for amqp channel wrapper
type AMQPConnection ¶ added in v0.9.0
type AMQPConnection interface {
LocalAddr() net.Addr
ConnectionState() tls.ConnectionState
NotifyClose(receiver chan *amqp.Error) chan *amqp.Error
NotifyBlocked(receiver chan amqp.Blocking) chan amqp.Blocking
Close() error
IsClosed() bool
Channel() (AMQPChannel, error)
}
AMQPConnection is a client wrapper interface
func NewAMQPConnection ¶ added in v0.9.0
func NewAMQPConnection(config *AMQPConnectionConfig) (AMQPConnection, error)
NewAMQPConnection is AMQPConnection constructor
type AMQPConnectionConfig ¶ added in v0.9.0
type AMQPConnectionConfig struct {
// contains filtered or unexported fields
}
AMQPConnectionConfig 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) *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 {
// contains filtered or unexported fields
}
S3Manager is a struct to control S3 client
func NewS3Manager ¶
NewS3Manager is a S3Manager constructor
func (*S3Manager) GetAll ¶ added in v1.13.0
func (sm *S3Manager) GetAll() map[string]StorageAccessLayer
GetAll is used to fetch all buckets from the manager
type S3Wrapper ¶
type S3Wrapper struct {
// contains filtered or unexported fields
}
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 ¶
type SFTPManager struct {
// contains filtered or unexported fields
}
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 {
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) Client ¶
func (s *SFTPWrapper) Client() *sftp.Client
Client ensures that client can be fetched and is not reconnecting
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
}