config

package
v0.0.0-...-856a469 Latest Latest
Warning

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

Go to latest
Published: Jul 20, 2017 License: Apache-2.0 Imports: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Config

type Config interface {
	GetURL() string
}

Config GetURL return the URL from the config file

type ConfigStructure

type ConfigStructure struct {
	ConsoleActivated   string `json:"console_activated"`
	InfluxDBActivated  string `json:"influxDB_activated"`
	InfluxDBDatabase   string `json:"influxDB_database"`
	InfluxDBPassword   string `json:"influxDB_password"`
	InfluxDBServer     string `json:"influxDB_server"`
	InfluxDBServerPort string `json:"influxDB_server_port"`
	InfluxDBUsername   string `json:"influxDB_username"`
	LogLevel           string `json:"log_level"`
	NestAccessToken    string `json:"nest_access_token"`
	NestURL            string `json:"nest_url"`
	RefreshTimer       string `json:"refresh_timer"`
}

ConfigStructure is the structure of the config YAML file use http://mervine.net/json2struct

func New

func New(configName string) ConfigStructure

New create the configStructure and fill in

func (ConfigStructure) GetURL

func (configInfo ConfigStructure) GetURL() string

GetURL return nestURL

func (ConfigStructure) ReadConfig

func (configInfo ConfigStructure) ReadConfig(configName string) ConfigStructure

ReadConfig read config from config.json with the package viper

Jump to

Keyboard shortcuts

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