hostnetwork

package
v0.8.7 Latest Latest
Warning

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

Go to latest
Published: Apr 23, 2019 License: Apache-2.0, BSD-3-Clause-Clear Imports: 21 Imported by: 0

Documentation

Index

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) Build added in v0.6.3

func (b *Builder) Build() network.Request

func (*Builder) Data added in v0.6.3

func (b *Builder) Data(data interface{}) network.RequestBuilder

func (*Builder) GetData added in v0.6.3

func (b *Builder) GetData() interface{}

func (*Builder) GetRequestID added in v0.7.5

func (b *Builder) GetRequestID() network.RequestID

func (*Builder) GetSender added in v0.6.3

func (b *Builder) GetSender() core.RecordRef

func (*Builder) GetSenderHost added in v0.6.3

func (b *Builder) GetSenderHost() *host.Host

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)

RegisterPacketHandler 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.

Jump to

Keyboard shortcuts

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