validator

package
v0.24.3 Latest Latest
Warning

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

Go to latest
Published: Feb 5, 2022 License: AGPL-3.0 Imports: 8 Imported by: 1

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func TopicValidator

func TopicValidator(validators ...MessageValidator) pubsub.ValidatorEx

Types

type MessageValidator

type MessageValidator func(ctx context.Context, from peer.ID, msg *message.Message) pubsub.ValidationResult

MessageValidator validates the given message with original sender `from`. Note: contrarily to pubsub.ValidatorEx, the peerID parameter does not represent the bearer of the message, but its source.

func StakedValidator

func StakedValidator(getIdentity func(peer.ID) (*flow.Identity, bool)) MessageValidator

type ValidatorData

type ValidatorData struct {
	Message *message.Message
	From    peer.ID
}

Jump to

Keyboard shortcuts

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