util

package
v0.1.38 Latest Latest
Warning

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

Go to latest
Published: Nov 22, 2023 License: AGPL-3.0 Imports: 11 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func GetBlockRange

func GetBlockRange(ctx context.Context, from, to uint64, c *ethrpc.Client) ([]*json.RawMessage, error)

func GetBlockRangeInPages added in v0.1.35

func GetBlockRangeInPages(ctx context.Context, from, to, pageSize uint64, c *ethrpc.Client) ([]*json.RawMessage, error)

func GetReceipts

func GetReceipts(ctx context.Context, rawBlocks []*json.RawMessage, c *ethrpc.Client, batchSize uint64) ([]*json.RawMessage, error)

func GetTxPoolSize added in v0.1.35

func GetTxPoolSize(rpc *ethrpc.Client) (uint64, error)

func SetLogLevel added in v0.1.37

func SetLogLevel(verbosity int)

SetLogLevel sets the log level based on the flags. https://logging.apache.org/log4j/2.x/manual/customloglevels.html

func SetLogMode added in v0.1.37

func SetLogMode(mode LogMode) error

SetLogMode updates the log format.

func ValidateUrl added in v0.1.35

func ValidateUrl(input string) error

ValidateUrl checks if a string URL can be parsed and if it has a valid scheme.

Types

type LogMode added in v0.1.37

type LogMode string

LogMode represents the logger mode.

const (
	Console LogMode = "console"
	JSON    LogMode = "json"
)

type VerbosityLevel added in v0.1.37

type VerbosityLevel int

VerbosityLevel represents the verbosity levels. https://pkg.go.dev/github.com/rs/zerolog#readme-leveled-logging

const (
	Silent VerbosityLevel = 0
	Panic  VerbosityLevel = 100
	Fatal  VerbosityLevel = 200
	Error  VerbosityLevel = 300
	Warn   VerbosityLevel = 400
	Info   VerbosityLevel = 500
	Debug  VerbosityLevel = 600
	Trace  VerbosityLevel = 700
)

Jump to

Keyboard shortcuts

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