Documentation ¶
Index ¶
- func IpLookupFixture(count int) map[string]*IpLookupTestCase
- func NetIPAddrFixture() net.IPAddr
- func TxtIPFixture() string
- func TxtLookupFixture(count int) map[string]*TxtLookupTestCase
- type Conduit
- type Engine
- type EngineProcessFunc
- type IpLookupTestCase
- type Network
- type PublishFunc
- type TxtLookupTestCase
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func IpLookupFixture ¶ added in v0.23.9
func IpLookupFixture(count int) map[string]*IpLookupTestCase
func NetIPAddrFixture ¶ added in v0.23.9
func TxtIPFixture ¶ added in v0.23.9
func TxtIPFixture() string
func TxtLookupFixture ¶ added in v0.23.9
func TxtLookupFixture(count int) map[string]*TxtLookupTestCase
Types ¶
type Conduit ¶
type Conduit struct { mocknetwork.Conduit // contains filtered or unexported fields }
func (*Conduit) Publish ¶
func (c *Conduit) Publish(event interface{}, targetIDs ...flow.Identifier) error
Publish sends a message on this mock network, invoking any callback that has been specified. This will panic if no callback is found.
func (*Conduit) ReportMisbehavior ¶ added in v0.31.0
func (c *Conduit) ReportMisbehavior(_ network.MisbehaviorReport)
ReportMisbehavior reports the misbehavior of a node on sending a message to the current node that appears valid based on the networking layer but is considered invalid by the current node based on the Flow protocol. This method is a no-op in the test helper implementation.
type Engine ¶
type Engine struct {
mocknetwork.Engine
}
Engine represents a mock engine. The implementation is not concurrency-safe.
func (*Engine) OnProcess ¶
func (e *Engine) OnProcess(processFunc EngineProcessFunc) *Engine
OnProcess specifies the callback that should be executed when `Process` is called on this mock engine.
type EngineProcessFunc ¶
type EngineProcessFunc func(channels.Channel, flow.Identifier, interface{}) error
type IpLookupTestCase ¶ added in v0.23.9
func IpLookupListFixture ¶ added in v0.23.9
func IpLookupListFixture(count int) []*IpLookupTestCase
type Network ¶
type Network struct { mocknetwork.Network // contains filtered or unexported fields }
Network represents a mock network. The implementation is not concurrency-safe.
func (*Network) OnPublish ¶
func (n *Network) OnPublish(publishFunc PublishFunc) *Network
OnPublish specifies the callback that should be executed when `Publish` is called on any conduits created by this mock network.
type PublishFunc ¶ added in v0.31.0
type PublishFunc func(channels.Channel, interface{}, ...flow.Identifier) error
type TxtLookupTestCase ¶ added in v0.23.9
func TxtLookupListFixture ¶ added in v0.23.9
func TxtLookupListFixture(count int) []*TxtLookupTestCase