smtpingressapi

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: 13 Imported by: 0

Documentation

Overview

Package smtpingressapi implements the public API of the smtp.ingress.core microservice, including clients and data structures.

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

Index

Constants

View Source
const Hostname = "smtp.ingress.core"

Hostname is the default hostname of the microservice: smtp.ingress.core.

Variables

This section is empty.

Functions

This section is empty.

Types

type Client

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

Client is an interface to calling the endpoints of the smtp.ingress.core microservice. This simple version is for unicast calls.

func NewClient

func NewClient(caller service.Publisher) *Client

NewClient creates a new unicast client to the smtp.ingress.core microservice.

func (*Client) ForHost

func (_c *Client) ForHost(host string) *Client

ForHost replaces the default hostname of this client.

type Email

type Email = letters.Email

Email is a message received by the email server, then parsed.

type Hook

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

Hook assists in the subscription to the events of the smtp.ingress.core microservice.

func NewHook

func NewHook(listener service.Subscriber) *Hook

NewHook creates a new hook to the events of the smtp.ingress.core microservice.

func (*Hook) ForHost

func (_c *Hook) ForHost(host string) *Hook

ForHost replaces the default hostname of this hook.

func (*Hook) OnIncomingEmail

func (_c *Hook) OnIncomingEmail(handler func(ctx context.Context, mailMessage *Email) (err error)) error

OnIncomingEmail is triggered when a new email message is received.

type MulticastClient

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

MulticastClient is an interface to calling the endpoints of the smtp.ingress.core microservice. This advanced version is for multicast calls.

func NewMulticastClient

func NewMulticastClient(caller service.Publisher) *MulticastClient

NewMulticastClient creates a new multicast client to the smtp.ingress.core microservice.

func (*MulticastClient) ForHost

func (_c *MulticastClient) ForHost(host string) *MulticastClient

ForHost replaces the default hostname of this client.

type MulticastTrigger

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

MulticastTrigger is an interface to trigger the events of the smtp.ingress.core microservice.

func NewMulticastTrigger

func NewMulticastTrigger(caller service.Publisher) *MulticastTrigger

NewMulticastTrigger creates a new multicast trigger of the smtp.ingress.core microservice.

func (*MulticastTrigger) ForHost

func (_c *MulticastTrigger) ForHost(host string) *MulticastTrigger

ForHost replaces the default hostname of this trigger.

func (*MulticastTrigger) OnIncomingEmail

func (_c *MulticastTrigger) OnIncomingEmail(ctx context.Context, mailMessage *Email) <-chan *OnIncomingEmailResponse

OnIncomingEmail is triggered when a new email message is received.

type OnIncomingEmailIn

type OnIncomingEmailIn struct {
	MailMessage *Email `json:"mailMessage"`
}

OnIncomingEmailIn are the input arguments of OnIncomingEmail.

type OnIncomingEmailOut

type OnIncomingEmailOut struct {
}

OnIncomingEmailOut are the return values of OnIncomingEmail.

type OnIncomingEmailResponse

type OnIncomingEmailResponse struct {
	HTTPResponse *http.Response
	// contains filtered or unexported fields
}

OnIncomingEmailResponse is the response to OnIncomingEmail.

func (*OnIncomingEmailResponse) Get

func (_out *OnIncomingEmailResponse) Get() (err error)

Get retrieves the return values.

Jump to

Keyboard shortcuts

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