grpc

package
v0.1.0 Latest Latest
Warning

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

Go to latest
Published: Jul 23, 2018 License: AGPL-3.0 Imports: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

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

Functions

func RegisterSwarmServer

func RegisterSwarmServer(s *google_golang_org_grpc.Server, srv SwarmServer)

Types

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 ConnectionsReq

type ConnectionsReq 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 connections request message.

func (*ConnectionsReq) Descriptor

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

func (*ConnectionsReq) GetPeerId

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

func (*ConnectionsReq) Marshal

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

func (*ConnectionsReq) MarshalTo

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

func (*ConnectionsReq) ProtoMessage

func (*ConnectionsReq) ProtoMessage()

func (*ConnectionsReq) Reset

func (m *ConnectionsReq) Reset()

func (*ConnectionsReq) Size

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

func (*ConnectionsReq) String

func (m *ConnectionsReq) String() string

func (*ConnectionsReq) Unmarshal

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

func (*ConnectionsReq) XXX_DiscardUnknown

func (m *ConnectionsReq) XXX_DiscardUnknown()

func (*ConnectionsReq) XXX_Marshal

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

func (*ConnectionsReq) XXX_Merge

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

func (*ConnectionsReq) XXX_Size

func (m *ConnectionsReq) XXX_Size() int

func (*ConnectionsReq) XXX_Unmarshal

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

type LocalPeerReq

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

The local peer request message.

func (*LocalPeerReq) Descriptor

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

func (*LocalPeerReq) Marshal

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

func (*LocalPeerReq) MarshalTo

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

func (*LocalPeerReq) ProtoMessage

func (*LocalPeerReq) ProtoMessage()

func (*LocalPeerReq) Reset

func (m *LocalPeerReq) Reset()

func (*LocalPeerReq) Size

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

func (*LocalPeerReq) String

func (m *LocalPeerReq) String() string

func (*LocalPeerReq) Unmarshal

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

func (*LocalPeerReq) XXX_DiscardUnknown

func (m *LocalPeerReq) XXX_DiscardUnknown()

func (*LocalPeerReq) XXX_Marshal

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

func (*LocalPeerReq) XXX_Merge

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

func (*LocalPeerReq) XXX_Size

func (m *LocalPeerReq) XXX_Size() int

func (*LocalPeerReq) XXX_Unmarshal

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

type Peer

type Peer 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 message containing the ID of the peer.

func (*Peer) Descriptor

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

func (*Peer) GetId

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

func (*Peer) Marshal

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

func (*Peer) MarshalTo

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

func (*Peer) ProtoMessage

func (*Peer) ProtoMessage()

func (*Peer) Reset

func (m *Peer) Reset()

func (*Peer) Size

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

func (*Peer) String

func (m *Peer) String() string

func (*Peer) Unmarshal

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

func (*Peer) XXX_DiscardUnknown

func (m *Peer) XXX_DiscardUnknown()

func (*Peer) XXX_Marshal

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

func (*Peer) XXX_Merge

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

func (*Peer) XXX_Size

func (m *Peer) XXX_Size() int

func (*Peer) XXX_Unmarshal

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

type PeersReq

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

The peers request message.

func (*PeersReq) Descriptor

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

func (*PeersReq) Marshal

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

func (*PeersReq) MarshalTo

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

func (*PeersReq) ProtoMessage

func (*PeersReq) ProtoMessage()

func (*PeersReq) Reset

func (m *PeersReq) Reset()

func (*PeersReq) Size

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

func (*PeersReq) String

func (m *PeersReq) String() string

func (*PeersReq) Unmarshal

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

func (*PeersReq) XXX_DiscardUnknown

func (m *PeersReq) XXX_DiscardUnknown()

func (*PeersReq) XXX_Marshal

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

func (*PeersReq) XXX_Merge

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

func (*PeersReq) XXX_Size

func (m *PeersReq) XXX_Size() int

func (*PeersReq) XXX_Unmarshal

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

type SwarmClient

type SwarmClient interface {
	// Returns the local peer.
	LocalPeer(ctx context.Context, in *LocalPeerReq, opts ...google_golang_org_grpc.CallOption) (*Peer, error)
	// Streams the connected peers.
	Peers(ctx context.Context, in *PeersReq, opts ...google_golang_org_grpc.CallOption) (Swarm_PeersClient, error)
	// Streams connections.
	Connections(ctx context.Context, in *ConnectionsReq, opts ...google_golang_org_grpc.CallOption) (Swarm_ConnectionsClient, error)
}

type SwarmServer

type SwarmServer interface {
	// Returns the local peer.
	LocalPeer(context.Context, *LocalPeerReq) (*Peer, error)
	// Streams the connected peers.
	Peers(*PeersReq, Swarm_PeersServer) error
	// Streams connections.
	Connections(*ConnectionsReq, Swarm_ConnectionsServer) error
}

type Swarm_ConnectionsClient

type Swarm_ConnectionsClient interface {
	Recv() (*Connection, error)
	google_golang_org_grpc.ClientStream
}

type Swarm_ConnectionsServer

type Swarm_ConnectionsServer interface {
	Send(*Connection) error
	google_golang_org_grpc.ServerStream
}

type Swarm_PeersClient

type Swarm_PeersClient interface {
	Recv() (*Peer, error)
	google_golang_org_grpc.ClientStream
}

type Swarm_PeersServer

type Swarm_PeersServer interface {
	Send(*Peer) error
	google_golang_org_grpc.ServerStream
}

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