Help us shape the future of Go! Take the 2026 Go Developer Survey

mockp2p

package
v0.29.13 Latest Latest
Warning

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

Go to latest
Published: Feb 21, 2023 License: AGPL-3.0 Imports: 20 Imported by: 1

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type ConnectionGater added in v0.29.0

type ConnectionGater struct {
	mock.Mock
}

ConnectionGater is an autogenerated mock type for the ConnectionGater type

func NewConnectionGater added in v0.29.0

func NewConnectionGater(t mockConstructorTestingTNewConnectionGater) *ConnectionGater

NewConnectionGater creates a new instance of ConnectionGater. It also registers a testing interface on the mock and a cleanup function to assert the mocks expectations.

func (*ConnectionGater) InterceptAccept added in v0.29.0

func (_m *ConnectionGater) InterceptAccept(_a0 network.ConnMultiaddrs) bool

InterceptAccept provides a mock function with given fields: _a0

func (*ConnectionGater) InterceptAddrDial added in v0.29.0

func (_m *ConnectionGater) InterceptAddrDial(_a0 peer.ID, _a1 multiaddr.Multiaddr) bool

InterceptAddrDial provides a mock function with given fields: _a0, _a1

func (*ConnectionGater) InterceptPeerDial added in v0.29.0

func (_m *ConnectionGater) InterceptPeerDial(p peer.ID) bool

InterceptPeerDial provides a mock function with given fields: p

func (*ConnectionGater) InterceptSecured added in v0.29.0

func (_m *ConnectionGater) InterceptSecured(_a0 network.Direction, _a1 peer.ID, _a2 network.ConnMultiaddrs) bool

InterceptSecured provides a mock function with given fields: _a0, _a1, _a2

func (*ConnectionGater) InterceptUpgraded added in v0.29.0

func (_m *ConnectionGater) InterceptUpgraded(_a0 network.Conn) (bool, control.DisconnectReason)

InterceptUpgraded provides a mock function with given fields: _a0

type Connector

type Connector struct {
	mock.Mock
}

Connector is an autogenerated mock type for the Connector type

func NewConnector

func NewConnector(t mockConstructorTestingTNewConnector) *Connector

NewConnector creates a new instance of Connector. It also registers a testing interface on the mock and a cleanup function to assert the mocks expectations.

func (*Connector) UpdatePeers

func (_m *Connector) UpdatePeers(ctx context.Context, peerIDs peer.IDSlice)

UpdatePeers provides a mock function with given fields: ctx, peerIDs

type GetTimeNow added in v0.29.0

type GetTimeNow struct {
	mock.Mock
}

GetTimeNow is an autogenerated mock type for the GetTimeNow type

func NewGetTimeNow added in v0.29.0

func NewGetTimeNow(t mockConstructorTestingTNewGetTimeNow) *GetTimeNow

NewGetTimeNow creates a new instance of GetTimeNow. It also registers a testing interface on the mock and a cleanup function to assert the mocks expectations.

func (*GetTimeNow) Execute added in v0.29.0

func (_m *GetTimeNow) Execute() time.Time

Execute provides a mock function with given fields:

type IDTranslator

type IDTranslator struct {
	mock.Mock
}

IDTranslator is an autogenerated mock type for the IDTranslator type

func NewIDTranslator

func NewIDTranslator(t mockConstructorTestingTNewIDTranslator) *IDTranslator

NewIDTranslator creates a new instance of IDTranslator. It also registers a testing interface on the mock and a cleanup function to assert the mocks expectations.

func (*IDTranslator) GetFlowID

func (_m *IDTranslator) GetFlowID(_a0 peer.ID) (flow.Identifier, error)

GetFlowID provides a mock function with given fields: _a0

func (*IDTranslator) GetPeerID

func (_m *IDTranslator) GetPeerID(_a0 flow.Identifier) (peer.ID, error)

GetPeerID provides a mock function with given fields: _a0

type LibP2PNode added in v0.29.0

type LibP2PNode struct {
	mock.Mock
}

LibP2PNode is an autogenerated mock type for the LibP2PNode type

func NewLibP2PNode added in v0.29.0

func NewLibP2PNode(t mockConstructorTestingTNewLibP2PNode) *LibP2PNode

NewLibP2PNode creates a new instance of LibP2PNode. It also registers a testing interface on the mock and a cleanup function to assert the mocks expectations.

func (*LibP2PNode) AddPeer added in v0.29.0

func (_m *LibP2PNode) AddPeer(ctx context.Context, peerInfo peer.AddrInfo) error

AddPeer provides a mock function with given fields: ctx, peerInfo

func (*LibP2PNode) CreateStream added in v0.29.0

func (_m *LibP2PNode) CreateStream(ctx context.Context, peerID peer.ID) (network.Stream, error)

CreateStream provides a mock function with given fields: ctx, peerID

func (*LibP2PNode) Done added in v0.29.0

func (_m *LibP2PNode) Done() <-chan struct{}

Done provides a mock function with given fields:

func (*LibP2PNode) GetIPPort added in v0.29.0

func (_m *LibP2PNode) GetIPPort() (string, string, error)

GetIPPort provides a mock function with given fields:

func (*LibP2PNode) GetPeersForProtocol added in v0.29.0

func (_m *LibP2PNode) GetPeersForProtocol(pid protocol.ID) peer.IDSlice

GetPeersForProtocol provides a mock function with given fields: pid

func (*LibP2PNode) HasSubscription added in v0.29.0

func (_m *LibP2PNode) HasSubscription(topic channels.Topic) bool

HasSubscription provides a mock function with given fields: topic

func (*LibP2PNode) Host added in v0.29.0

func (_m *LibP2PNode) Host() host.Host

Host provides a mock function with given fields:

func (*LibP2PNode) IsConnected added in v0.29.0

func (_m *LibP2PNode) IsConnected(peerID peer.ID) (bool, error)

IsConnected provides a mock function with given fields: peerID

func (*LibP2PNode) ListPeers added in v0.29.0

func (_m *LibP2PNode) ListPeers(topic string) []peer.ID

ListPeers provides a mock function with given fields: topic

func (*LibP2PNode) PeerManagerComponent added in v0.29.0

func (_m *LibP2PNode) PeerManagerComponent() component.Component

PeerManagerComponent provides a mock function with given fields:

func (*LibP2PNode) Publish added in v0.29.0

func (_m *LibP2PNode) Publish(ctx context.Context, topic channels.Topic, data []byte) error

Publish provides a mock function with given fields: ctx, topic, data

func (*LibP2PNode) Ready added in v0.29.0

func (_m *LibP2PNode) Ready() <-chan struct{}

Ready provides a mock function with given fields:

func (*LibP2PNode) RemovePeer added in v0.29.0

func (_m *LibP2PNode) RemovePeer(peerID peer.ID) error

RemovePeer provides a mock function with given fields: peerID

func (*LibP2PNode) RequestPeerUpdate added in v0.29.0

func (_m *LibP2PNode) RequestPeerUpdate()

RequestPeerUpdate provides a mock function with given fields:

func (*LibP2PNode) Routing added in v0.29.0

func (_m *LibP2PNode) Routing() routing.Routing

Routing provides a mock function with given fields:

func (*LibP2PNode) RoutingTable added in v0.29.0

func (_m *LibP2PNode) RoutingTable() *kbucket.RoutingTable

RoutingTable provides a mock function with given fields:

func (*LibP2PNode) SetComponentManager added in v0.29.0

func (_m *LibP2PNode) SetComponentManager(cm *component.ComponentManager)

SetComponentManager provides a mock function with given fields: cm

func (*LibP2PNode) SetPubSub added in v0.29.0

func (_m *LibP2PNode) SetPubSub(ps p2p.PubSubAdapter)

SetPubSub provides a mock function with given fields: ps

func (*LibP2PNode) SetRouting added in v0.29.0

func (_m *LibP2PNode) SetRouting(r routing.Routing)

SetRouting provides a mock function with given fields: r

func (*LibP2PNode) Start added in v0.29.0

func (_m *LibP2PNode) Start(ctx irrecoverable.SignalerContext)

Start provides a mock function with given fields: ctx

func (*LibP2PNode) Stop added in v0.29.0

func (_m *LibP2PNode) Stop() error

Stop provides a mock function with given fields:

func (*LibP2PNode) Subscribe added in v0.29.0

func (_m *LibP2PNode) Subscribe(topic channels.Topic, topicValidator p2p.TopicValidatorFunc) (p2p.Subscription, error)

Subscribe provides a mock function with given fields: topic, topicValidator

func (*LibP2PNode) UnSubscribe added in v0.29.0

func (_m *LibP2PNode) UnSubscribe(topic channels.Topic) error

UnSubscribe provides a mock function with given fields: topic

func (*LibP2PNode) WithDefaultUnicastProtocol added in v0.29.0

func (_m *LibP2PNode) WithDefaultUnicastProtocol(defaultHandler network.StreamHandler, preferred []unicast.ProtocolName) error

WithDefaultUnicastProtocol provides a mock function with given fields: defaultHandler, preferred

func (*LibP2PNode) WithPeersProvider added in v0.29.0

func (_m *LibP2PNode) WithPeersProvider(peersProvider p2p.PeersProvider)

WithPeersProvider provides a mock function with given fields: peersProvider

type NetworkOptFunction

type NetworkOptFunction struct {
	mock.Mock
}

NetworkOptFunction is an autogenerated mock type for the NetworkOptFunction type

func NewNetworkOptFunction

func NewNetworkOptFunction(t mockConstructorTestingTNewNetworkOptFunction) *NetworkOptFunction

NewNetworkOptFunction creates a new instance of NetworkOptFunction. It also registers a testing interface on the mock and a cleanup function to assert the mocks expectations.

func (*NetworkOptFunction) Execute

func (_m *NetworkOptFunction) Execute(_a0 *p2p.Network)

Execute provides a mock function with given fields: _a0

type PeerFilter

type PeerFilter struct {
	mock.Mock
}

PeerFilter is an autogenerated mock type for the PeerFilter type

func NewPeerFilter

func NewPeerFilter(t mockConstructorTestingTNewPeerFilter) *PeerFilter

NewPeerFilter creates a new instance of PeerFilter. It also registers a testing interface on the mock and a cleanup function to assert the mocks expectations.

func (*PeerFilter) Execute

func (_m *PeerFilter) Execute(_a0 peer.ID) error

Execute provides a mock function with given fields: _a0

type PeerManager

type PeerManager struct {
	mock.Mock
}

PeerManager is an autogenerated mock type for the PeerManager type

func NewPeerManager

func NewPeerManager(t mockConstructorTestingTNewPeerManager) *PeerManager

NewPeerManager creates a new instance of PeerManager. It also registers a testing interface on the mock and a cleanup function to assert the mocks expectations.

func (*PeerManager) Done

func (_m *PeerManager) Done() <-chan struct{}

Done provides a mock function with given fields:

func (*PeerManager) ForceUpdatePeers

func (_m *PeerManager) ForceUpdatePeers(_a0 context.Context)

ForceUpdatePeers provides a mock function with given fields: _a0

func (*PeerManager) Ready

func (_m *PeerManager) Ready() <-chan struct{}

Ready provides a mock function with given fields:

func (*PeerManager) RequestPeerUpdate

func (_m *PeerManager) RequestPeerUpdate()

RequestPeerUpdate provides a mock function with given fields:

func (*PeerManager) SetPeersProvider

func (_m *PeerManager) SetPeersProvider(_a0 p2p.PeersProvider)

SetPeersProvider provides a mock function with given fields: _a0

func (*PeerManager) Start

func (_m *PeerManager) Start(_a0 irrecoverable.SignalerContext)

Start provides a mock function with given fields: _a0

type PeerManagerFactoryFunc

type PeerManagerFactoryFunc struct {
	mock.Mock
}

PeerManagerFactoryFunc is an autogenerated mock type for the PeerManagerFactoryFunc type

func NewPeerManagerFactoryFunc

func NewPeerManagerFactoryFunc(t mockConstructorTestingTNewPeerManagerFactoryFunc) *PeerManagerFactoryFunc

NewPeerManagerFactoryFunc creates a new instance of PeerManagerFactoryFunc. It also registers a testing interface on the mock and a cleanup function to assert the mocks expectations.

func (*PeerManagerFactoryFunc) Execute

func (_m *PeerManagerFactoryFunc) Execute(_a0 host.Host, peersProvider p2p.PeersProvider, logger zerolog.Logger) (p2p.PeerManager, error)

Execute provides a mock function with given fields: _a0, peersProvider, logger

type PeersProvider

type PeersProvider struct {
	mock.Mock
}

PeersProvider is an autogenerated mock type for the PeersProvider type

func NewPeersProvider

func NewPeersProvider(t mockConstructorTestingTNewPeersProvider) *PeersProvider

NewPeersProvider creates a new instance of PeersProvider. It also registers a testing interface on the mock and a cleanup function to assert the mocks expectations.

func (*PeersProvider) Execute

func (_m *PeersProvider) Execute() peer.IDSlice

Execute provides a mock function with given fields:

type PubSubAdapter added in v0.29.0

type PubSubAdapter struct {
	mock.Mock
}

PubSubAdapter is an autogenerated mock type for the PubSubAdapter type

func NewPubSubAdapter added in v0.29.0

func NewPubSubAdapter(t mockConstructorTestingTNewPubSubAdapter) *PubSubAdapter

NewPubSubAdapter creates a new instance of PubSubAdapter. It also registers a testing interface on the mock and a cleanup function to assert the mocks expectations.

func (*PubSubAdapter) GetTopics added in v0.29.0

func (_m *PubSubAdapter) GetTopics() []string

GetTopics provides a mock function with given fields:

func (*PubSubAdapter) Join added in v0.29.0

func (_m *PubSubAdapter) Join(topic string) (p2p.Topic, error)

Join provides a mock function with given fields: topic

func (*PubSubAdapter) ListPeers added in v0.29.0

func (_m *PubSubAdapter) ListPeers(topic string) []peer.ID

ListPeers provides a mock function with given fields: topic

func (*PubSubAdapter) RegisterTopicValidator added in v0.29.0

func (_m *PubSubAdapter) RegisterTopicValidator(topic string, topicValidator p2p.TopicValidatorFunc) error

RegisterTopicValidator provides a mock function with given fields: topic, topicValidator

func (*PubSubAdapter) UnregisterTopicValidator added in v0.29.0

func (_m *PubSubAdapter) UnregisterTopicValidator(topic string) error

UnregisterTopicValidator provides a mock function with given fields: topic

type PubSubAdapterConfig added in v0.29.0

type PubSubAdapterConfig struct {
	mock.Mock
}

PubSubAdapterConfig is an autogenerated mock type for the PubSubAdapterConfig type

func NewPubSubAdapterConfig added in v0.29.0

func NewPubSubAdapterConfig(t mockConstructorTestingTNewPubSubAdapterConfig) *PubSubAdapterConfig

NewPubSubAdapterConfig creates a new instance of PubSubAdapterConfig. It also registers a testing interface on the mock and a cleanup function to assert the mocks expectations.

func (*PubSubAdapterConfig) WithAppSpecificRpcInspector added in v0.29.0

func (_m *PubSubAdapterConfig) WithAppSpecificRpcInspector(f func(peer.ID, *pubsub.RPC) error)

WithAppSpecificRpcInspector provides a mock function with given fields: f

func (*PubSubAdapterConfig) WithMessageIdFunction added in v0.29.0

func (_m *PubSubAdapterConfig) WithMessageIdFunction(f func([]byte) string)

WithMessageIdFunction provides a mock function with given fields: f

func (*PubSubAdapterConfig) WithRoutingDiscovery added in v0.29.0

func (_m *PubSubAdapterConfig) WithRoutingDiscovery(_a0 routing.ContentRouting)

WithRoutingDiscovery provides a mock function with given fields: _a0

func (*PubSubAdapterConfig) WithScoreOption added in v0.29.0

func (_m *PubSubAdapterConfig) WithScoreOption(_a0 p2p.ScoreOptionBuilder)

WithScoreOption provides a mock function with given fields: _a0

func (*PubSubAdapterConfig) WithSubscriptionFilter added in v0.29.0

func (_m *PubSubAdapterConfig) WithSubscriptionFilter(_a0 p2p.SubscriptionFilter)

WithSubscriptionFilter provides a mock function with given fields: _a0

type RateLimiter added in v0.29.0

type RateLimiter struct {
	mock.Mock
}

RateLimiter is an autogenerated mock type for the RateLimiter type

func NewRateLimiter added in v0.29.0

func NewRateLimiter(t mockConstructorTestingTNewRateLimiter) *RateLimiter

NewRateLimiter creates a new instance of RateLimiter. It also registers a testing interface on the mock and a cleanup function to assert the mocks expectations.

func (*RateLimiter) Allow added in v0.29.0

func (_m *RateLimiter) Allow(peerID peer.ID, msgSize int) bool

Allow provides a mock function with given fields: peerID, msgSize

func (*RateLimiter) IsRateLimited added in v0.29.0

func (_m *RateLimiter) IsRateLimited(peerID peer.ID) bool

IsRateLimited provides a mock function with given fields: peerID

func (*RateLimiter) SetTimeNowFunc added in v0.29.0

func (_m *RateLimiter) SetTimeNowFunc(now p2p.GetTimeNow)

SetTimeNowFunc provides a mock function with given fields: now

func (*RateLimiter) Start added in v0.29.0

func (_m *RateLimiter) Start()

Start provides a mock function with given fields:

func (*RateLimiter) Stop added in v0.29.0

func (_m *RateLimiter) Stop()

Stop provides a mock function with given fields:

type RateLimiterOpt added in v0.29.0

type RateLimiterOpt struct {
	mock.Mock
}

RateLimiterOpt is an autogenerated mock type for the RateLimiterOpt type

func NewRateLimiterOpt added in v0.29.0

func NewRateLimiterOpt(t mockConstructorTestingTNewRateLimiterOpt) *RateLimiterOpt

NewRateLimiterOpt creates a new instance of RateLimiterOpt. It also registers a testing interface on the mock and a cleanup function to assert the mocks expectations.

func (*RateLimiterOpt) Execute added in v0.29.0

func (_m *RateLimiterOpt) Execute(limiter p2p.RateLimiter)

Execute provides a mock function with given fields: limiter

type ScoreOption added in v0.29.0

type ScoreOption struct {
	mock.Mock
}

ScoreOption is an autogenerated mock type for the ScoreOption type

func NewScoreOption added in v0.29.0

func NewScoreOption(t mockConstructorTestingTNewScoreOption) *ScoreOption

NewScoreOption creates a new instance of ScoreOption. It also registers a testing interface on the mock and a cleanup function to assert the mocks expectations.

func (*ScoreOption) BuildFlowPubSubScoreOption added in v0.29.0

func (_m *ScoreOption) BuildFlowPubSubScoreOption() pubsub.Option

BuildFlowPubSubScoreOption provides a mock function with given fields:

type ScoreOptionBuilder added in v0.29.0

type ScoreOptionBuilder struct {
	mock.Mock
}

ScoreOptionBuilder is an autogenerated mock type for the ScoreOptionBuilder type

func NewScoreOptionBuilder added in v0.29.0

func NewScoreOptionBuilder(t mockConstructorTestingTNewScoreOptionBuilder) *ScoreOptionBuilder

NewScoreOptionBuilder creates a new instance of ScoreOptionBuilder. It also registers a testing interface on the mock and a cleanup function to assert the mocks expectations.

func (*ScoreOptionBuilder) BuildFlowPubSubScoreOption added in v0.29.0

func (_m *ScoreOptionBuilder) BuildFlowPubSubScoreOption() pubsub.Option

BuildFlowPubSubScoreOption provides a mock function with given fields:

type Subscription added in v0.29.0

type Subscription struct {
	mock.Mock
}

Subscription is an autogenerated mock type for the Subscription type

func NewSubscription added in v0.29.0

func NewSubscription(t mockConstructorTestingTNewSubscription) *Subscription

NewSubscription creates a new instance of Subscription. It also registers a testing interface on the mock and a cleanup function to assert the mocks expectations.

func (*Subscription) Cancel added in v0.29.0

func (_m *Subscription) Cancel()

Cancel provides a mock function with given fields:

func (*Subscription) Next added in v0.29.0

func (_m *Subscription) Next(_a0 context.Context) (*pubsub.Message, error)

Next provides a mock function with given fields: _a0

func (*Subscription) Topic added in v0.29.0

func (_m *Subscription) Topic() string

Topic provides a mock function with given fields:

type SubscriptionFilter added in v0.29.0

type SubscriptionFilter struct {
	mock.Mock
}

SubscriptionFilter is an autogenerated mock type for the SubscriptionFilter type

func NewSubscriptionFilter added in v0.29.0

func NewSubscriptionFilter(t mockConstructorTestingTNewSubscriptionFilter) *SubscriptionFilter

NewSubscriptionFilter creates a new instance of SubscriptionFilter. It also registers a testing interface on the mock and a cleanup function to assert the mocks expectations.

func (*SubscriptionFilter) CanSubscribe added in v0.29.0

func (_m *SubscriptionFilter) CanSubscribe(_a0 string) bool

CanSubscribe provides a mock function with given fields: _a0

func (*SubscriptionFilter) FilterIncomingSubscriptions added in v0.29.0

func (_m *SubscriptionFilter) FilterIncomingSubscriptions(_a0 peer.ID, _a1 []*pubsub_pb.RPC_SubOpts) ([]*pubsub_pb.RPC_SubOpts, error)

FilterIncomingSubscriptions provides a mock function with given fields: _a0, _a1

type SubscriptionProvider

type SubscriptionProvider struct {
	mock.Mock
}

SubscriptionProvider is an autogenerated mock type for the SubscriptionProvider type

func NewSubscriptionProvider

func NewSubscriptionProvider(t mockConstructorTestingTNewSubscriptionProvider) *SubscriptionProvider

NewSubscriptionProvider creates a new instance of SubscriptionProvider. It also registers a testing interface on the mock and a cleanup function to assert the mocks expectations.

func (*SubscriptionProvider) GetSubscribedTopics

func (_m *SubscriptionProvider) GetSubscribedTopics(pid peer.ID) []string

GetSubscribedTopics provides a mock function with given fields: pid

type Topic added in v0.29.0

type Topic struct {
	mock.Mock
}

Topic is an autogenerated mock type for the Topic type

func NewTopic added in v0.29.0

func NewTopic(t mockConstructorTestingTNewTopic) *Topic

NewTopic creates a new instance of Topic. It also registers a testing interface on the mock and a cleanup function to assert the mocks expectations.

func (*Topic) Close added in v0.29.0

func (_m *Topic) Close() error

Close provides a mock function with given fields:

func (*Topic) Publish added in v0.29.0

func (_m *Topic) Publish(_a0 context.Context, _a1 []byte) error

Publish provides a mock function with given fields: _a0, _a1

func (*Topic) String added in v0.29.0

func (_m *Topic) String() string

String provides a mock function with given fields:

func (*Topic) Subscribe added in v0.29.0

func (_m *Topic) Subscribe() (p2p.Subscription, error)

Subscribe provides a mock function with given fields:

type TopicProvider

type TopicProvider struct {
	mock.Mock
}

TopicProvider is an autogenerated mock type for the TopicProvider type

func NewTopicProvider

func NewTopicProvider(t mockConstructorTestingTNewTopicProvider) *TopicProvider

NewTopicProvider creates a new instance of TopicProvider. It also registers a testing interface on the mock and a cleanup function to assert the mocks expectations.

func (*TopicProvider) GetTopics

func (_m *TopicProvider) GetTopics() []string

GetTopics provides a mock function with given fields:

func (*TopicProvider) ListPeers

func (_m *TopicProvider) ListPeers(topic string) []peer.ID

ListPeers provides a mock function with given fields: topic

type TopicValidatorFunc added in v0.29.0

type TopicValidatorFunc struct {
	mock.Mock
}

TopicValidatorFunc is an autogenerated mock type for the TopicValidatorFunc type

func NewTopicValidatorFunc added in v0.29.0

func NewTopicValidatorFunc(t mockConstructorTestingTNewTopicValidatorFunc) *TopicValidatorFunc

NewTopicValidatorFunc creates a new instance of TopicValidatorFunc. It also registers a testing interface on the mock and a cleanup function to assert the mocks expectations.

func (*TopicValidatorFunc) Execute added in v0.29.0

Execute provides a mock function with given fields: _a0, _a1, _a2

Jump to

Keyboard shortcuts

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