Documentation ¶
Index ¶
- func NewConsensusNetwork(address, nodeID string, shortID core.ShortNodeID, ...) (network.ConsensusNetwork, error)
- func NewHostTransport(transport network.InternalTransport, resolver network.RoutingTable) network.HostNetwork
- func NewInternalTransport(conf configuration.Configuration, nodeRef string) (network.InternalTransport, error)
- type Builder
- func (b *Builder) Build() network.Request
- func (b *Builder) Data(data interface{}) network.RequestBuilder
- func (b *Builder) GetData() interface{}
- func (b *Builder) GetRequestID() network.RequestID
- func (b *Builder) GetSender() core.RecordRef
- func (b *Builder) GetSenderHost() *host.Host
- func (b *Builder) GetType() types.PacketType
- func (b *Builder) Type(packetType types.PacketType) network.RequestBuilder
- type TransportResolvable
- func (tr *TransportResolvable) BuildResponse(ctx context.Context, request network.Request, responseData interface{}) network.Response
- func (tr *TransportResolvable) GetNodeID() core.RecordRef
- func (tr *TransportResolvable) NewRequestBuilder() network.RequestBuilder
- func (tr *TransportResolvable) PublicAddress() string
- func (tr *TransportResolvable) RegisterRequestHandler(t types.PacketType, handler network.RequestHandler)
- func (tr *TransportResolvable) SendRequest(ctx context.Context, request network.Request, receiver core.RecordRef) (network.Future, error)
- func (tr *TransportResolvable) Start(ctx context.Context)
- func (tr *TransportResolvable) Stop()
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func NewConsensusNetwork ¶ added in v0.6.3
func NewConsensusNetwork(address, nodeID string, shortID core.ShortNodeID, resolver network.RoutingTable) (network.ConsensusNetwork, error)
func NewHostTransport ¶ added in v0.6.2
func NewHostTransport(transport network.InternalTransport, resolver network.RoutingTable) network.HostNetwork
func NewInternalTransport ¶ added in v0.6.2
func NewInternalTransport(conf configuration.Configuration, nodeRef string) (network.InternalTransport, error)
Types ¶
type Builder ¶ added in v0.6.3
type Builder struct {
// contains filtered or unexported fields
}
Builder implements RequestBuilder interface
func (*Builder) Data ¶ added in v0.6.3
func (b *Builder) Data(data interface{}) network.RequestBuilder
func (*Builder) GetRequestID ¶ added in v0.7.5
func (*Builder) GetSenderHost ¶ added in v0.6.3
func (*Builder) GetType ¶ added in v0.6.3
func (b *Builder) GetType() types.PacketType
func (*Builder) Type ¶ added in v0.6.3
func (b *Builder) Type(packetType types.PacketType) network.RequestBuilder
type TransportResolvable ¶ added in v0.6.2
type TransportResolvable struct {
// contains filtered or unexported fields
}
TransportResolvable is implementation of HostNetwork interface that is capable of address resolving.
func (*TransportResolvable) BuildResponse ¶ added in v0.6.2
func (tr *TransportResolvable) BuildResponse(ctx context.Context, request network.Request, responseData interface{}) network.Response
BuildResponse create response to an incoming request with Data set to responseData.
func (*TransportResolvable) GetNodeID ¶ added in v0.6.3
func (tr *TransportResolvable) GetNodeID() core.RecordRef
GetNodeID get current node ID.
func (*TransportResolvable) NewRequestBuilder ¶ added in v0.6.2
func (tr *TransportResolvable) NewRequestBuilder() network.RequestBuilder
NewRequestBuilder create packet Builder for an outgoing request with sender set to current node.
func (*TransportResolvable) PublicAddress ¶ added in v0.6.2
func (tr *TransportResolvable) PublicAddress() string
PublicAddress returns public address that can be published for all nodes.
func (*TransportResolvable) RegisterRequestHandler ¶ added in v0.6.2
func (tr *TransportResolvable) RegisterRequestHandler(t types.PacketType, handler network.RequestHandler)
RegisterRequestHandler register a handler function to process incoming requests of a specific type.
func (*TransportResolvable) SendRequest ¶ added in v0.6.2
func (tr *TransportResolvable) SendRequest(ctx context.Context, request network.Request, receiver core.RecordRef) (network.Future, error)
SendRequest send request to a remote node.
func (*TransportResolvable) Start ¶ added in v0.6.2
func (tr *TransportResolvable) Start(ctx context.Context)
Start listening to network requests.
func (*TransportResolvable) Stop ¶ added in v0.6.2
func (tr *TransportResolvable) Stop()
Stop listening to network requests.
Click to show internal directories.
Click to hide internal directories.