config

package
v0.0.0-...-15db94f Latest Latest
Warning

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

Go to latest
Published: Sep 17, 2024 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 SetupProbeFlags

func SetupProbeFlags(probeConf *Probe, 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 IndexConfig

type IndexConfig struct {
	Database Database
	Base     indexBase
	Log      log
	Probe    Probe
	Flags    flags
}

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) Warn

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

func (*Logger) Warnf

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

type MessageTypeFilterConfig

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

type Probe

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

Jump to

Keyboard shortcuts

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