config

package
v0.0.0-...-93bdfb3 Latest Latest
Warning

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

Go to latest
Published: Mar 22, 2024 License: BSD-3-Clause Imports: 3 Imported by: 0

Documentation

Overview

Copyright (c) 2024 Owen Waller. All rights reserved.

Index

Constants

View Source
const (
	DefaultConfigFilename = "config"
	DefaultConfigType     = "toml"
)

Variables

This section is empty.

Functions

func BuildTemplateFilename

func BuildTemplateFilename(dir, filename string) string

func SetConfigFile

func SetConfigFile(configFilename string) error

func SetUpTemplates

func SetUpTemplates()

Types

type AuthData

type AuthData struct {
	Username string
	Password string
}

type Config

type Config struct {
	LogFile   LogFileData
	Smtp      SmtpData
	Auth      AuthData
	Addresses EmailAddressData
	Subjects  EmailSubjectData
	Templates EmailTemplatesData
	Fields    map[string]FieldData
}

func GetConfig

func GetConfig() *Config

func ReadConfig

func ReadConfig(filename string) (*Config, error)

type ConfigMarshalError

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

func NewConfigMarshalError

func NewConfigMarshalError(msg string, err string) ConfigMarshalError

func (ConfigMarshalError) Error

func (e ConfigMarshalError) Error() string

type ConfigReadError

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

func NewConfigReadError

func NewConfigReadError(msg string, err string) ConfigReadError

func (ConfigReadError) Error

func (e ConfigReadError) Error() string

type EmailAddressData

type EmailAddressData struct {
	CustomerFrom     string
	CustomerFromName string
	CustomerReplyTo  string
	SystemTo         string
	SystemToName     string
	SystemFrom       string
	SystemFromName   string
	SystemReplyTo    string
}

type EmailSubjectData

type EmailSubjectData struct {
	Customer string
	System   string
}

type EmailTemplateData

type EmailTemplateData struct {
	FormData      map[string]string
	UserAgent     string
	RemoteIp      string
	XForwardedFor string
}

type EmailTemplatesData

type EmailTemplatesData struct {
	Dir                  string
	CustomerText         string
	CustomerHtml         string
	SystemText           string
	SystemHtml           string
	CustomerTextFileName string
	CustomerHtmlFileName string
	SystemTextFileName   string
	SystemHtmlFileName   string
}

type FieldData

type FieldData struct {
	Name string
	Type string
}

type LogFileData

type LogFileData struct {
	Filename string
	Path     string
	Level    string
}

type SmtpData

type SmtpData struct {
	Host string
	Port int
}

Jump to

Keyboard shortcuts

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