Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Handler ¶
type Handler func(channelID string, request *gproto.AppDataRequest, responder Responder)
Handler handles an application data request
type HandlerRegistry ¶
type HandlerRegistry struct {
// contains filtered or unexported fields
}
HandlerRegistry manages handlers for application-specific Gossip messages
func NewHandlerRegistry ¶
func NewHandlerRegistry() *HandlerRegistry
NewHandlerRegistry returns a new HandlerRegistry
func (*HandlerRegistry) HandlerForType ¶
func (p *HandlerRegistry) HandlerForType(dataType string) (Handler, bool)
HandlerForType returns the handler for the given data type
type Option ¶ added in v0.1.5
type Option func(options *options)
Option is a retriever option
func WithPeerFilter ¶ added in v0.1.5
func WithPeerFilter(filter PeerFilter) Option
WithPeerFilter sets a peer filter
type PeerFilter ¶ added in v0.1.5
type PeerFilter = func(*extdiscovery.Member) bool
PeerFilter returns true to include the peer in the Gossip request
type Request ¶
Request contains an application data request
func NewRequest ¶
NewRequest returns a new application data request
type Responder ¶ added in v0.1.6
type Responder interface {
Respond(data []byte)
}
Responder responds to data requests
type ResponseHandler ¶
ResponseHandler handles the response to retrieved data
type Retriever ¶
type Retriever struct { *extdiscovery.Discovery // contains filtered or unexported fields }
Retriever retrieves data from one or more peers on a channel
func NewRetriever ¶
func NewRetriever(channelID string, gossip gossipService, gossipMaxAttempts, gossipMaxPeers int) *Retriever
NewRetriever returns a new application data retriever