config

package
v0.0.0-...-2c2efe1 Latest Latest
Warning

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

Go to latest
Published: Dec 12, 2019 License: Apache-2.0 Imports: 5 Imported by: 0

Documentation

Overview

Package config - create default config and read config values

Index

Constants

This section is empty.

Variables

View Source
var (
	// ErrConfigExists is returned on init if config file exists
	ErrConfigExists = errors.New("Config file already exists")
	// ErrConfigNotFound is returned when configuration not found
	ErrConfigNotFound = errors.New("Configuration not found")
)

Functions

func Init

func Init(folder string, config *Config) error

Init initialise config folder with default options

func SaveConfig

func SaveConfig(folder string, cfg *Config) error

SaveConfig stores configuration

Types

type Config

type Config struct {
	HTTP    HTTPConfig    `yaml:"http"`
	Node    NodeConfig    `yaml:"node"`
	Log     LogConfig     `yaml:"log"`
	IPFS    IPFSConfig    `yaml:"ipfs"`
	Plugins PluginsConfig `yaml:"plugins"`
}

Config -

func DefaultConfig

func DefaultConfig() *Config

DefaultConfig -

func ParseConfig

func ParseConfig(folder string) (*Config, error)

ParseConfig parses configuration file

type HTTPConfig

type HTTPConfig struct {
	ListenAddr    string `yaml:"listenAddr"`
	MetricsAddr   string `yaml:"metricsAddr"`
	OIDCProvider  string `yaml:"oidcProvider"`
	OIDCClientID  string `yaml:"oidcClientID"`
	OIDCClientKey string `yaml:"oidcClientKey"`
	CorsAllow     string `yaml:"corsAllow"`
}

HTTPConfig -

type IPFSConfig

type IPFSConfig struct {
	Connector     string   `yaml:"connector"`
	Bootstrap     []string `yaml:"bootstrap"`
	ListenAddress string   `yaml:"listenAddress"`
	APIAddress    string   `yaml:"apiAddress"`
}

IPFSConfig -

type LogConfig

type LogConfig struct {
	Format string `yaml:"format"`
	Level  string `yaml:"level"`
}

LogConfig -

type NodeConfig

type NodeConfig struct {
	NodeType              string `yaml:"nodeType"`
	MasterFiduciaryServer string `yaml:"masterFiduciaryServer"`
	MasterFiduciaryNodeID string `yaml:"masterFiduciaryNodeID"`
	NodeID                string `yaml:"nodeID"`
	NodeName              string `yaml:"nodeName"`
	Datastore             string `yaml:"dataStore"`
}

NodeConfig -

type PluginsConfig

type PluginsConfig struct {
	Service string `yaml:"service"`
}

PluginsConfig -

Jump to

Keyboard shortcuts

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