config

package
v0.0.0-...-26dab60 Latest Latest
Warning

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

Go to latest
Published: Oct 14, 2020 License: Apache-2.0 Imports: 4 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 {
	IndexerCfg IndexerConfig  `toml:"indexer"`
	NodeCfg    NodeConfig     `toml:"tendermint_node"`
	DBCfg      DatabaseConfig `toml:"database"`
}

func GetConfig

func GetConfig() Config

func ReadConfig

func ReadConfig(configPath string) Config

ReadConfig attempts to read and parse a config file at the given configPath. An error reading or parsing the config results in a panic.

func (*Config) DBConnectString

func (c *Config) DBConnectString() string

DBConnectString returns the connection string given a idxdb config

func (*Config) GetIndexerConfig

func (c *Config) GetIndexerConfig() IndexerConfig

func (*Config) GetNodeConfig

func (c *Config) GetNodeConfig() (rpc, lcd string)

type DatabaseConfig

type DatabaseConfig struct {
	Host     string `toml:"db_host"`
	Port     uint64 `toml:"db_port"`
	Name     string `toml:"db_name"`
	User     string `toml:"db_user"`
	Password string `toml:"db_password"`
	SSLMode  string `toml:"db_ssl_mode"`
	MaxConns int32  `toml:"db_max_connections"`
}

type IndexerConfig

type IndexerConfig struct {
	SyncHeight int64 `toml:"sync_height"`
	Threads    int64 `toml:"num_threads"`
}

type NodeConfig

type NodeConfig struct {
	NodeRPC string `toml:"node_rpc"`
	NodeLCD string `toml:"node_lcd"`
}

Jump to

Keyboard shortcuts

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