logs_catcher

package
v0.0.0-...-2315559 Latest Latest
Warning

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

Go to latest
Published: Dec 5, 2024 License: GPL-3.0 Imports: 15 Imported by: 0

Documentation

Index

Constants

View Source
const MesasgeKey = "msg" // todo: pass to struct/load from config

Variables

This section is empty.

Functions

func DetermineLeader

func DetermineLeader(dutySlot phase0.Slot, committee []*types.CommitteeMember) types.OperatorID

func EqualFunc

func EqualFunc(val any) func(s string) bool

func FatalListener

func FatalListener(ctx context.Context, logger *zap.Logger, cli DockerCLI) error

func Match

func Match(pctx context.Context, logger *zap.Logger, cli DockerCLI) error

func ParseAndExtractDutyInfo

func ParseAndExtractDutyInfo(conditionLog string, corruptedValidatorIndex string) (string, phase0.Slot, error)

func ProcessLogs

func ProcessLogs(ctx context.Context, logger *zap.Logger, cli DockerCLI, committee []*types.CommitteeMember, leader types.OperatorID, dutyID string, dutySlot phase0.Slot, corruptedOperator types.OperatorID) error

func StartCondition

func StartCondition(pctx context.Context, logger *zap.Logger, condition []string, targetContainer string, cli DockerCLI) (string, error)

func VerifyBLSSignature

func VerifyBLSSignature(pctx context.Context, logger *zap.Logger, cli DockerCLI, share *CorruptedShare) error

Types

type CorruptedShare

type CorruptedShare struct {
	ValidatorIndex  uint64           `json:"validator_index"`
	ValidatorPubKey string           `json:"validator_pub_key"`
	OperatorID      types.OperatorID `json:"operator_id"`
}

type DockerCLI

type DockerCLI interface {
	docker.Streamer
	docker.Lister
}

type Feeder

type Feeder interface {
	Feed(orig string, fed map[string]any)
}

type KeyValue

type KeyValue struct {
	Key   string
	Value any
}

func KV

func KV(key string, value any) KeyValue

type LogCatcher

type LogCatcher struct {
	Name       string
	LogMessage string
	Fields     map[string]func(string) bool // key-value checker
	// contains filtered or unexported fields
}

func NewLogAction

func NewLogAction(logger *zap.Logger, name string, action func(string), kvs ...KeyValue) *LogCatcher

func (*LogCatcher) Action

func (lc *LogCatcher) Action(logEntry string)

func (*LogCatcher) AddFieldCondition

func (lc *LogCatcher) AddFieldCondition(key string, finder func(string) bool)

func (*LogCatcher) Feed

func (lc *LogCatcher) Feed(orig string, fed map[string]any)

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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