types

package
v0.0.0-...-e0a8689 Latest Latest
Warning

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

Go to latest
Published: Feb 14, 2024 License: MIT Imports: 6 Imported by: 0

Documentation

Overview

********************************************************************************** The MIT License (MIT)

Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. **********************************************************************************

********************************************************************************** The MIT License (MIT)

Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. *********************************************************************************

********************************************************************************** The MIT License (MIT)

Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. *********************************************************************************

********************************************************************************** The MIT License (MIT)

Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. *********************************************************************************

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Email

type Email struct {
	Connection  EmailConnectionConfig `json:"connection" dynamodbav:"-"`
	Created     time.Time             `json:"created" dynamodbav:"created"`
	Updated     time.Time             `json:"updated" dynamodbav:"updated"`
	ToAddresses []string              `json:"toaddresses" dynamodbav:"toaddresses"`
	FromAddress string                `json:"from" dynamodbav:"from"`
	Subject     string                `json:"subject" dynamodbav:"subject"`
	Body        string                `json:"body" dynamodbav:"body"`
	User        string                `json:"user" dynamodbav:"user"`
}

Email is the representation of an email to send or one received

func NewEmail

func NewEmail(toAddresses []string, fromAddress, subject, body string) *Email

NewEmail creates and returns a reference to a new Email object

type EmailConnectionConfig

type EmailConnectionConfig struct {
	Credentials common.Credentials `json:"credentials,omitempty" dynamodbav:"credentials,omitmepty"`
	Parameters  map[string]string  `json:"parameters,omitempty" dynamodbav:"parameters,omitempty"`
	Host        string             `json:"host" dynamodbav:"host"`
	Port        string             `json:"port" dynamodbav:"port"`
}

EmailConnectionConfig represents the connection information required to connect to an email server/system

func EmailConnectionConfigFromString

func EmailConnectionConfigFromString(connection string) (EmailConnectionConfig, error)

EmailConnectionConfigFromString parses the passed in connection string creates and returns a new EmailConnectionConfig object

func (EmailConnectionConfig) AWSConnectConfig

func (config EmailConnectionConfig) AWSConnectConfig() aws.ConnectConfig

Creates and returns an AWS ConnectionConfig object ffrom the EmailConnectionConfig

func (*EmailConnectionConfig) UnmarshalText

func (config *EmailConnectionConfig) UnmarshalText(text []byte) error

UnmarshalText is the custom method use to create a EmailConnectionConfig when read from a string/byte slice or environment variable

type EmailWorker

type EmailWorker struct{}

EmailWorker manages the operation of the email service and API

func NewEmailWorker

func NewEmailWorker() *EmailWorker

NewEmailWorker creates and returns a reference to a new EmailWorker instance

func (EmailWorker) SendEmail

func (worker EmailWorker) SendEmail(email Email) error

SendEmail takes the email as input and sends the email to the configured email source

type SmtpClient

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

func NewSmtpClient

func NewSmtpClient(config EmailConnectionConfig) *SmtpClient

func (SmtpClient) SendEmail

func (client SmtpClient) SendEmail(email Email) error

Jump to

Keyboard shortcuts

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