adapters

package
v0.0.0-...-d62e8b7 Latest Latest
Warning

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

Go to latest
Published: Jan 23, 2024 License: GPL-3.0 Imports: 12 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var ErrReadingFile = errors.New("error while reading file")
View Source
var ErrSendingEmail = errors.New("error while sending email")

Functions

This section is empty.

Types

type CSVReader

type CSVReader interface {
	// Read reads a CSV file by its name.
	//
	// Returns the list of rows of the CSV file
	// or ErrReadingFile if an error is produced
	Read(fileName string) ([][]string, error)
}

type EmailSender

type EmailSender interface {
	// Send sends an email to recipient with the subject and body received by parameter.
	//
	// Returns ErrSendingEmail if an error is produced
	Send(recipient, subject, body string) error
}

type LocalCSVReader

type LocalCSVReader struct{}

func (LocalCSVReader) Read

func (reader LocalCSVReader) Read(fileName string) ([][]string, error)

Read reads a CSV file by its name.

Returns the list of rows of the CSV file or ErrReadingFile if an error is produced

type MailJetEmailSender

type MailJetEmailSender struct {
	PublicAPIKey  string
	PrivateAPIKey string
}

func (MailJetEmailSender) Send

func (sender MailJetEmailSender) Send(recipient, subject, body string) error

Send sends an email to recipient with the subject and body received by parameter.

Returns ErrSendingEmail if an error is produced

type S3CSVReader

type S3CSVReader struct {
	LocalCSVReader LocalCSVReader
}

func (S3CSVReader) Read

func (reader S3CSVReader) Read(fileName string) ([][]string, error)

Read reads a CSV file by its name.

Returns the list of rows of the CSV file or ErrReadingFile if an error is produced

Jump to

Keyboard shortcuts

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