settings

package
v0.0.0-...-e47413e Latest Latest
Warning

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

Go to latest
Published: Nov 4, 2015 License: MIT Imports: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Configuration

type Configuration struct {
	Header      string
	Footer      string
	WWW         string `json:"www"`
	WWWAbs      string
	WWWPort     float64 `json:"wwwPort"`
	SmtpAddress string  `json:"smtpAddress"`
	SmtpPort    float64 `json:"smtpPort"`
	DBEngine    string  `json:"dbEngine"`
	DBHost      string  `json:"dbHost"`
	DBPort      string  `json:"dbPort"`
	DBDatabase  string  `json:"dbDatabase"`
	DBUserName  string  `json:"dbUserName"`
	DBPassword  string  `json:"dbPassword"`
}
var Config Configuration

func (*Configuration) GetFullListenAddress

func (c *Configuration) GetFullListenAddress() string

Returns a fully qualified address and port

func (*Configuration) LoadFlags

func (c *Configuration) LoadFlags()

Sets values in this Configuration struct with any command line flag values.

func (*Configuration) LoadFooter

func (c *Configuration) LoadFooter(fileName string)

Loads a footer view for HTML output

func (*Configuration) LoadHeader

func (c *Configuration) LoadHeader(fileName string)

Loads a header view for HTML output

func (*Configuration) LoadSettings

func (c *Configuration) LoadSettings(configFile string) error

Loads the specified configuration JSON file and parses the contents into a Configuration struct. It then calls loadFlags() to determine if any command line arguments override the config file.

func (*Configuration) RenderView

func (c *Configuration) RenderView(writer http.ResponseWriter, fileName string)

Renders a view to the HTTP response stream

func (*Configuration) SaveSettings

func (c *Configuration) SaveSettings(configFile string) error

Saves the current settings structure to the config file.

func (*Configuration) WriteJson

func (c *Configuration) WriteJson(writer http.ResponseWriter, jsonData []byte)

Takes a byte array of JSON serialized data and writes it to the HTTP response stream.

Jump to

Keyboard shortcuts

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