config

package
v0.0.0-...-f1ab898 Latest Latest
Warning

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

Go to latest
Published: Jan 25, 2016 License: MIT Imports: 4 Imported by: 3

Documentation

Overview

Package config reads config files and returns the proper config structure.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Configuration

type Configuration struct {
	// LogList is a list of log file locations that should be read if no arguments are uncompressed.
	LogList []string `toml:"LogList"`

	// EmailList is the list of recipients that will get an email when algorithm is done.
	EmailList []string `toml:"EmailList"`

	// OutputFile is the location of a file to output the emails if an SMTP server is not present.
	OutputFile string `toml:"OutputFile"`

	// SMTPConfig is the locationn of the SMTP config file with credentials in it.
	SMTPConfig string `toml:"SMTPConfig"`

	// Port is the port at which the API is to listen on.
	Port int `toml:"Port"`
}

Configuration is the main configurations for the application.

func Load

func Load() (*Configuration, error)

Load returns the main configuration file.

type SMTPConfig

type SMTPConfig struct {
	// Server has the information about the where the SMTP server is hosted and what port it is listening on.
	Server Server

	// User is the person who is going to be the person who is sending the emails.
	User User
}

SMTPConfig is the configurations for a personal SMTP server a user would like to use.

func LoadSMTP

func LoadSMTP() (*SMTPConfig, error)

LoadSMTP loads the settings for the smtp server.

type SecretConfig

type SecretConfig struct {
	// Sender is the user who is sending the email.
	Sender string `toml:"Sender"`

	// Domain is the domain name of which we want to use.
	Domain string `toml:"Domain"`

	// PrivateKey is the private key to access MailGun's API.
	PrivateKey string `toml:"PrivateKey"`

	// PublicKey is the public key to access MailGun's API.
	PublicKey string `toml:"PublicKey"`
}

SecretConfig is the configurations to hold the keys for MailGun.

func LoadSecret

func LoadSecret() (*SecretConfig, error)

LoadSecret loads the keys for Mailgun.

type Server

type Server struct {
	// Host is where the SMTP server is hosted.
	Host string `toml:"Host"`

	// Port is the Prot on which the SMTP server is listening on.
	Port int `toml:"Port"`
}

Server is the SMTP Server credentials.

type User

type User struct {
	// UserName is the username of the person sending the email.
	UserName string `toml:"UserName"`

	// PassWord is the password of the user.
	PassWord string `toml:"PassWord"`
}

User has the credentials for the person who is sending the email.

Jump to

Keyboard shortcuts

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