configs

package
v2.0.0-...-d626aa2 Latest Latest
Warning

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

Go to latest
Published: Mar 6, 2026 License: GPL-3.0 Imports: 9 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type App

type App struct {
	LogLevel zerolog.Level `yaml:"log_level" envconfig:"LOG_LEVEL" default:"info"`
}

type ChainConfig

type ChainConfig struct {
	Driver entities.Driver `yaml:"driver"`
	Type   entities.Type   `yaml:"type"`
	ISO    entities.Ticker `yaml:"iso"`
	Chain  entities.Chain  `yaml:"chain"`

	Persist PersistConfig `yaml:"persist"`
	Scan    ScanConfig    `yaml:"scan"`

	Workers WorkersConfig `yaml:"workers"`

	RPC RPCConfig `yaml:"rpc"`

	Topics TopicsConfig `yaml:"topics"`
}

type ChainsConfig

type ChainsConfig []ChainConfig

type Config

type Config struct {
	App    App          `yaml:"app" envconfig:"APP"`
	Chains ChainsConfig `yaml:"chains"`
	DB     DBConfig     `yaml:"db" envconfig:"DB"`
	Redis  RedisConfig  `yaml:"redis" envconfig:"REDIS"`

	HTTP    HTTPConfig `yaml:"http" envconfig:"HTTP" default:"8080"`
	Metrics HTTPConfig `yaml:"metrics" envconfig:"METRICS" default:"9100"`
}

func Load

func Load(prefix string) (Config, error)

type DBConfig

type DBConfig struct {
	Driver   string `yaml:"driver" envconfig:"DRIVER" default:"postgres"`
	Host     string `yaml:"host" envconfig:"HOST"`
	Port     string `yaml:"port" envconfig:"PORT"`
	Database string `yaml:"database" envconfig:"DATABASE"`
	User     string `yaml:"user" envconfig:"USER"`
	Password string `yaml:"password" envconfig:"PASSWORD"`
}

func (*DBConfig) ToDSN

func (d *DBConfig) ToDSN() string

type HTTPConfig

type HTTPConfig struct {
	Port         string        `yaml:"ports" envconfig:"PORTS"`
	ReadTimeout  time.Duration `yaml:"read_timeout" envconfig:"READ_TIMEOUT"`
	WriteTimeout time.Duration `yaml:"write_timeout" envconfig:"WRITE_TIMEOUT"`
}

type PersistConfig

type PersistConfig struct {
	Capacity int           `yaml:"capacity"`
	Interval time.Duration `yaml:"interval"`
}

type RPCConfig

type RPCConfig struct {
	NodeURL string `yaml:"node_url"`
}

type RedisConfig

type RedisConfig struct {
	Host string `yaml:"host" envconfig:"HOST"`
	Port string `yaml:"port" envconfig:"PORT"`
	DB   int    `yaml:"db" envconfig:"DB"`
}

func (RedisConfig) ToConfig

func (r RedisConfig) ToConfig(appName string) *redis.Options

type ScanConfig

type ScanConfig struct {
	Depth    int           `yaml:"depth"`
	Interval time.Duration `yaml:"interval"`
}

type TopicsConfig

type TopicsConfig struct {
	Transactions string `yaml:"transactions"`
	Blocks       string `yaml:"blocks"`
}

type WorkersConfig

type WorkersConfig struct {
	TxIDWorkerCount              uint `default:"3" yaml:"txid_worker_count"`
	BlockTransactionsWorkerCount uint `default:"5" yaml:"block_transactions_worker_count"`
}

Jump to

Keyboard shortcuts

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