parse

package
v0.1.1 Latest Latest
Warning

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

Go to latest
Published: Oct 8, 2021 License: CC0-1.0 Imports: 23 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ParseCmd

func ParseCmd(cmdCfg *Config) *cobra.Command

ParseCmd returns the command that should be run when we want to start parsing a chain state.

func ReadConfig

func ReadConfig(cfg *Config) types.CobraCmdFunc

ReadConfig parses the configuration file for the executable having the give name using the provided configuration parser

func StartParsing

func StartParsing(ctx *Context) error

StartParsing represents the function that should be called when the parse command is executed

func StartPrometheus

func StartPrometheus()

StartPrometheus allows to start a Telemetry server used to expose useful metrics

Types

type Config

type Config struct {
	// contains filtered or unexported fields
}

Config contains all the configuration for the "parse" command

func NewConfig

func NewConfig() *Config

NewConfig allows to build a new Config instance

func (*Config) GetConfigParser

func (config *Config) GetConfigParser() types.ConfigParser

GetConfigParser returns the configuration parser to be used

func (*Config) GetDBBuilder

func (config *Config) GetDBBuilder() db.Builder

GetDBBuilder returns the database builder to be used

func (*Config) GetEncodingConfigBuilder

func (config *Config) GetEncodingConfigBuilder() types.EncodingConfigBuilder

GetEncodingConfigBuilder returns the encoding config builder to be used

func (*Config) GetLogger

func (config *Config) GetLogger() logging.Logger

GetLogger returns the logger to be used when parsing the data

func (*Config) GetRegistrar

func (config *Config) GetRegistrar() registrar.Registrar

GetRegistrar returns the modules registrar to be used

func (*Config) GetSetupConfig

func (config *Config) GetSetupConfig() types.SdkConfigSetup

GetSetupConfig returns the SDK configuration builder to use

func (*Config) WithConfigParser

func (config *Config) WithConfigParser(p types.ConfigParser) *Config

WithConfigParser sets the configuration parser to be used

func (*Config) WithDBBuilder

func (config *Config) WithDBBuilder(b db.Builder) *Config

WithDBBuilder sets the database builder to be used

func (*Config) WithEncodingConfigBuilder

func (config *Config) WithEncodingConfigBuilder(b types.EncodingConfigBuilder) *Config

WithEncodingConfigBuilder sets the configurations builder to be used

func (*Config) WithLogger

func (config *Config) WithLogger(logger logging.Logger) *Config

WithLogger sets the logger to be used while parsing the data

func (*Config) WithRegistrar

func (config *Config) WithRegistrar(r registrar.Registrar) *Config

WithRegistrar sets the modules registrar to be used

func (*Config) WithSetupConfig

func (config *Config) WithSetupConfig(s types.SdkConfigSetup) *Config

WithSetupConfig sets the SDK setup configurator to be used

type Context

type Context struct {
	EncodingConfig *params.EncodingConfig
	Proxy          *client.Proxy
	Database       db.Database
	Logger         logging.Logger
	Modules        []modules.Module
}

Context contains the parsing context

func GetParsingContext

func GetParsingContext(parseConfig *Config) (*Context, error)

GetParsingContext setups all the things that should be later passed to StartParsing in order to parse the chain data properly.

func NewContext

func NewContext(
	encodingConfig *params.EncodingConfig, proxy *client.Proxy, db db.Database,
	logger logging.Logger, modules []modules.Module,
) *Context

NewContext builds a new Context instance

Jump to

Keyboard shortcuts

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