Documentation ¶
Index ¶
- func NewWhiteListDataVerifier(cacher storage.Cacher) (*whiteListDataVerifier, error)
- type MultiDataInterceptor
- func (mdi *MultiDataInterceptor) IsInterfaceNil() bool
- func (mdi *MultiDataInterceptor) ProcessReceivedMessage(message p2p.MessageP2P, fromConnectedPeer core.PeerID) error
- func (mdi *MultiDataInterceptor) RegisterHandler(handler func(topic string, hash []byte, data interface{}))
- func (mdi *MultiDataInterceptor) SetInterceptedDebugHandler(handler process.InterceptedDebugger) error
- type SingleDataInterceptor
- func (sdi *SingleDataInterceptor) IsInterfaceNil() bool
- func (sdi *SingleDataInterceptor) ProcessReceivedMessage(message p2p.MessageP2P, fromConnectedPeer core.PeerID) error
- func (sdi *SingleDataInterceptor) RegisterHandler(handler func(topic string, hash []byte, data interface{}))
- func (sdi *SingleDataInterceptor) SetInterceptedDebugHandler(handler process.InterceptedDebugger) error
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func NewWhiteListDataVerifier ¶ added in v1.0.102
NewWhiteListDataVerifier returns a default data verifier
Types ¶
type MultiDataInterceptor ¶
type MultiDataInterceptor struct {
// contains filtered or unexported fields
}
MultiDataInterceptor is used for intercepting packed multi data
func NewMultiDataInterceptor ¶
func NewMultiDataInterceptor( topic string, marshalizer marshal.Marshalizer, factory process.InterceptedDataFactory, processor process.InterceptorProcessor, throttler process.InterceptorThrottler, antifloodHandler process.P2PAntifloodHandler, whiteListRequest process.WhiteListHandler, ) (*MultiDataInterceptor, error)
NewMultiDataInterceptor hooks a new interceptor for packed multi data
func (*MultiDataInterceptor) IsInterfaceNil ¶
func (mdi *MultiDataInterceptor) IsInterfaceNil() bool
IsInterfaceNil returns true if there is no value under the interface
func (*MultiDataInterceptor) ProcessReceivedMessage ¶
func (mdi *MultiDataInterceptor) ProcessReceivedMessage(message p2p.MessageP2P, fromConnectedPeer core.PeerID) error
ProcessReceivedMessage is the callback func from the p2p.Messenger and will be called each time a new message was received (for the topic this validator was registered to)
func (*MultiDataInterceptor) RegisterHandler ¶ added in v1.0.133
func (mdi *MultiDataInterceptor) RegisterHandler(handler func(topic string, hash []byte, data interface{}))
RegisterHandler registers a callback function to be notified on received data
func (*MultiDataInterceptor) SetInterceptedDebugHandler ¶ added in v1.0.110
func (mdi *MultiDataInterceptor) SetInterceptedDebugHandler(handler process.InterceptedDebugger) error
SetInterceptedDebugHandler will set a new intercepted debug handler
type SingleDataInterceptor ¶
type SingleDataInterceptor struct {
// contains filtered or unexported fields
}
SingleDataInterceptor is used for intercepting packed multi data
func NewSingleDataInterceptor ¶
func NewSingleDataInterceptor( topic string, factory process.InterceptedDataFactory, processor process.InterceptorProcessor, throttler process.InterceptorThrottler, antifloodHandler process.P2PAntifloodHandler, whiteListRequested process.WhiteListHandler, ) (*SingleDataInterceptor, error)
NewSingleDataInterceptor hooks a new interceptor for single data
func (*SingleDataInterceptor) IsInterfaceNil ¶
func (sdi *SingleDataInterceptor) IsInterfaceNil() bool
IsInterfaceNil returns true if there is no value under the interface
func (*SingleDataInterceptor) ProcessReceivedMessage ¶
func (sdi *SingleDataInterceptor) ProcessReceivedMessage(message p2p.MessageP2P, fromConnectedPeer core.PeerID) error
ProcessReceivedMessage is the callback func from the p2p.Messenger and will be called each time a new message was received (for the topic this validator was registered to)
func (*SingleDataInterceptor) RegisterHandler ¶ added in v1.0.133
func (sdi *SingleDataInterceptor) RegisterHandler(handler func(topic string, hash []byte, data interface{}))
RegisterHandler registers a callback function to be notified on received data
func (*SingleDataInterceptor) SetInterceptedDebugHandler ¶ added in v1.0.110
func (sdi *SingleDataInterceptor) SetInterceptedDebugHandler(handler process.InterceptedDebugger) error
SetInterceptedDebugHandler will set a new intercepted debug handler