pgrpc

package module
v0.0.1 Latest Latest
Warning

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

Go to latest
Published: Aug 26, 2020 License: MIT Imports: 9 Imported by: 0

README

go-libp2p-grpc

The grpc transport over libp2p

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	ErrInternal = errors.New("the internal error", errors.WithVendor(errVendor), errors.WithCode(-1))
	ErrAddr     = errors.New("invalid libp2p net.addr", errors.WithVendor(errVendor), errors.WithCode(-2))
	ErrClosed   = errors.New("transport closed", errors.WithVendor(errVendor), errors.WithCode(-3))
)

errors

Functions

func Dial

func Dial(transport Transport, id peer.ID, dialOpts ...grpc.DialOption) (*grpc.ClientConn, error)

Dial connect to grpc Server with libp2p transport

func PeerID

func PeerID(addr net.Addr) (peer.ID, error)

PeerID cast net.Addr to peer.ID

func Serve

func Serve(transport Transport, options ...grpc.ServerOption) *grpc.Server

Serve create and run grpc.Server with libp2p transport

Types

type Option

type Option func(transport *libp2pTransport)

Option transport create option

type Transport

type Transport grpcservice.Provider

Transport the grpc transport over libp2p

func New

func New(ctx context.Context, host host.Host, options ...Option) Transport

New create transport object for grpc over libp2p

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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