config

package
v0.0.0-...-8dfb25f Latest Latest
Warning

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

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

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	DefaultConfigPath = "./config.toml"
)

Functions

This section is empty.

Types

type Config

type Config struct {
	RPC  *RPCConfig  `toml:"rpc"`
	GRPC *GRPCConfig `toml:"grpc"`
	LCD  *LCDConfig  `toml:"lcd"`
}

Config defines all necessary configuration parameters.

func NewConfig

func NewConfig(rpc *RPCConfig, gRPC *GRPCConfig, lcd *LCDConfig) *Config

NewConfig builds a new Config instance.

func ParseString

func ParseString(configData []byte) (*Config, error)

ParseString attempts to read and parse config from the given string bytes. An error reading or parsing the config results in a panic.

func Read

func Read(configPath string) (*Config, error)

SetupConfig takes the path to a configuration file and returns the properly parsed configuration.

type GRPCConfig

type GRPCConfig struct {
	Address string `toml:"address"`
}

GRPCConfig contains the configuration of the gRPC endpoint.

type LCDConfig

type LCDConfig struct {
	Address string `toml:"address"`
}

LCDConfig contains the configuration of the REST server endpoint.

type RPCConfig

type RPCConfig struct {
	Address string `toml:"address"`
}

RPCConfig contains the configuration of the RPC endpoint.

Jump to

Keyboard shortcuts

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