config

package
v4.1.0+incompatible Latest Latest
Warning

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

Go to latest
Published: Aug 17, 2018 License: Apache-2.0 Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type AppConfig

type AppConfig struct {
	Backend  Backend     `json:"backend"`
	Frontend interface{} `json:"frontend"`
}

AppConfig holds the whole app configuration.

func NewDefaultConfig

func NewDefaultConfig() AppConfig

NewDefaultConfig returns the default app config.

type Backend

type Backend struct {
	BitcoinP2PKHActive       bool `json:"bitcoinP2PKHActive"`
	BitcoinP2WPKHP2SHActive  bool `json:"bitcoinP2WPKHP2SHActive"`
	BitcoinP2WPKHActive      bool `json:"bitcoinP2WPKHActive"`
	LitecoinP2WPKHP2SHActive bool `json:"litecoinP2WPKHP2SHActive"`
	LitecoinP2WPKHActive     bool `json:"litecoinP2WPKHActive"`

	BTC  CoinConfig `json:"btc"`
	TBTC CoinConfig `json:"tbtc"`
	LTC  CoinConfig `json:"ltc"`
	TLTC CoinConfig `json:"tltc"`
}

Backend holds the backend specific configuration.

func (Backend) AccountActive

func (backend Backend) AccountActive(code string) bool

AccountActive returns the Active setting for a coin by code.

type CoinConfig

type CoinConfig struct {
	ElectrumServers []*rpc.ServerInfo `json:"electrumServers"`
}

CoinConfig holds configurations specific to a coin.

type Config

type Config struct {
	// contains filtered or unexported fields
}

Config manages the app configuration.

func NewConfig

func NewConfig(filename string) *Config

NewConfig creates a new Config, stored in the given location. The filename must be writable, but does not have to exist.

func (*Config) Config

func (config *Config) Config() AppConfig

Config returns the app config.

func (*Config) Set

func (config *Config) Set(appConfig AppConfig) error

Set sets and persists the app config.

Jump to

Keyboard shortcuts

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