configs

package
v0.0.1 Latest Latest
Warning

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

Go to latest
Published: Nov 1, 2023 License: MIT Imports: 10 Imported by: 0

Documentation

Index

Constants

View Source
const (
	PARSER_SAME_HEIGHT_TOLERANCE = 3
)

Variables

This section is empty.

Functions

This section is empty.

Types

type AggregatorConfig

type AggregatorConfig struct {
	ChainId    string
	PriceToken string
	StartTs    time.Time // e.g. 2006-01-02 15:04:05
	CleanDups  bool
	SrcDb      RdbConfig
	DestDb     RdbConfig
	Router     RouterConfig
}

type CollectorConfig

type CollectorConfig struct {
	ChainId                    string
	PairFactoryContractAddress string
	NodeConfig                 NodeConfig
}

type Config

type Config struct {
	Aggregator AggregatorConfig
	Collector  CollectorConfig
	Parser     ParserConfig
	Log        LogConfig
	Sentry     SentryConfig
	Rdb        RdbConfig
	S3         S3Config
}

Config aggregation

func Get

func Get() Config

Get returns Config object

func New

func New() Config

Init is explicit initializer for Config

func NewWithFileName

func NewWithFileName(fileName string) Config

type Duration

type Duration struct {
	time.Duration
}

Duration is wrapper type for custom unmarshalling

type GrpcConfig

type GrpcConfig struct {
	Host            string
	Port            int
	BackoffMaxDelay Duration
	NoTLS           bool
}

type LogConfig

type LogConfig struct {
	// Log level for the global `Logger`
	Level logrus.Level
	// Should log-messages be printed as JSON?
	FormatJSON bool
	// The environment the service is currently running in, e.g. local/development/staging
	Environment string
	ChainId     string
}

type NodeConfig

type NodeConfig struct {
	GrpcConfig      GrpcConfig
	FailoverLcdHost string
}

type ParserConfig

type ParserConfig struct {
	ChainId             string
	TargetApp           rules.RuleType
	SameHeightTolerance uint
	ErrTolerance        uint

	NodeConfig *NodeConfig
}

type RdbConfig

type RdbConfig struct {
	Host     string
	Port     int
	Database string
	Username string
	Password string
}

db contains configs for other services

func (RdbConfig) Endpoint

func (c RdbConfig) Endpoint() string

type RouterConfig

type RouterConfig struct {
	Name       string `json:"name"`
	RouterAddr string `json:"router_addr"`
	MaxPathLen uint   `json:"max_path_len"`
	WriteDb    bool   `json:"write_db"`
}

type S3Config

type S3Config struct {
	Bucket string
	Region string
	Key    string
	Secret string
}

type SentryConfig

type SentryConfig struct {
	DSN string
}

Jump to

Keyboard shortcuts

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