config

package
v0.0.98 Latest Latest
Warning

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

Go to latest
Published: Jan 22, 2025 License: Apache-2.0 Imports: 13 Imported by: 0

Documentation

Index

Constants

View Source
const (
	EventTypeKey                  = "event_type"
	EventTypeAndAttributeValueKey = "event_type_and_attribute_value"
	RegexEventTypeKey             = "regex_event_type"
	RollingWindowKey              = "rolling_window"
	MessageTypeKey                = "message_type"
	MessageTypeRegex              = "message_type_regex"
)

Variables

View Source
var MessageTypeFilterKeys = []string{
	MessageTypeKey,
	MessageTypeRegex,
}

Functions

func CheckSuperfluousIndexKeys

func CheckSuperfluousIndexKeys(keys []string) []string

func DoConfigureLogger

func DoConfigureLogger(logPath string, logLevel string, prettyLogging bool)

func ParseJSONFilterConfigFromType

func ParseJSONFilterConfigFromType(filterType string, configJSON []byte) (filter.BlockEventFilter, error)

func ParseLifecycleConfig

func ParseLifecycleConfig(lifecycleConfig []json.RawMessage) ([]filter.BlockEventFilter, []filter.RollingWindowBlockEventFilter, error)

func ParseTXMessageTypeConfig

func ParseTXMessageTypeConfig(messageTypeConfigs []json.RawMessage) ([]filter.MessageTypeFilter, error)

func SetChainConfig

func SetChainConfig(prefix string)

SetChainConfig Set the chain prefix e.g. juno (prefix for account addresses).

func SetupDatabaseFlags

func SetupDatabaseFlags(databaseConf *Database, cmd *cobra.Command)

func SetupIndexSpecificFlags

func SetupIndexSpecificFlags(conf *IndexConfig, cmd *cobra.Command)

func SetupLogFlags

func SetupLogFlags(logConf *log, cmd *cobra.Command)

func SetupMongoDBFlags

func SetupMongoDBFlags(mongoConf *MongoConf, cmd *cobra.Command)

func SetupProbeFlags

func SetupProbeFlags(probeConf *Probe, cmd *cobra.Command)

func SetupRedisFlags

func SetupRedisFlags(redisConf *RedisConf, cmd *cobra.Command)

func SetupServerFlags

func SetupServerFlags(serverConf *Server, cmd *cobra.Command)

func SetupThrottlingFlag

func SetupThrottlingFlag(throttlingValue *float64, cmd *cobra.Command)

func SingleBlockEventFilterIncludes

func SingleBlockEventFilterIncludes(val string) bool

Types

type BlockEventFilterConfig

type BlockEventFilterConfig struct {
	Type       string            `json:"type"`
	Subfilters []json.RawMessage `json:"subfilters"`
	Inclusive  bool              `json:"inclusive"`
}

type Database

type Database struct {
	Host     string
	Port     string
	Database string
	User     string
	Password string
	LogLevel string `mapstructure:"log-level"`
}

type IndexBase added in v0.0.91

type IndexBase struct {
	RetryBase
	Mode                       string    `mapstructure:"mode"`
	ModeTopics                 *[]string `mapstructure:"mode-storage-topics"`
	ModeCoolDownMins           int       `mapstructure:"mode-cooldown-mins"`
	ModeCoolDownCount          int       `mapstructure:"mode-cooldown-count"`
	ModeBlocksStep             int64     `mapstructure:"mode-blocks-step"`
	ReindexMessageType         string    `mapstructure:"reindex-message-type"`
	ReattemptFailedBlocks      bool      `mapstructure:"reattempt-failed-blocks"`
	StartBlock                 int64     `mapstructure:"start-block"`
	EndBlock                   int64     `mapstructure:"end-block"`
	BlockInputFile             string    `mapstructure:"block-input-file"`
	ReIndex                    bool      `mapstructure:"reindex"`
	RPCWorkers                 int64     `mapstructure:"rpc-workers"`
	BlockTimer                 int64     `mapstructure:"block-timer"`
	WaitForChain               bool      `mapstructure:"wait-for-chain"`
	WaitForChainDelay          int64     `mapstructure:"wait-for-chain-delay"`
	TransactionIndexingEnabled bool      `mapstructure:"index-transactions"`
	ExitWhenCaughtUp           bool      `mapstructure:"exit-when-caught-up"`
	FilterFile                 string    `mapstructure:"filter-file"`
	// contains filtered or unexported fields
}

type IndexConfig

type IndexConfig struct {
	Database           Database
	ConfigFileLocation string
	Base               IndexBase
	Log                log
	Probe              Probe
	Flags              flags
	Server             Server
	RedisConf          RedisConf
	MongoConf          MongoConf
}

func (*IndexConfig) Validate

func (conf *IndexConfig) Validate() error

type Logger

type Logger struct{}
var Log *Logger

Log is exposed on the config as a drop-in replacement for our old logger

func (*Logger) Debug

func (l *Logger) Debug(msg string, err ...error)

These functions are provided to reduce refactoring.

func (*Logger) Debugf

func (l *Logger) Debugf(msg string, args ...interface{})

func (*Logger) Error

func (l *Logger) Error(msg string, err ...error)

func (*Logger) Errorf

func (l *Logger) Errorf(msg string, args ...interface{})

func (*Logger) Fatal

func (l *Logger) Fatal(msg string, err ...error)

func (*Logger) Fatalf

func (l *Logger) Fatalf(msg string, args ...interface{})

func (*Logger) Info

func (l *Logger) Info(msg string, err ...error)

func (*Logger) Infof

func (l *Logger) Infof(msg string, args ...interface{})

func (*Logger) Panic

func (l *Logger) Panic(msg string, err ...error)

func (*Logger) Panicf

func (l *Logger) Panicf(msg string, args ...interface{})

func (*Logger) Warn

func (l *Logger) Warn(msg string, err ...error)

func (*Logger) Warnf

func (l *Logger) Warnf(msg string, args ...interface{})

func (*Logger) ZDeubg

func (l *Logger) ZDeubg() *zerolog.Event

func (*Logger) ZInfo

func (l *Logger) ZInfo() *zerolog.Event

type MessageTypeFilterConfig

type MessageTypeFilterConfig struct {
	Type    string `json:"type"`
	Pattern string `json:"pattern"`
}

type MongoConf

type MongoConf struct {
	MongoAddr string
	MongoDB   string
}

type Probe

type Probe struct {
	RPC           string
	AccountPrefix string `mapstructure:"account-prefix"`
	ChainID       string `mapstructure:"chain-id"`
	ChainName     string `mapstructure:"chain-name"`
}

type RedisConf

type RedisConf struct {
	RedisAddr string
	RedisPsw  string
}

type RetryBase added in v0.0.91

type RetryBase struct {
	RequestRetryAttempts int64  `mapstructure:"request-retry-attempts"`
	RequestRetryMaxWait  uint64 `mapstructure:"request-retry-max-wait"`
}

type Server

type Server struct {
	Port int
}

Jump to

Keyboard shortcuts

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