config

package
v1.0.0 Latest Latest
Warning

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

Go to latest
Published: Feb 26, 2024 License: AGPL-3.0 Imports: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type AWSSecretManagerConfig

type AWSSecretManagerConfig struct {
	Region     string `mapstructure:"region"`
	SecretName string `mapstructure:"secret_name"`
}

type Config

type Config struct {
	ChainID          string        `mapstructure:"chain_id"`
	MerkleRoot       string        `mapstructure:"merkle_root"`
	Logger           LoggerConfig  `mapstructure:"logger"`
	HTTP             HTTPConfig    `mapstructure:"http"`
	Metrics          MetricsConfig `mapstructure:"metrics"`
	Secret           SecretConfig  `mapstructure:"secret"`
	Store            StoreConfig   `mapstructure:"store"`
	AccountWhiteList []string      `mapstructure:"account_white_list"`
}

func NewConfig

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

type HTTPConfig

type HTTPConfig struct {
	Addr              string        `mapstructure:"addr"`
	Port              uint16        `mapstructure:"port"`
	ReadTimeout       time.Duration `mapstructure:"read_timeout"`
	ReadHeaderTimeout time.Duration `mapstructure:"read_header_timeout"`
	WriteTimeout      time.Duration `mapstructure:"write_timeout"`
	IdleTimeout       time.Duration `mapstructure:"idle_timeout"`
	MaxHeaderBytes    int           `mapstructure:"max_header_bytes"`
}

type LocalSecretConfig

type LocalSecretConfig struct {
	PrivateKey string `mapstructure:"private_key"`
}

type LoggerConfig

type LoggerConfig struct {
	Level  string           `mapstructure:"level"`
	Format logger.LogFormat `mapstructure:"format"`
}

type MemoryStoreConfig

type MemoryStoreConfig struct {
	MerkleProofs string `mapstructure:"merkle_proofs"`
}

type MetricsConfig

type MetricsConfig struct {
	Enable            bool          `mapstructure:"enable"`
	PProf             bool          `mapstructure:"pprof"`
	Path              string        `mapstructure:"path"`
	Addr              string        `mapstructure:"addr"`
	Port              uint16        `mapstructure:"port"`
	ReadTimeout       time.Duration `mapstructure:"read_timeout"`
	ReadHeaderTimeout time.Duration `mapstructure:"read_header_timeout"`
	WriteTimeout      time.Duration `mapstructure:"write_timeout"`
	IdleTimeout       time.Duration `mapstructure:"idle_timeout"`
	MaxHeaderBytes    int           `mapstructure:"max_header_bytes"`
}

type SQLStoreConfig

type SQLStoreConfig struct {
	SQLDriver      string        `mapstructure:"sql_driver"`
	Host           string        `mapstructure:"host"`
	Port           uint          `mapstructure:"port"`
	DBName         string        `mapstructure:"dbname"`
	User           string        `mapstructure:"user"`
	Password       string        `mapstructure:"password"`
	ConnectTimeout string        `mapstructure:"connect_timeout"`
	ReadTimeout    string        `mapstructure:"read_timeout"`
	WriteTimeout   string        `mapstructure:"write_timeout"`
	DialTimeout    time.Duration `mapstructure:"dial_timeout"`
	MaxLifetime    time.Duration `mapstructure:"max_lifetime"`
	MaxIdleTime    time.Duration `mapstructure:"max_idletime"`
	MaxIdleConn    int           `mapstructure:"max_idle_conn"`
	MaxOpenConn    int           `mapstructure:"max_open_conn"`
	SSLMode        bool          `mapstructure:"ssl_mode"`
	LogLevel       int           `mapstructure:"log_level"`
}

type SecretConfig

type SecretConfig struct {
	Type                   string                 `mapstructure:"type"`
	LocalSecretConfig      LocalSecretConfig      `mapstructure:"local_secret"`
	AWSSecretManagerConfig AWSSecretManagerConfig `mapstructure:"aws_secret_manager"`
}

type StoreConfig

type StoreConfig struct {
	Driver      string            `mapstructure:"driver"`
	MemoryStore MemoryStoreConfig `mapstructure:"memory_store"`
	SqlStore    SQLStoreConfig    `mapstructure:"sql_store"`
}

Jump to

Keyboard shortcuts

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