transport

package
v0.0.0-...-3a733ff Latest Latest
Warning

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

Go to latest
Published: May 24, 2022 License: MIT Imports: 17 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type ExternalClient

type ExternalClient struct {
	transpb.CommandServiceClient
	*grpc.ClientConn
}

func NewExternalClient

func NewExternalClient(ctx context.Context, addr string) (*ExternalClient, error)

type MessageHandler

type MessageHandler interface {
	HandleMessage(*transportpb.TransMsg)
	HandleCommand(context.Context,
		*transportpb.ClientPacket) (*transportpb.ClientPacket, error)
}

MessageHandler is an object capable of accepting incoming protocol messages.

type Request

type Request struct {
	Command *commandpb.Command
	ReturnC chan<- commandpb.CommandResult
}

type Transport

type Transport interface {
	Init(id peerpb.PeerID, addr string, peers map[peerpb.PeerID]string)
	Serve(MessageHandler)
	Send(msgs []peerpb.Message)
	Close()
}

Transport handles RPC messages for Raft coordination.

func NewGRPCTransport

func NewGRPCTransport() Transport

NewGRPCTransport creates a new Transport that uses gRPC streams.

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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