config

package
v0.0.0-...-92255fb Latest Latest
Warning

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

Go to latest
Published: Mar 28, 2017 License: MIT Imports: 4 Imported by: 6

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Config

type Config struct {
	Addr                  string `json:"addr"`           // Address to listen on
	SecretKey             string `json:"secret_key"`     // Unique string for sessions
	RootPath              string `json:"root_path"`      // Path to www directory
	DataPath              string `json:"data_path"`      // Path to data files
	AdminPassword         string `json:"admin_password"` // Password for admin user
	TwitterConsumerKey    string `json:"twitter_consumer_key"`
	TwitterConsumerSecret string `json:"twitter_consumer_secret"`
	TwitterAccessToken    string `json:"twitter_access_token"`
	TwitterAccessSecret   string `json:"twitter_access_secret"`
}

Config maintains the configuration for the application and manages its storage and retrieval from disk (in JSON format).

func LoadFromDisk

func LoadFromDisk(name string) (*Config, error)

LoadFromDisk attempts to load the configuration from disk.

func LoadFromEnvironment

func LoadFromEnvironment() *Config

LoadFromEnvironment attempts to load the configuration from environment variables. Default values are provided for everything except the Twitter access credentials.

Jump to

Keyboard shortcuts

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