grpc

package
v0.2.0 Latest Latest
Warning

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

Go to latest
Published: Mar 13, 2019 License: AGPL-3.0 Imports: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	ErrInvalidLengthHost = fmt.Errorf("proto: negative length found during unmarshaling")
	ErrIntOverflowHost   = fmt.Errorf("proto: integer overflow")
)

Functions

func RegisterHostServer

func RegisterHostServer(s *grpc.Server, srv HostServer)

Types

type AddPeerAddressReq

type AddPeerAddressReq struct {
	PeerId               []byte   `protobuf:"bytes,1,opt,name=peer_id,json=peerId,proto3" json:"peer_id,omitempty"`
	Address              []byte   `protobuf:"bytes,2,opt,name=address,proto3" json:"address,omitempty"`
	XXX_NoUnkeyedLiteral struct{} `json:"-"`
	XXX_unrecognized     []byte   `json:"-"`
	XXX_sizecache        int32    `json:"-"`
}

The add peer address request message.

func (*AddPeerAddressReq) Descriptor

func (*AddPeerAddressReq) Descriptor() ([]byte, []int)

func (*AddPeerAddressReq) GetAddress

func (m *AddPeerAddressReq) GetAddress() []byte

func (*AddPeerAddressReq) GetPeerId

func (m *AddPeerAddressReq) GetPeerId() []byte

func (*AddPeerAddressReq) Marshal

func (m *AddPeerAddressReq) Marshal() (dAtA []byte, err error)

func (*AddPeerAddressReq) MarshalTo

func (m *AddPeerAddressReq) MarshalTo(dAtA []byte) (int, error)

func (*AddPeerAddressReq) ProtoMessage

func (*AddPeerAddressReq) ProtoMessage()

func (*AddPeerAddressReq) Reset

func (m *AddPeerAddressReq) Reset()

func (*AddPeerAddressReq) Size

func (m *AddPeerAddressReq) Size() (n int)

func (*AddPeerAddressReq) String

func (m *AddPeerAddressReq) String() string

func (*AddPeerAddressReq) Unmarshal

func (m *AddPeerAddressReq) Unmarshal(dAtA []byte) error

func (*AddPeerAddressReq) XXX_DiscardUnknown

func (m *AddPeerAddressReq) XXX_DiscardUnknown()

func (*AddPeerAddressReq) XXX_Marshal

func (m *AddPeerAddressReq) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)

func (*AddPeerAddressReq) XXX_Merge

func (dst *AddPeerAddressReq) XXX_Merge(src proto.Message)

func (*AddPeerAddressReq) XXX_Size

func (m *AddPeerAddressReq) XXX_Size() int

func (*AddPeerAddressReq) XXX_Unmarshal

func (m *AddPeerAddressReq) XXX_Unmarshal(b []byte) error

type Address

type Address struct {
	Address              []byte   `protobuf:"bytes,1,opt,name=address,proto3" json:"address,omitempty"`
	XXX_NoUnkeyedLiteral struct{} `json:"-"`
	XXX_unrecognized     []byte   `json:"-"`
	XXX_sizecache        int32    `json:"-"`
}

The address message containing a multiaddress.

func (*Address) Descriptor

func (*Address) Descriptor() ([]byte, []int)

func (*Address) GetAddress

func (m *Address) GetAddress() []byte

func (*Address) Marshal

func (m *Address) Marshal() (dAtA []byte, err error)

func (*Address) MarshalTo

func (m *Address) MarshalTo(dAtA []byte) (int, error)

func (*Address) ProtoMessage

func (*Address) ProtoMessage()

func (*Address) Reset

func (m *Address) Reset()

func (*Address) Size

func (m *Address) Size() (n int)

func (*Address) String

func (m *Address) String() string

func (*Address) Unmarshal

func (m *Address) Unmarshal(dAtA []byte) error

func (*Address) XXX_DiscardUnknown

func (m *Address) XXX_DiscardUnknown()

func (*Address) XXX_Marshal

func (m *Address) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)

func (*Address) XXX_Merge

func (dst *Address) XXX_Merge(src proto.Message)

func (*Address) XXX_Size

func (m *Address) XXX_Size() int

func (*Address) XXX_Unmarshal

func (m *Address) XXX_Unmarshal(b []byte) error

type AddressesReq

type AddressesReq struct {
	XXX_NoUnkeyedLiteral struct{} `json:"-"`
	XXX_unrecognized     []byte   `json:"-"`
	XXX_sizecache        int32    `json:"-"`
}

The address request message.

func (*AddressesReq) Descriptor

func (*AddressesReq) Descriptor() ([]byte, []int)

func (*AddressesReq) Marshal

func (m *AddressesReq) Marshal() (dAtA []byte, err error)

func (*AddressesReq) MarshalTo

func (m *AddressesReq) MarshalTo(dAtA []byte) (int, error)

func (*AddressesReq) ProtoMessage

func (*AddressesReq) ProtoMessage()

func (*AddressesReq) Reset

func (m *AddressesReq) Reset()

func (*AddressesReq) Size

func (m *AddressesReq) Size() (n int)

func (*AddressesReq) String

func (m *AddressesReq) String() string

func (*AddressesReq) Unmarshal

func (m *AddressesReq) Unmarshal(dAtA []byte) error

func (*AddressesReq) XXX_DiscardUnknown

func (m *AddressesReq) XXX_DiscardUnknown()

func (*AddressesReq) XXX_Marshal

func (m *AddressesReq) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)

func (*AddressesReq) XXX_Merge

func (dst *AddressesReq) XXX_Merge(src proto.Message)

func (*AddressesReq) XXX_Size

func (m *AddressesReq) XXX_Size() int

func (*AddressesReq) XXX_Unmarshal

func (m *AddressesReq) XXX_Unmarshal(b []byte) error

type ConnectReq

type ConnectReq struct {
	Address              []byte   `protobuf:"bytes,1,opt,name=address,proto3" json:"address,omitempty"`
	XXX_NoUnkeyedLiteral struct{} `json:"-"`
	XXX_unrecognized     []byte   `json:"-"`
	XXX_sizecache        int32    `json:"-"`
}

The connect request message.

func (*ConnectReq) Descriptor

func (*ConnectReq) Descriptor() ([]byte, []int)

func (*ConnectReq) GetAddress

func (m *ConnectReq) GetAddress() []byte

func (*ConnectReq) Marshal

func (m *ConnectReq) Marshal() (dAtA []byte, err error)

func (*ConnectReq) MarshalTo

func (m *ConnectReq) MarshalTo(dAtA []byte) (int, error)

func (*ConnectReq) ProtoMessage

func (*ConnectReq) ProtoMessage()

func (*ConnectReq) Reset

func (m *ConnectReq) Reset()

func (*ConnectReq) Size

func (m *ConnectReq) Size() (n int)

func (*ConnectReq) String

func (m *ConnectReq) String() string

func (*ConnectReq) Unmarshal

func (m *ConnectReq) Unmarshal(dAtA []byte) error

func (*ConnectReq) XXX_DiscardUnknown

func (m *ConnectReq) XXX_DiscardUnknown()

func (*ConnectReq) XXX_Marshal

func (m *ConnectReq) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)

func (*ConnectReq) XXX_Merge

func (dst *ConnectReq) XXX_Merge(src proto.Message)

func (*ConnectReq) XXX_Size

func (m *ConnectReq) XXX_Size() int

func (*ConnectReq) XXX_Unmarshal

func (m *ConnectReq) XXX_Unmarshal(b []byte) error

type Connection

type Connection struct {
	PeerId               []byte   `protobuf:"bytes,1,opt,name=peer_id,json=peerId,proto3" json:"peer_id,omitempty"`
	LocalAddress         []byte   `protobuf:"bytes,2,opt,name=local_address,json=localAddress,proto3" json:"local_address,omitempty"`
	RemoteAddress        []byte   `protobuf:"bytes,3,opt,name=remote_address,json=remoteAddress,proto3" json:"remote_address,omitempty"`
	XXX_NoUnkeyedLiteral struct{} `json:"-"`
	XXX_unrecognized     []byte   `json:"-"`
	XXX_sizecache        int32    `json:"-"`
}

The connection message containing the peer ID and addresses.

func (*Connection) Descriptor

func (*Connection) Descriptor() ([]byte, []int)

func (*Connection) GetLocalAddress

func (m *Connection) GetLocalAddress() []byte

func (*Connection) GetPeerId

func (m *Connection) GetPeerId() []byte

func (*Connection) GetRemoteAddress

func (m *Connection) GetRemoteAddress() []byte

func (*Connection) Marshal

func (m *Connection) Marshal() (dAtA []byte, err error)

func (*Connection) MarshalTo

func (m *Connection) MarshalTo(dAtA []byte) (int, error)

func (*Connection) ProtoMessage

func (*Connection) ProtoMessage()

func (*Connection) Reset

func (m *Connection) Reset()

func (*Connection) Size

func (m *Connection) Size() (n int)

func (*Connection) String

func (m *Connection) String() string

func (*Connection) Unmarshal

func (m *Connection) Unmarshal(dAtA []byte) error

func (*Connection) XXX_DiscardUnknown

func (m *Connection) XXX_DiscardUnknown()

func (*Connection) XXX_Marshal

func (m *Connection) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)

func (*Connection) XXX_Merge

func (dst *Connection) XXX_Merge(src proto.Message)

func (*Connection) XXX_Size

func (m *Connection) XXX_Size() int

func (*Connection) XXX_Unmarshal

func (m *Connection) XXX_Unmarshal(b []byte) error

type HostClient

type HostClient interface {
	// Returns the host ID.
	ID(ctx context.Context, in *IdReq, opts ...grpc.CallOption) (*PeerId, error)
	// Streams the host addresses.
	Addresses(ctx context.Context, in *AddressesReq, opts ...grpc.CallOption) (Host_AddressesClient, error)
	// Streams a peer's known addresses.
	PeerAddresses(ctx context.Context, in *PeerAddressesReq, opts ...grpc.CallOption) (Host_PeerAddressesClient, error)
	// Clears a peer's known addresses.
	ClearPeerAddresses(ctx context.Context, in *PeerAddressesReq, opts ...grpc.CallOption) (Host_ClearPeerAddressesClient, error)
	// Add a new peer address to the node's Peer Store.
	AddPeerAddress(ctx context.Context, in *AddPeerAddressReq, opts ...grpc.CallOption) (*PeerId, error)
	// Connects to a multiaddress.
	Connect(ctx context.Context, in *ConnectReq, opts ...grpc.CallOption) (Host_ConnectClient, error)
}

func NewHostClient

func NewHostClient(cc *grpc.ClientConn) HostClient

type HostServer

type HostServer interface {
	// Returns the host ID.
	ID(context.Context, *IdReq) (*PeerId, error)
	// Streams the host addresses.
	Addresses(*AddressesReq, Host_AddressesServer) error
	// Streams a peer's known addresses.
	PeerAddresses(*PeerAddressesReq, Host_PeerAddressesServer) error
	// Clears a peer's known addresses.
	ClearPeerAddresses(*PeerAddressesReq, Host_ClearPeerAddressesServer) error
	// Add a new peer address to the node's Peer Store.
	AddPeerAddress(context.Context, *AddPeerAddressReq) (*PeerId, error)
	// Connects to a multiaddress.
	Connect(*ConnectReq, Host_ConnectServer) error
}

type Host_AddressesClient

type Host_AddressesClient interface {
	Recv() (*Address, error)
	grpc.ClientStream
}

type Host_AddressesServer

type Host_AddressesServer interface {
	Send(*Address) error
	grpc.ServerStream
}

type Host_ClearPeerAddressesClient added in v0.2.0

type Host_ClearPeerAddressesClient interface {
	Recv() (*Address, error)
	grpc.ClientStream
}

type Host_ClearPeerAddressesServer added in v0.2.0

type Host_ClearPeerAddressesServer interface {
	Send(*Address) error
	grpc.ServerStream
}

type Host_ConnectClient

type Host_ConnectClient interface {
	Recv() (*Connection, error)
	grpc.ClientStream
}

type Host_ConnectServer

type Host_ConnectServer interface {
	Send(*Connection) error
	grpc.ServerStream
}

type Host_PeerAddressesClient

type Host_PeerAddressesClient interface {
	Recv() (*Address, error)
	grpc.ClientStream
}

type Host_PeerAddressesServer

type Host_PeerAddressesServer interface {
	Send(*Address) error
	grpc.ServerStream
}

type IdReq

type IdReq struct {
	XXX_NoUnkeyedLiteral struct{} `json:"-"`
	XXX_unrecognized     []byte   `json:"-"`
	XXX_sizecache        int32    `json:"-"`
}

The ID request message.

func (*IdReq) Descriptor

func (*IdReq) Descriptor() ([]byte, []int)

func (*IdReq) Marshal

func (m *IdReq) Marshal() (dAtA []byte, err error)

func (*IdReq) MarshalTo

func (m *IdReq) MarshalTo(dAtA []byte) (int, error)

func (*IdReq) ProtoMessage

func (*IdReq) ProtoMessage()

func (*IdReq) Reset

func (m *IdReq) Reset()

func (*IdReq) Size

func (m *IdReq) Size() (n int)

func (*IdReq) String

func (m *IdReq) String() string

func (*IdReq) Unmarshal

func (m *IdReq) Unmarshal(dAtA []byte) error

func (*IdReq) XXX_DiscardUnknown

func (m *IdReq) XXX_DiscardUnknown()

func (*IdReq) XXX_Marshal

func (m *IdReq) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)

func (*IdReq) XXX_Merge

func (dst *IdReq) XXX_Merge(src proto.Message)

func (*IdReq) XXX_Size

func (m *IdReq) XXX_Size() int

func (*IdReq) XXX_Unmarshal

func (m *IdReq) XXX_Unmarshal(b []byte) error

type PeerAddressesReq

type PeerAddressesReq struct {
	PeerId               []byte   `protobuf:"bytes,1,opt,name=peer_id,json=peerId,proto3" json:"peer_id,omitempty"`
	XXX_NoUnkeyedLiteral struct{} `json:"-"`
	XXX_unrecognized     []byte   `json:"-"`
	XXX_sizecache        int32    `json:"-"`
}

The peer addresses request message.

func (*PeerAddressesReq) Descriptor

func (*PeerAddressesReq) Descriptor() ([]byte, []int)

func (*PeerAddressesReq) GetPeerId

func (m *PeerAddressesReq) GetPeerId() []byte

func (*PeerAddressesReq) Marshal

func (m *PeerAddressesReq) Marshal() (dAtA []byte, err error)

func (*PeerAddressesReq) MarshalTo

func (m *PeerAddressesReq) MarshalTo(dAtA []byte) (int, error)

func (*PeerAddressesReq) ProtoMessage

func (*PeerAddressesReq) ProtoMessage()

func (*PeerAddressesReq) Reset

func (m *PeerAddressesReq) Reset()

func (*PeerAddressesReq) Size

func (m *PeerAddressesReq) Size() (n int)

func (*PeerAddressesReq) String

func (m *PeerAddressesReq) String() string

func (*PeerAddressesReq) Unmarshal

func (m *PeerAddressesReq) Unmarshal(dAtA []byte) error

func (*PeerAddressesReq) XXX_DiscardUnknown

func (m *PeerAddressesReq) XXX_DiscardUnknown()

func (*PeerAddressesReq) XXX_Marshal

func (m *PeerAddressesReq) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)

func (*PeerAddressesReq) XXX_Merge

func (dst *PeerAddressesReq) XXX_Merge(src proto.Message)

func (*PeerAddressesReq) XXX_Size

func (m *PeerAddressesReq) XXX_Size() int

func (*PeerAddressesReq) XXX_Unmarshal

func (m *PeerAddressesReq) XXX_Unmarshal(b []byte) error

type PeerId

type PeerId struct {
	Id                   []byte   `protobuf:"bytes,1,opt,name=id,proto3" json:"id,omitempty"`
	XXX_NoUnkeyedLiteral struct{} `json:"-"`
	XXX_unrecognized     []byte   `json:"-"`
	XXX_sizecache        int32    `json:"-"`
}

The peer ID message containing the ID of a peer.

func (*PeerId) Descriptor

func (*PeerId) Descriptor() ([]byte, []int)

func (*PeerId) GetId

func (m *PeerId) GetId() []byte

func (*PeerId) Marshal

func (m *PeerId) Marshal() (dAtA []byte, err error)

func (*PeerId) MarshalTo

func (m *PeerId) MarshalTo(dAtA []byte) (int, error)

func (*PeerId) ProtoMessage

func (*PeerId) ProtoMessage()

func (*PeerId) Reset

func (m *PeerId) Reset()

func (*PeerId) Size

func (m *PeerId) Size() (n int)

func (*PeerId) String

func (m *PeerId) String() string

func (*PeerId) Unmarshal

func (m *PeerId) Unmarshal(dAtA []byte) error

func (*PeerId) XXX_DiscardUnknown

func (m *PeerId) XXX_DiscardUnknown()

func (*PeerId) XXX_Marshal

func (m *PeerId) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)

func (*PeerId) XXX_Merge

func (dst *PeerId) XXX_Merge(src proto.Message)

func (*PeerId) XXX_Size

func (m *PeerId) XXX_Size() int

func (*PeerId) XXX_Unmarshal

func (m *PeerId) XXX_Unmarshal(b []byte) error

Directories

Path Synopsis
Package mockgrpc is a generated GoMock package.
Package mockgrpc is a generated GoMock package.

Jump to

Keyboard shortcuts

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