utils

package
v0.1.1 Latest Latest
Warning

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

Go to latest
Published: Mar 15, 2023 License: MIT Imports: 8 Imported by: 1

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Load

func Load(path string, config interface{}) error

Load reads in a file at the specified path and unmarshals the values into your config struct.

func LoadFromEnv

func LoadFromEnv(config interface{}, keys ...string) error

Load from env names given in keys

func NewTendermintClient

func NewTendermintClient(baseURL string) (*tmclient.HTTP, error)

Types

type DBConfig

type DBConfig struct {
	DBHost         string `mapstructure:"DB_HOST"`
	DBPort         uint   `mapstructure:"DB_PORT"`
	DBUser         string `mapstructure:"DB_USER"`
	DBPass         string `mapstructure:"DB_PASS"`
	DBName         string `mapstructure:"DB_NAME"`
	DBSSLMode      string `mapstructure:"DB_SSL_MODE"`
	DBPoolMaxConns int    `mapstructure:"DB_POOL_MAX_CONNS"`
	DBPoolMinConns int    `mapstructure:"DB_POOL_MIN_CONNS"`
}

func ReadDBConfig

func ReadDBConfig(envPath string) *DBConfig

Jump to

Keyboard shortcuts

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