conf

package
v0.0.1 Latest Latest
Warning

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

Go to latest
Published: Jun 5, 2018 License: MIT Imports: 10 Imported by: 6

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ConfigureLogging

func ConfigureLogging(config *LoggingConfig) (*logrus.Entry, error)

ConfigureLogging will take the logging configuration and also adds a few default parameters

func CreateRPCDetails

func CreateRPCDetails()

CreateRPCDetails generate rpc details for this run

func LoadAppConfig

func LoadAppConfig() error

LoadAppConfig sets up viper, reads and parses app config

func LoadDevConfig

func LoadDevConfig() error

LoadDevConfig sets up viper, loads, parses dev config

func SaveAppConfig

func SaveAppConfig() error

SaveAppConfig formats/indents json and saves to app-config.json

func StartConfigManager

func StartConfigManager()

StartConfigManager sets up the ticker loop to load app config

Types

type AppConfig

type AppConfig struct {
	NavConf           string   `json:"navconf"`
	RunningNavVersion string   `json:"runningNavVersion"`
	AllowedIps        []string `json:"allowedIps"`
	UIPassword        string   `json:"uiPassword"`
	Coins             []Coins  `json:"coins"`
}

AppConfig defines a structure to store app config data

var AppConf AppConfig

AppConf holds the app config NavConf string `json:"navconf"` RunningNavVersion string `json:"runningNavVersion"` AllowedIps []string `json:"allowedIps"` UIPassword string `json:"uiPassword"`

type Coins

type Coins struct {
	DaemonVersion    string `json:"daemonVersion"`
	CurrencyCode     string `json:"currencyCode"`
	LatestReleaseAPI string `json:"latestReleaseApi"`
	ReleaseAPI       string `json:"ReleaseApi"`
}

Coins defines structure of supported coin data

type DaemonConfig

type DaemonConfig struct {
	RPCUser     string `json:"rpcUser"`
	RPCPassword string `json:"rpcPassword"`
}

DaemonConfig defines a structure to store rpc data

var NavConf DaemonConfig

NavConf holds the rpc config RPCUser string `json:"rpcUser"` RPCPassword string `json:"rpcPassword"`

type LoggingConfig

type LoggingConfig struct {
	Level string
	File  string
}

LoggingConfig specifies all the parameters needed for logging

type ServerConfig

type ServerConfig struct {
	ManagerAPIPort   int64
	DaemonAPIPort    int64
	SetupAPIPort     int64
	LatestReleaseAPI string
	ReleaseAPI       string
	DaemonHeartbeat  int64

	LivePort   int64
	TestPort   int64
	UseTestnet bool
}

ServerConfig defines a structure to store server config data

var ServerConf ServerConfig

ServerConf holds the server config ManagerAPIPort int64 DaemonAPIPort int64 SetupAPIPort int64 LatestReleaseAPI string ReleaseAPI string DaemonHeartbeat int64

func LoadServerConfig

func LoadServerConfig() (ServerConfig, error)

LoadServerConfig sets up viper, reads and parses server config

Jump to

Keyboard shortcuts

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