interception

package
v1.1.1-rc Latest Latest
Warning

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

Go to latest
Published: May 1, 2020 License: MIT Imports: 2 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Network

type Network interface {
	BroadcastChannelFor(name string) (net.BroadcastChannel, error)
}

Network is the local test network implementation capable of intercepting network messages and modifying/dropping them based on rules passed to the network.

func NewNetwork

func NewNetwork(
	provider net.Provider,
	rules Rules,
) Network

NewNetwork creates a new instance of Network interface implementation with message filtering rules passed as a parameter.

type Rules

type Rules = func(msg net.TaggedMarshaler) net.TaggedMarshaler

Rules defines the rules of intercepting network messages. Messages can be returned unmodified, they may be modified on the fly and they can be dropped by returning nil.

Jump to

Keyboard shortcuts

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