configRead

package
v0.0.0-...-6ebd40e Latest Latest
Warning

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

Go to latest
Published: May 25, 2017 License: GPL-3.0 Imports: 5 Imported by: 4

Documentation

Overview

Package configRead reads configuration information from either a JSON file or from static environment variables as a fallback.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Config

type Config struct {
	SpotifyKey      string `json:"spotify-key"`
	SpotifySecret   string `json:"spotify-secret"`
	LastFmKey       string `json:"lastfm-key"`
	LastFmSecret    string `json:"lastfm-secret"`
	HTTPPort        string `json:"http-port"`
	Hostname        string `json:"hostname,omitempty"`
	AuthRedirectURL string `json:"auth-redirect-url"`
	Debug           bool   `json:"debug"`
	RedisURL        string `json:"redis-url"`
}

Config holds the different configuration options.

func Read

func Read(path string) (Config, error)

Read takes a path to a JSON file. If it fails to read the file, it falls back to environment variables. Returns an error if it can't parse the JSON file or if it can't read environment variables.

Jump to

Keyboard shortcuts

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