config

package
v0.0.0-...-bb0bcea Latest Latest
Warning

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

Go to latest
Published: Dec 5, 2025 License: MIT Imports: 12 Imported by: 0

Documentation

Index

Constants

View Source
const (
	P2CEWMAName = "p2cewma"
	RRName      = "round-robin"
	LCName      = "least-connection"
)

Variables

This section is empty.

Functions

This section is empty.

Types

type Client

type Client struct {
	Login    string `yaml:"login"`
	Password string `yaml:"password"`
}

type Clients

type Clients struct {
	AuthRequired bool     `yaml:"auth_required"` // only for basic type of auth.
	Type         string   `yaml:"type"`
	Clients      []Client `yaml:"clients"`
}

type Config

type Config struct {
	GlobalRPCConfig `yaml:",inline"`

	Clients Clients `yaml:"clients"`
	Logger  Logger  `yaml:"logger"`
	Metrics Metrics `yaml:"metrics"`
	RPCs    []RPC   `yaml:"rpcs"`
	Port    int64   `yaml:"port"`
}

func ParseConfig

func ParseConfig(path string) (Config, error)

type GlobalRPCConfig

type GlobalRPCConfig struct {
	BalancerType    string        `yaml:"balancer_type"`
	NoRPCValidation bool          `yaml:"no_rpc_validation"`
	P2CEWMA         P2CEWMAConfig `yaml:"p2cewma"`
}

type Logger

type Logger struct {
	Level   zerolog.Level `yaml:"level"`
	Format  string        `yaml:"format"`
	Writer  string        `yaml:"writer"`
	NoColor bool          `yaml:"no_color"`
}

type Metrics

type Metrics struct {
	Enabled bool   `yaml:"enabled"`
	Port    int64  `yaml:"port"`
	Path    string `yaml:"path"`
}

type P2CEWMAConfig

type P2CEWMAConfig struct {
	Smooth          float64       `yaml:"smooth"`
	LoadNormalizer  float64       `yaml:"load_normalizer"`
	PenaltyDecay    float64       `yaml:"penalty_decay"`
	CooldownTimeout time.Duration `yaml:"cooldown_timeout"`
}

type Provider

type Provider struct {
	Name    string `yaml:"name"`
	ConnURL string `yaml:"conn_url"`
}

type RPC

type RPC struct {
	GlobalRPCConfig `yaml:",inline"`

	Name      string     `yaml:"name"`
	ChainID   int64      `yaml:"chain_id"`
	Providers []Provider `yaml:"providers"`
}

Jump to

Keyboard shortcuts

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