types

package
v1.0.0 Latest Latest
Warning

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

Go to latest
Published: Dec 16, 2024 License: GPL-3.0 Imports: 8 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	ErrFileEmpty    = errors.New("no file name provided")
	ErrFileNotExist = errors.New("file does not exist")
	ErrFile         = errors.New("file error")

	ErrDomainEmpty   = errors.New("no domain name provided")
	ErrDomainInvalid = errors.New("invalid domain name")

	ErrPortInvalid    = errors.New("invalid TCP port")
	ErrPortNegative   = errors.New("port number cannot be negative")
	ErrPortOutOfRange = fmt.Errorf("port number out of range (maximum port no. is %d)", maxPort)

	ErrSecurityInvalid       = errors.New("invalid security protocol")
	ErrAuthenticationInvalid = errors.New("invalid authentication method")

	ErrEmailInvalid = errors.New("invalid email address")

	ErrAttachmentInvalid = errors.New("invalid attachment")

	ErrHeaderEmpty            = errors.New("header is empty")
	ErrHeaderNoColon          = errors.New("header must contain a colon")
	ErrHeaderMultipleColons   = errors.New("header has multiple colons")
	ErrHeaderNameEmpty        = errors.New("header name is empty")
	ErrHeaderNameIllegalChars = errors.New("header name contains illegal characters")
	ErrHeaderBodyEmpty        = errors.New("header body is empty")
	ErrHeaderBodyIllegalChars = errors.New("header body contains illegal characters")
	ErrHeaderLineTooLong      = fmt.Errorf("header line exceeds maximum lenght of %d", MaxLineLength)
)
View Source
var (
	MaxLineLength = 78
)

Functions

func CheckHeader

func CheckHeader(text string) error

Types

type Attachments

type Attachments []FilePath

func (*Attachments) Set

func (at *Attachments) Set(attachments string) error

func (Attachments) String

func (at Attachments) String() string

type AuthenticationMethod

type AuthenticationMethod string
const (
	NoAuthentication AuthenticationMethod = ""
	PlainAuth        AuthenticationMethod = "plain"
	CramMd5Auth      AuthenticationMethod = "cram-md5"
)

func (*AuthenticationMethod) Set

func (a *AuthenticationMethod) Set(auth string) error

func (AuthenticationMethod) String

func (a AuthenticationMethod) String() string

type DomainName

type DomainName string

func (*DomainName) Set

func (dn *DomainName) Set(host string) error

func (DomainName) String

func (dn DomainName) String() string

type Email

type Email mail.Address

func (Email) GetMailAddress

func (e Email) GetMailAddress() mail.Address

func (*Email) Set

func (e *Email) Set(email string) error

func (Email) String

func (e Email) String() string

type EmailAddresses

type EmailAddresses []Email

func (EmailAddresses) GetMailAddresses

func (eas EmailAddresses) GetMailAddresses() []mail.Address

func (*EmailAddresses) Set

func (eas *EmailAddresses) Set(emails string) error

func (EmailAddresses) String

func (eas EmailAddresses) String() string

type FilePath

type FilePath string

func (*FilePath) Set

func (fp *FilePath) Set(path string) error

func (FilePath) String

func (fp FilePath) String() string
type Header string

func (*Header) Set

func (h *Header) Set(text string) error

func (*Header) String

func (h *Header) String() string

type Headers

type Headers []Header

func (*Headers) Set

func (hs *Headers) Set(text string) error

func (Headers) String

func (hs Headers) String() string

type Security

type Security string
const (
	NoSecurity  Security = ""
	StartTlsSec Security = "starttls"
	SslTlsSec   Security = "ssl/tls"
)

func (*Security) Set

func (s *Security) Set(sec string) error

func (Security) String

func (s Security) String() string

type TCPPort

type TCPPort int

func (*TCPPort) Set

func (tp *TCPPort) Set(portText string) error

func (TCPPort) String

func (tp TCPPort) String() string

Jump to

Keyboard shortcuts

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