config

package
v0.0.0-...-0334a0b Latest Latest
Warning

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

Go to latest
Published: Oct 20, 2024 License: MIT 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 {
	Server `yaml:"server"`
	HTTP   `yaml:"http"`
	Logger `yaml:"logger"`
	Redis
	EthNode `yaml:"eth_node"`
	RMQ
}

func NewConfig

func NewConfig(configPath, envPath string) (*Config, error)

NewConfig returns app config.

func NewDefaultConfig

func NewDefaultConfig() (*Config, error)

type EthNode

type EthNode struct {
	HttpURL string `env-required:"true" env:"ETH_HTTP_NODE_RPC"`
	WsURL   string `env-required:"true" env:"ETH_WS_NODE_RPC"`
	ApiKey  string `env:"ETH_RPC_KEY"`
	Network string `yaml:"network_type"`
}

type HTTP

type HTTP struct {
	Port string `env-required:"false" yaml:"port"`
}

type Logger

type Logger struct {
	File string `env-required:"false" yaml:"file" env:"LOG_FILE"`
}

type RMQ

type RMQ struct {
	URL string `env-required:"true" env:"RMQ_URL"`
}

type Redis

type Redis struct {
	URL string `env-required:"true" env:"REDIS_URL"`
}

type Server

type Server struct {
	Name        string `yaml:"name"`
	Version     string `yaml:"version"`
	Stage       string `yaml:"stage"`
	WorkerCount int    `yaml:"worker_count"`
}

Jump to

Keyboard shortcuts

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