Documentation
¶
Index ¶
- Variables
- func RegisterSwarmServer(s *google_golang_org_grpc.Server, srv SwarmServer)
- type Connection
- func (*Connection) Descriptor() ([]byte, []int)
- func (m *Connection) GetLocalAddress() []byte
- func (m *Connection) GetPeerId() []byte
- func (m *Connection) GetRemoteAddress() []byte
- func (m *Connection) Marshal() (dAtA []byte, err error)
- func (m *Connection) MarshalTo(dAtA []byte) (int, error)
- func (*Connection) ProtoMessage()
- func (m *Connection) Reset()
- func (m *Connection) Size() (n int)
- func (m *Connection) String() string
- func (m *Connection) Unmarshal(dAtA []byte) error
- func (m *Connection) XXX_DiscardUnknown()
- func (m *Connection) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)
- func (dst *Connection) XXX_Merge(src proto.Message)
- func (m *Connection) XXX_Size() int
- func (m *Connection) XXX_Unmarshal(b []byte) error
- type ConnectionsReq
- func (*ConnectionsReq) Descriptor() ([]byte, []int)
- func (m *ConnectionsReq) GetPeerId() []byte
- func (m *ConnectionsReq) Marshal() (dAtA []byte, err error)
- func (m *ConnectionsReq) MarshalTo(dAtA []byte) (int, error)
- func (*ConnectionsReq) ProtoMessage()
- func (m *ConnectionsReq) Reset()
- func (m *ConnectionsReq) Size() (n int)
- func (m *ConnectionsReq) String() string
- func (m *ConnectionsReq) Unmarshal(dAtA []byte) error
- func (m *ConnectionsReq) XXX_DiscardUnknown()
- func (m *ConnectionsReq) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)
- func (dst *ConnectionsReq) XXX_Merge(src proto.Message)
- func (m *ConnectionsReq) XXX_Size() int
- func (m *ConnectionsReq) XXX_Unmarshal(b []byte) error
- type LocalPeerReq
- func (*LocalPeerReq) Descriptor() ([]byte, []int)
- func (m *LocalPeerReq) Marshal() (dAtA []byte, err error)
- func (m *LocalPeerReq) MarshalTo(dAtA []byte) (int, error)
- func (*LocalPeerReq) ProtoMessage()
- func (m *LocalPeerReq) Reset()
- func (m *LocalPeerReq) Size() (n int)
- func (m *LocalPeerReq) String() string
- func (m *LocalPeerReq) Unmarshal(dAtA []byte) error
- func (m *LocalPeerReq) XXX_DiscardUnknown()
- func (m *LocalPeerReq) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)
- func (dst *LocalPeerReq) XXX_Merge(src proto.Message)
- func (m *LocalPeerReq) XXX_Size() int
- func (m *LocalPeerReq) XXX_Unmarshal(b []byte) error
- type Peer
- func (*Peer) Descriptor() ([]byte, []int)
- func (m *Peer) GetId() []byte
- func (m *Peer) Marshal() (dAtA []byte, err error)
- func (m *Peer) MarshalTo(dAtA []byte) (int, error)
- func (*Peer) ProtoMessage()
- func (m *Peer) Reset()
- func (m *Peer) Size() (n int)
- func (m *Peer) String() string
- func (m *Peer) Unmarshal(dAtA []byte) error
- func (m *Peer) XXX_DiscardUnknown()
- func (m *Peer) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)
- func (dst *Peer) XXX_Merge(src proto.Message)
- func (m *Peer) XXX_Size() int
- func (m *Peer) XXX_Unmarshal(b []byte) error
- type PeersReq
- func (*PeersReq) Descriptor() ([]byte, []int)
- func (m *PeersReq) Marshal() (dAtA []byte, err error)
- func (m *PeersReq) MarshalTo(dAtA []byte) (int, error)
- func (*PeersReq) ProtoMessage()
- func (m *PeersReq) Reset()
- func (m *PeersReq) Size() (n int)
- func (m *PeersReq) String() string
- func (m *PeersReq) Unmarshal(dAtA []byte) error
- func (m *PeersReq) XXX_DiscardUnknown()
- func (m *PeersReq) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)
- func (dst *PeersReq) XXX_Merge(src proto.Message)
- func (m *PeersReq) XXX_Size() int
- func (m *PeersReq) XXX_Unmarshal(b []byte) error
- type SwarmClient
- type SwarmServer
- type Swarm_ConnectionsClient
- type Swarm_ConnectionsServer
- type Swarm_PeersClient
- type Swarm_PeersServer
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) 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) 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) 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) ProtoMessage ¶
func (*Peer) ProtoMessage()
func (*Peer) XXX_DiscardUnknown ¶
func (m *Peer) XXX_DiscardUnknown()
func (*Peer) XXX_Unmarshal ¶
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) ProtoMessage ¶
func (*PeersReq) ProtoMessage()
func (*PeersReq) XXX_DiscardUnknown ¶
func (m *PeersReq) XXX_DiscardUnknown()
func (*PeersReq) XXX_Marshal ¶
func (*PeersReq) XXX_Unmarshal ¶
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)
}
func NewSwarmClient ¶
func NewSwarmClient(cc *google_golang_org_grpc.ClientConn) SwarmClient
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
}
Click to show internal directories.
Click to hide internal directories.