mailerservice

package
v0.0.0-...-a9081ec Latest Latest
Warning

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

Go to latest
Published: Mar 3, 2023 License: MIT Imports: 6 Imported by: 0

Documentation

Overview

Package mailerservice holds the business logic and data structures associated with the mailer domain.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Config

type Config struct {
	MailerRepo Repository

	MailConfig *configs.MailgunMailer
	Tracer     trace.Tracer
	Logger     *otelzap.Logger
	Conf       *configs.Host
}

Config will hold repository and used utils that will be injected into this Service layer on service initialization

type Interface

type Interface interface{}

Interface specifies the business operations of the service.

func New

func New(c *Config) Interface

New configures and returns an Interface implementation.

type MockInterface

type MockInterface struct {
	mock.Mock
}

MockInterface is an autogenerated mock type for the Interface type

func NewMockInterface

func NewMockInterface(t mockConstructorTestingTNewMockInterface) *MockInterface

NewMockInterface creates a new instance of MockInterface. It also registers a testing interface on the mock and a cleanup function to assert the mocks expectations.

type MockRepository

type MockRepository struct {
	mock.Mock
}

MockRepository is an autogenerated mock type for the Repository type

func NewMockRepository

func NewMockRepository(t mockConstructorTestingTNewMockRepository) *MockRepository

NewMockRepository creates a new instance of MockRepository. It also registers a testing interface on the mock and a cleanup function to assert the mocks expectations.

func (*MockRepository) NewMessage

func (_m *MockRepository) NewMessage(sender string, subject string, recipient string) *mailgun.Message

NewMessage provides a mock function with given fields: sender, subject, recipient

func (*MockRepository) SendMail

func (_m *MockRepository) SendMail(ctx context.Context, messages *mailgun.Message) (string, error)

SendMail provides a mock function with given fields: ctx, messages

type Repository

type Repository interface {
	NewMessage(sender, subject, recipient string) *mailgun.Message
	SendMail(ctx context.Context, messages *mailgun.Message) (string, error)
}

Repository contain all the function available in the defined domain

Jump to

Keyboard shortcuts

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