conf

package
v0.0.0-...-7ba06b6 Latest Latest
Warning

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

Go to latest
Published: Jul 20, 2018 License: MIT Imports: 11 Imported by: 0

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 GenerateJWTSecret

func GenerateJWTSecret()

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"`
}

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"`

func MockAppConfig

func MockAppConfig() (AppConfig, error)

MockAppConfig mocks out and saves the app config

type LoggingConfig

type LoggingConfig struct {
	Level string
	File  string
}

LoggingConfig specifies all the parameters needed for logging

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

NavConfig defines a structure to store rpc data

var NavConf NavConfig

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

type ServerConfig

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

	LivePort   int64
	TestPort   int64
	UseTestnet bool

	JWTSecret string // this is self generated on each start
}

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