storage

package
v1.2.0 Latest Latest
Warning

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

Go to latest
Published: Aug 27, 2021 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 AttachmentCopier added in v1.0.4

type AttachmentCopier interface {
	// Copy should, as expected, copy the attachment file to the provided io.Writer.
	Copy(attachmentPath string, writer io.Writer) error
}

AttachmentCopier interface should be implemented by any service responsible to get attachment files from a storage manager (FS, S3 TemplateBucket, Redis... etc).

type S3

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

S3 handles getting template content from AWS S3 buckets. It implements both AttachmentCopier and TemplateFetcher interfaces.

func NewS3

func NewS3(bucket string, region string) (*S3, error)

NewS3 instanciates an S3 with the AWS Session and AWS S3 Client

func (*S3) Copy

func (s3Connector *S3) Copy(attachmentPath string, writer io.Writer) error

Copy fetches attachment content by it's name from the S3 bucket and copies it to attach it to an email.

func (*S3) Fetch

func (s3Connector *S3) Fetch(templateName string) (string, error)

Fetch the template content by it's name from the S3 TemplateBucket and returns content.

type TemplateFetcher

type TemplateFetcher interface {
	// Fetch should return the content of the template as string
	Fetch(templateName string) (string, error)
}

TemplateFetcher interface should be implemented by any service responsible to get template content from a storage manager (FS, S3 TemplateBucket, Redis... etc).

Jump to

Keyboard shortcuts

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