validator

package
v0.14.13 Latest Latest
Warning

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

Go to latest
Published: May 8, 2021 License: AGPL-3.0 Imports: 5 Imported by: 3

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type SenderValidator

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

SenderValidator validates messages by sender ID

func NewSenderValidator

func NewSenderValidator(sender flow.Identifier) *SenderValidator

NewSenderValidator creates and returns a new SenderValidator for the given sender ID

func (*SenderValidator) Validate

func (sv *SenderValidator) Validate(msg message.Message) bool

Validate returns true if the message origin id is different from the sender ID.

type TargetValidator

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

TargetValidator filters out messages by target ID

func NewTargetValidator

func NewTargetValidator(log zerolog.Logger, target flow.Identifier) *TargetValidator

NewTargetValidator returns a new TargetValidator for the given target id

func (*TargetValidator) Validate

func (tv *TargetValidator) Validate(msg message.Message) bool

Validate returns true if the message is intended for the given target ID else it returns false

Jump to

Keyboard shortcuts

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