config

package
v0.7.3 Latest Latest
Warning

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

Go to latest
Published: Nov 26, 2024 License: GPL-3.0 Imports: 15 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func BindPFlag

func BindPFlag(key string, flag *pflag.Flag)

BindPFlag binds a specific key to a pflag (as used by cobra). Example (where serverCmd is a Cobra instance):

serverCmd.Flags().Int("port", 1138, "Port to run Application server on")
Viper.BindPFlag("port", serverCmd.Flags().Lookup("port"))

func SetDefault

func SetDefault(key string, value any)

SetDefault sets the default value for this key. SetDefault is case-insensitive for a key. Default only used when no value is provided by the user via flag, config or ENV.

Types

type BitcoinNodeClient

type BitcoinNodeClient struct {
	Host       string `mapstructure:"host"`
	User       string `mapstructure:"user"`
	Pass       string `mapstructure:"pass"`
	DisableTLS bool   `mapstructure:"disable_tls"`
}

type Config

type Config struct {
	EnableModules []string               `mapstructure:"enable_modules"`
	APIOnly       bool                   `mapstructure:"api_only"`
	Logger        logger.Config          `mapstructure:"logger"`
	BitcoinNode   BitcoinNodeClient      `mapstructure:"bitcoin_node"`
	Network       common.Network         `mapstructure:"network"`
	HTTPServer    HTTPServerConfig       `mapstructure:"http_server"`
	Modules       Modules                `mapstructure:"modules"`
	Reporting     reportingclient.Config `mapstructure:"reporting"`
}

func Load

func Load() Config

Load returns the loaded configuration

func Parse

func Parse(configFile ...string) Config

Parse parse the configuration from environment variables

type HTTPServerConfig

type HTTPServerConfig struct {
	Port      int                               `mapstructure:"port"`
	Logger    requestlogger.Config              `mapstructure:"logger"`
	RequestIP requestcontext.WithClientIPConfig `mapstructure:"requestip"`
}

type Modules

type Modules struct {
	Runes    runesconfig.Config    `mapstructure:"runes"`
	NodeSale nodesaleconfig.Config `mapstructure:"nodesale"`
}

Jump to

Keyboard shortcuts

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