Documentation ¶
Index ¶
- func GenerateFakeID(size int) string
- func GenerateID(size int) string
- func NewRedis(prefix string, conf *viper.Viper, logger zap.Logger) (*redis.Client, error)
- func NewS3(conf *viper.Viper, logger zap.Logger) (interfaces.S3, error)
- type AmazonS3
- func (am *AmazonS3) CompleteMultipartUpload(multipartUpload *s3.CreateMultipartUploadOutput, parts []*s3.CompletedPart) error
- func (am *AmazonS3) DownloadChunk(start, size int64, path string) (int, *bytes.Buffer, error)
- func (am *AmazonS3) GetObject(path string) ([]byte, error)
- func (am *AmazonS3) InitMultipartUpload(path string) (*s3.CreateMultipartUploadOutput, error)
- func (am *AmazonS3) PutObject(path string, body *[]byte) (*s3.PutObjectOutput, error)
- func (am *AmazonS3) PutObjectRequest(path string) (string, error)
- func (am *AmazonS3) UploadPart(input *bytes.Buffer, multipartUpload *s3.CreateMultipartUploadOutput, ...) (*s3.UploadPartOutput, error)
- type KafkaProducer
- type PGClient
- type RedisConnectionError
- type SendgridClient
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func GenerateFakeID ¶
GenerateFakeID generates an id with a FAKE- prefix
Types ¶
type AmazonS3 ¶
type AmazonS3 struct {
// contains filtered or unexported fields
}
AmazonS3 contain information related to S3
func (*AmazonS3) CompleteMultipartUpload ¶
func (am *AmazonS3) CompleteMultipartUpload(multipartUpload *s3.CreateMultipartUploadOutput, parts []*s3.CompletedPart) error
CompleteMultipartUpload end a multipart upload
func (*AmazonS3) DownloadChunk ¶
DownloadChunk downloads the chunk from s3
func (*AmazonS3) InitMultipartUpload ¶
func (am *AmazonS3) InitMultipartUpload(path string) (*s3.CreateMultipartUploadOutput, error)
InitMultipartUpload build obeject to send multipart
func (*AmazonS3) PutObjectRequest ¶
PutObjectRequest return a presigned url for uploading a file to s3
func (*AmazonS3) UploadPart ¶
func (am *AmazonS3) UploadPart(input *bytes.Buffer, multipartUpload *s3.CreateMultipartUploadOutput, partNumber int64) (*s3.UploadPartOutput, error)
UploadPart get a piece of multipart and upload a buffer to this part. The buffer must have at least 5mb and the maximum of 100mb. The last part can be smaller than 5mb
type KafkaProducer ¶ added in v1.0.0
type KafkaProducer struct { Config *viper.Viper ConfigPath string Logger zap.Logger BootstrapBrokers string FlushMaxMessages int FlushFrequency int // ms Producer sarama.AsyncProducer Statsd *statsd.Client MaxMessageBytes int Retries int }
KafkaProducer is the struct that connects to Kafka
func NewKafkaProducer ¶ added in v1.0.0
func NewKafkaProducer(config *viper.Viper, logger zap.Logger, statsd *statsd.Client) (*KafkaProducer, error)
NewKafkaProducer creates a new kafka producer
func (*KafkaProducer) Close ¶ added in v1.0.0
func (c *KafkaProducer) Close()
Close the connections to kafka
func (*KafkaProducer) SendAPNSPush ¶ added in v1.0.0
func (c *KafkaProducer) SendAPNSPush(topic, deviceToken string, payload, messageMetadata map[string]interface{}, pushMetadata map[string]interface{}, pushExpiry int64, templateName string) error
SendAPNSPush notification to Kafka
func (*KafkaProducer) SendGCMPush ¶ added in v1.0.0
func (c *KafkaProducer) SendGCMPush(topic, deviceToken string, payload, messageMetadata map[string]interface{}, pushMetadata map[string]interface{}, pushExpiry int64, templateName string) error
SendGCMPush notification to Kafka
type PGClient ¶
PGClient is the struct that connects to PostgreSQL
func NewPGClient ¶
func NewPGClient(prefix string, config *viper.Viper, logger zap.Logger, PGOrNil ...interfaces.DB) (*PGClient, error)
NewPGClient creates a new client
func (*PGClient) Connect ¶
func (c *PGClient) Connect(prefix string, PGOrNil ...interfaces.DB) error
Connect to PG
func (*PGClient) IsConnected ¶
IsConnected determines if the client is connected to PG
func (*PGClient) WaitForConnection ¶
WaitForConnection loops until postgres is connected
type RedisConnectionError ¶
type RedisConnectionError struct {
SourceError error
}
RedisConnectionError with SourceError that originated the connection failure
func (*RedisConnectionError) Error ¶
func (e *RedisConnectionError) Error() string
type SendgridClient ¶
SendgridClient is the struct that keeps sendgrid info
func NewSendgridClient ¶
NewSendgridClient creates a new client
func (*SendgridClient) LoadDefaults ¶
func (c *SendgridClient) LoadDefaults()
LoadDefaults sets default values for keys needed by this module
func (*SendgridClient) SendgridSendEmail ¶
func (c *SendgridClient) SendgridSendEmail(addressee, subject, message string, skipBlacklist bool) error
SendgridSendEmail sends an email with the given message and addressee