repository

package
v0.0.16 Latest Latest
Warning

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

Go to latest
Published: Apr 1, 2022 License: Apache-2.0 Imports: 11 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type AWSS3Repository

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

AWSS3Repository struct.

func NewAWSS3Repository

func NewAWSS3Repository(
	e *logrus.Entry,
	s3 *s3.S3,

) *AWSS3Repository

NewAWSS3Repository returns AWSS3Repository instance.

func (*AWSS3Repository) CreateBucket

func (r *AWSS3Repository) CreateBucket(bucket string) (*s3.CreateBucketOutput, error)

CreateBucket creates a new S3 bucket. To create a bucket, you must register with Amazon S3 and have a valid AWS Access Key ID to authenticate requests. Anonymous requests are never allowed to create buckets. By creating the bucket, you become the bucket owner. https://docs.aws.amazon.com/AmazonS3/latest/API/API_CreateBucket.html

func (*AWSS3Repository) DeleteBucket

func (r *AWSS3Repository) DeleteBucket(bucket string) (*s3.DeleteBucketOutput, error)

DeleteBucket deletes the S3 bucket. All objects (including all object versions and delete markers) in the bucket must be deleted before the bucket itself can be deleted. https://docs.aws.amazon.com/AmazonS3/latest/API/API_DeleteBucket.html

func (*AWSS3Repository) DeleteObject

func (r *AWSS3Repository) DeleteObject(bucket, key string) (*s3.DeleteObjectOutput, error)

DeleteObject removes the null version (if there is one) of an object and inserts a delete marker, which becomes the latest version of the object. If there isn't a null version, Amazon S3 does not remove any objects but will still respond that the command was successful. https://docs.aws.amazon.com/AmazonS3/latest/API/API_DeleteObject.html

func (*AWSS3Repository) DeleteObjects

func (r *AWSS3Repository) DeleteObjects(bucket string, keys []string) (*s3.DeleteObjectsOutput, error)

DeleteObjects action enables you to delete multiple objects from a bucket using a single HTTP request. If you know the object keys that you want to delete, then this action provides a suitable alternative to sending individual delete requests, reducing per-request overhead. https://docs.aws.amazon.com/AmazonS3/latest/API/API_DeleteObjects.html

func (*AWSS3Repository) GetObject

func (r *AWSS3Repository) GetObject(bucket, key string) (*s3.GetObjectOutput, error)

GetObject retrieves objects from Amazon S3. https://docs.aws.amazon.com/AmazonS3/latest/API/API_GetObject.html

func (*AWSS3Repository) GetPresignedURL

func (r *AWSS3Repository) GetPresignedURL(bucket, key string, expire time.Duration) (string, error)

GetPresignedURL creates a Pre-Singed URL. https://docs.aws.amazon.com/sdk-for-go/v1/developer-guide/s3-example-presigned-urls.html

func (*AWSS3Repository) ListBuckets

func (r *AWSS3Repository) ListBuckets() (*s3.ListBucketsOutput, error)

ListBuckets returns a list of all buckets owned by the authenticated sender of the request. To use this operation, you must have the s3:ListAllMyBuckets permission. https://docs.aws.amazon.com/AmazonS3/latest/API/API_ListBuckets.html

func (*AWSS3Repository) ListObjectsV2

func (r *AWSS3Repository) ListObjectsV2(bucket, prefix string) (*s3.ListObjectsV2Output, error)

ListObjectsV2 returns some or all (up to 1,000) of the objects in a bucket with each request. You can use the request parameters as selection criteria to return a subset of the objects in a bucket. A 200 OK response can contain valid or invalid XML. Make sure to design your application to parse the contents of the response and handle it appropriately. Objects are returned sorted in an ascending order of the respective key names in the list. For more information about listing objects, see Listing object keys programmatically https://docs.aws.amazon.com/AmazonS3/latest/API/API_ListObjectsV2.html

func (*AWSS3Repository) PutObjectFile

func (r *AWSS3Repository) PutObjectFile(bucket, key, filePath string) (*s3.PutObjectOutput, error)

PutObjectFile adds an object to a bucket. https://docs.aws.amazon.com/AmazonS3/latest/API/API_PutObject.html

func (*AWSS3Repository) PutObjectText

func (r *AWSS3Repository) PutObjectText(bucket, key string, text *string) (*s3.PutObjectOutput, error)

PutObjectText adds an object to a bucket. https://docs.aws.amazon.com/AmazonS3/latest/API/API_PutObject.html

type AWSS3RepositoryInterface

type AWSS3RepositoryInterface interface {
	GetObject(bucket, path string) io.ReaderAt
}

AWSS3RepositoryInterface interface.

type AWSSESRepository

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

AWSSESRepository struct.

func NewAWSSESRepository

func NewAWSSESRepository(
	e *logrus.Entry,
	s *ses.SES,
	configurationSetName *string,
	isOutputLogPersonalInformation bool,

) *AWSSESRepository

NewAWSSESRepository returns AWSSESRepository instance.

func (*AWSSESRepository) SendEmail

func (r *AWSSESRepository) SendEmail(from, to, subject, contentText, contentHTML string) error

SendEmail sends email.

func (*AWSSESRepository) SendHTMLEmail

func (r *AWSSESRepository) SendHTMLEmail(from, to, subject, content string) error

SendHTMLEmail sends HTML email.

func (*AWSSESRepository) SendTextEmail

func (r *AWSSESRepository) SendTextEmail(from, to, subject, content string) error

SendTextEmail sends text email.

type AWSSESRepositoryInterface

type AWSSESRepositoryInterface interface {
	// Use via SendEmailService
	SendTextEmail(from, to, subject, content string) error
	SendHtmlEmail(from, to, subject, content string) error
	SendEmail(from, to, subject, content string) error
}

AWSSESRepositoryInterface interface.

type BaseRepository

type BaseRepository struct {
	Logger *infrastructure.Logger
}

BaseRepository struct.

func NewBaseRepository

func NewBaseRepository(logger *infrastructure.Logger) *BaseRepository

NewBaseRepository returns BaseRepository instance.

type SlackRepository

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

SlackRepository struct.

func NewSlackRepository

func NewSlackRepository(
	e *logrus.Entry,
	client *slack.Client,
	channelID string,
) *SlackRepository

NewSlackRepository returns SlackRepository instance.

func (*SlackRepository) PostMessage

func (r *SlackRepository) PostMessage(text string) error

PostMessage sends a message to a channel. Message is escaped by default according to https://api.slack.com/docs/formatting Use http://davestevens.github.io/slack-message-builder/ to help crafting your message.

func (*SlackRepository) PostMessageAttachment

func (r *SlackRepository) PostMessageAttachment(attachment *slack.Attachment) error

PostMessageAttachment sends a message to a channel. Message is escaped by default according to https://api.slack.com/docs/formatting Use http://davestevens.github.io/slack-message-builder/ to help crafting your message.

type SlackRepositoryInterface

type SlackRepositoryInterface interface {
	PostMessage(attachment *slack.Attachment) error
}

SlackRepositoryInterface interface

Directories

Path Synopsis
Package mock_repository is a generated GoMock package.
Package mock_repository is a generated GoMock package.

Jump to

Keyboard shortcuts

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