config

package
v0.0.0-...-9e3aff1 Latest Latest
Warning

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

Go to latest
Published: Apr 27, 2019 License: Apache-2.0 Imports: 24 Imported by: 0

Documentation

Index

Constants

View Source
const (
	DEFAULT_DATABASE_HOST = "localhost"
	DEFAULT_DATABASE_PORT = 3306
	DEFAULT_DATABASE_NAME = "opendmarc"
	DEFAULT_DATABASE_USER = "opendmarc"
	DEFAULT_DATABASE_PASS = "opendmarc"

	DEFAULT_SMTP_HOST = "localhost"
	DEFAULT_SMTP_PORT = 25
	DEFAULT_SMTP_USER = "postmaster@localdomain"
	DEFAULT_SMTP_PASS = "opendmarc"

	DEFAULT_INTERVAL = "24h"

	DEFAULT_DAT_PATH = "/var/tmp/"
)

Variables

This section is empty.

Functions

func GetDefaultDSN

func GetDefaultDSN() string

func GetDefaultSmtp

func GetDefaultSmtp() string

Types

type Config

type Config interface {
	JSON() []byte
	YAML() []byte
	TOML() []byte

	Connect()

	GetInterval() time.Duration
	IsDayMode() bool

	IsTesting() bool
	IsUpdate() bool

	GetOrg() string
	GetEmail() *tools.MailAddress
	GetMakeRecipient(to tools.ListMailAddress) tools.ListMailAddress

	GetDatabase() *sql.DB
	GetSMTP() SMTP
	GetHTTP(url string) HTTP
	GetFTP(url string) FTP
}

func GetConfig

func GetConfig() Config

type FTP

type FTP interface {
	Connect()
	Close()
	Store(zipName string, zipFile *bytes.Buffer)
}

type HTTP

type HTTP interface {
	Check() bool
	Call(zipFile *bytes.Buffer) (bool, *bytes.Buffer)
}

type SMTP

type SMTP interface {
	Client() *smtp.Client
	Close()
	Check()

	GetSMTPUrl() string
}

type TLSMode

type TLSMode uint8
const (
	TLSNONE TLSMode = iota
	STARTTLS
	TLS
)

func ParseTLSMode

func ParseTLSMode(str string) TLSMode

func (TLSMode) String

func (tlm TLSMode) String() string

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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