config

package
v0.2.0 Latest Latest
Warning

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

Go to latest
Published: Feb 16, 2017 License: GPL-3.0 Imports: 9 Imported by: 0

Documentation

Overview

The config package represents a static instance of the Config struct which is globally accessible once properly initialized.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ConfigJSONParametersExplained

func ConfigJSONParametersExplained() string

ConfigJSONParametersExplained() returns a nicely formatted string which describes all the public variables available to the user for configuration.

func FromFile

func FromFile() error

FromFile will generate a config struct from the local standard config file which is located inside of the assets folder as 'config.json'. It will be fully configured based off of the values in the json.

func ToFile

func ToFile() error

ToFile will save the current instance of config to the local standard config file which is located inside of the assets folder as 'config.json'. This will help preserver changes to the configuration between settings.

Types

type Config

type Config struct {
	CheckInGmailAddress      string `json:"CheckInGmailAddress"`      // (R) the gmail address to send updates to and receive updates from. parsed from line 1 of CheckInEmailCredentialsFile
	CheckInGmailPassword     string `json:"CheckInGmailPassword"`     // (R) the password for the gmail account. parsed from line 2 of CheckInEmailCredentialsFile
	CheckInFrequencySeconds  int    `json:"CheckInFrequencySeconds"`  // (R) The frequency with which this program will send status updates. In seconds.
	NetQueryFrequencySeconds int    `json:"NetQueryFrequencySeconds"` // (R) The frequency with which this program will attempt to connect to the outside world to verify internet connectivity
	DeviceName               string `json:"DeviceName"`               // (O) The canonical DeviceName for the machine currently executing this program.
	DeviceId                 string `json:"DeviceId"`                 // (O) The unique ID for the machine currently executing this program.
	InitialStartup           string `json:"InitialStartup"`           // (D) Whether or not this is the first time that the program is starting.
	FirstRunAfterUpdate      string `json:"FirstRunAfterUpdate"`      // (D) Whether or not this is the first time that the program is running after an update has been executed.
	UpdateFrequencySeconds   int    `json:"UpdateFrequencySeconds"`   // (D) The frequency with which this program will attempt to update itself. In seconds.
	RemoteUpdateURI          string `json:"RemoteUpdateURI"`          // (D) The remote location where new source code can be obtained from for this program.
	RemoteVersionURI         string `json:"RemoteVersionURI"`         // (D) The remote URI where the latest version number of this program can be obtained from.
	LocalVersion             uint64 `json:"LocalVersion"`             // (D) The local version of this program that is currently running.
}

Config represents a set of public configuration values used throughout the program to help anon-eth-net execute in a manner that the user expects. All values can be configured via the config.json file and changes to the config can be exported to the same file as well. This helps the program change state over time as well. (R) means the value is required to be provided by the user (O) means the value is optional and not required to be provided by the user (D) means the value is default value already set and should only be changed after careful consideration.

var Cfg *Config

Jump to

Keyboard shortcuts

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