intermediate

package
v1.5.1 Latest Latest
Warning

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

Go to latest
Published: Aug 7, 2024 License: Apache-2.0 Imports: 20 Imported by: 0

Documentation

Overview

Package intermediate serves as the foundation of the smtp.ingress.core microservice.

The SMTP ingress microservice listens for incoming emails and fires corresponding events.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Intermediate

type Intermediate struct {
	*connector.Connector
	// contains filtered or unexported fields
}

Intermediate extends and customizes the generic base connector. Code generated microservices then extend the intermediate.

func NewService

func NewService(impl ToDo, version int) *Intermediate

NewService creates a new intermediate service.

func (*Intermediate) Enabled

func (svc *Intermediate) Enabled() (enabled bool)

Enabled determines whether the email server is started.

func (*Intermediate) MaxClients

func (svc *Intermediate) MaxClients() (clients int)

MaxClients controls how many client connection can be opened in parallel. Defaults to 128.

func (*Intermediate) MaxSize

func (svc *Intermediate) MaxSize() (mb int)

MaxSize is the maximum size of messages that will be accepted, in megabytes. Defaults to 10 megabytes.

func (*Intermediate) Port

func (svc *Intermediate) Port() (port int)

Port is the TCP port to listen to.

func (*Intermediate) SetEnabled

func (svc *Intermediate) SetEnabled(enabled bool) error

SetEnabled sets the value of the configuration property.

Enabled determines whether the email server is started.

func (*Intermediate) SetMaxClients

func (svc *Intermediate) SetMaxClients(clients int) error

SetMaxClients sets the value of the configuration property.

MaxClients controls how many client connection can be opened in parallel. Defaults to 128.

func (*Intermediate) SetMaxSize

func (svc *Intermediate) SetMaxSize(mb int) error

SetMaxSize sets the value of the configuration property.

MaxSize is the maximum size of messages that will be accepted, in megabytes. Defaults to 10 megabytes.

func (*Intermediate) SetPort

func (svc *Intermediate) SetPort(port int) error

SetPort sets the value of the configuration property.

Port is the TCP port to listen to.

func (*Intermediate) SetWorkers

func (svc *Intermediate) SetWorkers(clients int) error

SetWorkers sets the value of the configuration property.

Workers controls how many workers process incoming mail. Defaults to 8.

func (*Intermediate) Workers

func (svc *Intermediate) Workers() (clients int)

Workers controls how many workers process incoming mail. Defaults to 8.

type Mock

type Mock struct {
	*Intermediate
}

Mock is a mockable version of the smtp.ingress.core microservice, allowing functions, event sinks and web handlers to be mocked.

func NewMock

func NewMock() *Mock

NewMock creates a new mockable version of the microservice.

func (*Mock) OnChangedEnabled

func (svc *Mock) OnChangedEnabled(ctx context.Context) (err error)

OnChangedEnabled is a no op.

func (*Mock) OnChangedMaxClients

func (svc *Mock) OnChangedMaxClients(ctx context.Context) (err error)

OnChangedMaxClients is a no op.

func (*Mock) OnChangedMaxSize

func (svc *Mock) OnChangedMaxSize(ctx context.Context) (err error)

OnChangedMaxSize is a no op.

func (*Mock) OnChangedPort

func (svc *Mock) OnChangedPort(ctx context.Context) (err error)

OnChangedPort is a no op.

func (*Mock) OnChangedWorkers

func (svc *Mock) OnChangedWorkers(ctx context.Context) (err error)

OnChangedWorkers is a no op.

func (*Mock) OnShutdown

func (svc *Mock) OnShutdown(ctx context.Context) (err error)

OnShutdown is a no op.

func (*Mock) OnStartup

func (svc *Mock) OnStartup(ctx context.Context) (err error)

OnStartup makes sure that the mock is not executed in a non-dev environment.

type ToDo

type ToDo interface {
	OnStartup(ctx context.Context) (err error)
	OnShutdown(ctx context.Context) (err error)
	OnChangedPort(ctx context.Context) (err error)
	OnChangedEnabled(ctx context.Context) (err error)
	OnChangedMaxSize(ctx context.Context) (err error)
	OnChangedMaxClients(ctx context.Context) (err error)
	OnChangedWorkers(ctx context.Context) (err error)
}

ToDo defines the interface that the microservice must implement. The intermediate delegates handling to this interface.

Jump to

Keyboard shortcuts

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