config

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

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

Go to latest
Published: Aug 2, 2021 License: Apache-2.0 Imports: 3 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Config

type Config struct {
	Node   NodeConfig   `mapstructure:"node"`
	DB     DBConfig     `mapstructure:"database"`
	Web    WebConfig    `mapstructure:"web"`
	Market MarketConfig `mapstructure:"market"`
}

Config wraps all config.

func ParseConfig

func ParseConfig() *Config

ParseConfig attempts to read and parse config.yaml from the given path An error reading or parsing the config results in a panic.

type DBConfig

type DBConfig struct {
	Host     string `mapstructure:"host"`
	Port     string `mapstructure:"port"`
	User     string `mapstructure:"user"`
	Password string `mapstructure:"password"`
	Database string `mapstructure:"dbname"`
}

DBConfig wraps all required parameters for database connection.

type MarketConfig

type MarketConfig struct {
	CoinGeckoEndpoint string `mapstructure:"coingecko_endpoint"`
}

MarketConfig wraps all required params for market endpoints.

type NodeConfig

type NodeConfig struct {
	RPCNode             string `mapstructure:"rpc_node"`
	ExchangeAPIEndpoint string `mapstructure:"exchange_api_endpoint"`
	ChainID             string `mapstructure:"chain_id"`
}

NodeConfig wraps all node endpoints that are used in this project.

type WebConfig

type WebConfig struct {
	Port string `mapstructure:"port"`
}

WebConfig wraps all required paramaters for boostraping web server.

Jump to

Keyboard shortcuts

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