sender

package
v0.0.0-...-8479bec Latest Latest
Warning

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

Go to latest
Published: May 21, 2020 License: Apache-2.0 Imports: 12 Imported by: 0

Documentation

Index

Constants

View Source
const LocalName = "nebula.puppet.com"

Variables

View Source
var (
	ErrAuthNotSupported          = errors.New("dial: server does not support AUTH")
	ErrNoAuthMechanismsAvailable = errors.New("dial: server does not support any common authentication mechanisms (want CRAM-MD5, PLAIN, or LOGIN)")
	ErrSTARTTLSNotSupported      = errors.New("dial: server does not support STARTTLS")
)

Functions

This section is empty.

Types

type AddressSpec

type AddressSpec struct {
	*mail.Address
}

func (*AddressSpec) UnmarshalJSON

func (as *AddressSpec) UnmarshalJSON(data []byte) (err error)

type BodySpec

type BodySpec struct {
	Text string `json:"text"`
	HTML string `json:"html"`
}

type Dialer

type Dialer struct{}

func (Dialer) DialContext

func (Dialer) DialContext(ctx context.Context, spec ServerSpec) (sender gomail.SendCloser, err error)

type Sender

type Sender struct {
	Client *smtp.Client
}

func (*Sender) Close

func (s *Sender) Close() error

func (*Sender) Send

func (s *Sender) Send(from string, tos []string, wt io.WriterTo) (err error)

type ServerSpec

type ServerSpec struct {
	Host     string `json:"host"`
	Port     int    `json:"port"`
	Username string `json:"username"`
	Password string `json:"password"`
	TLS      *bool  `json:"tls"`
}

type Spec

type Spec struct {
	Server         ServerSpec    `json:"server"`
	From           AddressSpec   `json:"from"`
	To             []AddressSpec `json:"to"`
	Cc             []AddressSpec `json:"cc"`
	Bcc            []AddressSpec `json:"bcc"`
	Subject        string        `json:"subject"`
	Body           BodySpec      `json:"body"`
	TimeoutSeconds uint          `json:"timeoutSeconds"`
}

Jump to

Keyboard shortcuts

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