config

package
v0.0.2 Latest Latest
Warning

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

Go to latest
Published: Jul 4, 2024 License: MIT Imports: 9 Imported by: 0

Documentation

Index

Constants

View Source
const (
	EnvPrefix = "ROBOT"
)

Variables

This section is empty.

Functions

This section is empty.

Types

type BatchLimits

type BatchLimits struct {
	BatchBlocksCountLimit uint          `mapstructure:"batchBlocksCountLimit"`
	BatchLenLimit         uint          `mapstructure:"batchLenLimit"`
	BatchSizeLimit        uint          `mapstructure:"batchSizeLimit"`
	BatchTimeoutLimit     time.Duration `mapstructure:"batchTimeoutLimit"`
}

type Config

type Config struct {
	LogLevel string `mapstructure:"logLevel" validate:"required"`
	LogType  string `mapstructure:"logType" validate:"required"`

	ServerPort uint `mapstructure:"serverPort"`

	ProfilePath string `mapstructure:"profilePath" validate:"required"`
	UserName    string `mapstructure:"userName" validate:"required"`

	TxSwapPrefix           string        `mapstructure:"txSwapPrefix" validate:"required"`
	TxMultiSwapPrefix      string        `mapstructure:"txMultiSwapPrefix" validate:"required"`
	TxPreimagePrefix       string        `mapstructure:"txPreimagePrefix" validate:"required"`
	DelayAfterChRobotError time.Duration `mapstructure:"delayAfterChRobotError"`

	DefaultBatchLimits *BatchLimits `mapstructure:"defaultBatchLimits"`

	RedisStorage *RedisStorage `mapstructure:"redisStor" validate:"required"`

	PromMetrics *PromMetrics `mapstructure:"promMetrics"`

	DefaultRobotExecOpts ExecuteOptions `mapstructure:"defaultRobotExecOpts" validate:"dive"`
	Robots               []*Robot       `mapstructure:"robots" validate:"dive"`
}

func GetConfig

func GetConfig() (*Config, error)

func (Config) WithoutSensitiveData

func (c Config) WithoutSensitiveData() Config

WithoutSensitiveData returns copy of config with empty sensitive data. This config might be used for trace logging.

type ExecuteOptions

type ExecuteOptions struct {
	ExecuteTimeout *time.Duration `mapstructure:"executeTimeout"`
}

func (ExecuteOptions) EffExecuteTimeout

func (eo ExecuteOptions) EffExecuteTimeout(defOpts ExecuteOptions) (time.Duration, error)

type PromMetrics

type PromMetrics struct {
	PrefixForMetrics string `mapstructure:"prefix"`
}

type RedisStorage

type RedisStorage struct {
	DBPrefix string   `mapstructure:"dbPrefix"`
	Addr     []string `mapstructure:"addr"`
	Password string   `mapstructure:"password"`
	WithTLS  bool     `mapstructure:"withTLS"`
	RootCAs  []string `mapstructure:"rootCAs"`
}

type Robot

type Robot struct {
	ChName              string         `mapstructure:"chName" validate:"required"`
	InitMinExecBlockNum uint64         `mapstructure:"initExecBlockNum"`
	SrcChannels         []*SrcChannel  `mapstructure:"src" validate:"dive"`
	BatchLimits         *BatchLimits   `mapstructure:"batchLimits"`
	CollectorsBufSize   uint           `mapstructure:"collectorsBufSize"`
	ExecOpts            ExecuteOptions `mapstructure:"execOpts" validate:"dive"`
}

type SrcChannel

type SrcChannel struct {
	ChName       string  `mapstructure:"chName" validate:"required"`
	InitBlockNum *uint64 `mapstructure:"initBlockNum" validate:"required"`
}

Jump to

Keyboard shortcuts

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