config

package
v0.14.0 Latest Latest
Warning

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

Go to latest
Published: Sep 6, 2019 License: Apache-2.0 Imports: 15 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	EnvMarketplaceAddress  string
	EnvMarketplaceToken    string
	EnvMarketplaceEndpoint string
)

Env to override on the system services

Functions

This section is empty.

Types

type Config added in v0.3.0

type Config struct {
	Name string
	Path string

	Server struct {
		Address string
	}

	Log struct {
		Format      string
		ForceColors bool
		Level       string
	}

	Database struct {
		ServiceRelativePath   string
		InstanceRelativePath  string
		ExecutionRelativePath string
		ProcessRelativePath   string
	}

	Tendermint struct {
		*tmconfig.Config
		Path string
	}

	Cosmos CosmosConfig

	SystemServices []*ServiceConfig
}

Config contains all the configuration needed.

func Global added in v0.3.0

func Global() (*Config, error)

Global returns a singleton of a Config after loaded ENV and validate the values.

func New added in v0.3.0

func New() (*Config, error)

New creates a new config with default values.

func (*Config) Load added in v0.3.0

func (c *Config) Load() error

Load reads config from environmental variables.

func (*Config) Prepare added in v0.3.0

func (c *Config) Prepare() error

Prepare setups local directories or any other required thing based on config

func (*Config) Validate added in v0.3.0

func (c *Config) Validate() error

Validate checks values and return an error if any validation failed.

type CosmosConfig added in v0.13.0

type CosmosConfig struct {
	Path        string
	ChainID     string
	GenesisTime time.Time

	GenesisAccount struct {
		Name     string
		Password string
		Mnemonic string
	}

	ValidatorPubKey PubKeyEd25519
}

CosmosConfig is the struct to hold cosmos related configs.

type PubKeyEd25519 added in v0.13.0

type PubKeyEd25519 ed25519.PubKeyEd25519

PubKeyEd25519 is type used to parse value provided by envconfig.

func (*PubKeyEd25519) Decode added in v0.13.0

func (key *PubKeyEd25519) Decode(value string) error

Decode parses string value as hex ed25519 key.

type ServiceConfig added in v0.11.0

type ServiceConfig struct {
	Key        string
	Env        map[string]string
	Definition *service.Service
	Instance   *instance.Instance
}

ServiceConfig contains information related to services that the config knows about

Jump to

Keyboard shortcuts

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