internal

package
v0.0.0-...-8041c63 Latest Latest
Warning

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

Go to latest
Published: Aug 23, 2022 License: MPL-2.0 Imports: 8 Imported by: 0

Documentation

Index

Constants

View Source
const (
	// config
	APP_CONFIG      = "config.env"
	APPROVAL_CONFIG = "approvals.yaml"

	// server
	SRV_HOST      = ""
	SRV_PORT      = "18652"
	POLL_INTERVAL = 30

	// email templates
	TEMPLATE_FOLDER = "templates"

	// tls configuration
	TLS_FOLDER    = "certs"
	TLS_ORG       = "Spoon Boy"
	TLS_VALID_FOR = 365 * 24 * time.Hour
)

Variables

View Source
var (
	ERR_FAILED_READ_CONFIG    = errors.New("Failed to read application configuration file")
	ERR_NO_API_HOST           = errors.New("No Morpheus API Host found")
	ERR_NO_API_TOKEN          = errors.New("No Morpheus API Token found")
	ERR_POLL_INTERVAL_NOT_INT = errors.New("Poll interval not integer")
	ERR_NO_SMTP_SERVER        = errors.New("No SMTP server found")
	ERR_NO_SMTP_PORT          = errors.New("No SMTP Port found")
	ERR_NO_SMTP_USER          = errors.New("No SMTP User found")
	ERR_NO_SMTP_PASSWORD      = errors.New("No SMTP Password found")
)
View Source
var DefaultTemplate string = `Template here TODO`

Functions

This section is empty.

Types

type App

type App struct {
	Logger *koan.Logger
	Ctx    context.Context
	Config struct {
		MorpheusHost  string
		MorpheusToken string
		PollInterval  int
		SmtpServer    string
		SmtpPort      int
		SmtpUser      string
		SmtpPassword  string
	}
	State *state.State
}

App is provides a wrapper for passing the Config, Context, Logger & State around as dependencies

func (*App) LoadConfig

func (*App) LoadConfig(configFile string) error

LoadConfig loads the application configuration file

func (*App) ValidateConfig

func (a *App) ValidateConfig() error

ValidateConfig checks that we have configuration we can use in the application

Directories

Path Synopsis
Package certificate provides code to create and write a self-signed TLS certificate
Package certificate provides code to create and write a self-signed TLS certificate

Jump to

Keyboard shortcuts

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