Documentation ¶
Index ¶
- func RegisterPeerServer(s *grpc.Server, srv PeerServer)
- type BroadcastReq
- func (*BroadcastReq) Descriptor() ([]byte, []int)
- func (m *BroadcastReq) GetChainId() uint32
- func (m *BroadcastReq) GetHeader() uint32
- func (m *BroadcastReq) GetMsgBody() []byte
- func (m *BroadcastReq) GetMsgChecksum() []byte
- func (m *BroadcastReq) GetMsgType() uint32
- func (m *BroadcastReq) GetTtl() int32
- func (*BroadcastReq) ProtoMessage()
- func (m *BroadcastReq) Reset()
- func (m *BroadcastReq) String() string
- func (m *BroadcastReq) XXX_DiscardUnknown()
- func (m *BroadcastReq) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)
- func (dst *BroadcastReq) XXX_Merge(src proto.Message)
- func (m *BroadcastReq) XXX_Size() int
- func (m *BroadcastReq) XXX_Unmarshal(b []byte) error
- type BroadcastRes
- func (*BroadcastRes) Descriptor() ([]byte, []int)
- func (m *BroadcastRes) GetHeader() uint32
- func (*BroadcastRes) ProtoMessage()
- func (m *BroadcastRes) Reset()
- func (m *BroadcastRes) String() string
- func (m *BroadcastRes) XXX_DiscardUnknown()
- func (m *BroadcastRes) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)
- func (dst *BroadcastRes) XXX_Merge(src proto.Message)
- func (m *BroadcastRes) XXX_Size() int
- func (m *BroadcastRes) XXX_Unmarshal(b []byte) error
- type GetPeersReq
- func (*GetPeersReq) Descriptor() ([]byte, []int)
- func (m *GetPeersReq) GetCount() uint32
- func (*GetPeersReq) ProtoMessage()
- func (m *GetPeersReq) Reset()
- func (m *GetPeersReq) String() string
- func (m *GetPeersReq) XXX_DiscardUnknown()
- func (m *GetPeersReq) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)
- func (dst *GetPeersReq) XXX_Merge(src proto.Message)
- func (m *GetPeersReq) XXX_Size() int
- func (m *GetPeersReq) XXX_Unmarshal(b []byte) error
- type GetPeersRes
- func (*GetPeersRes) Descriptor() ([]byte, []int)
- func (m *GetPeersRes) GetAddr() []string
- func (*GetPeersRes) ProtoMessage()
- func (m *GetPeersRes) Reset()
- func (m *GetPeersRes) String() string
- func (m *GetPeersRes) XXX_DiscardUnknown()
- func (m *GetPeersRes) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)
- func (dst *GetPeersRes) XXX_Merge(src proto.Message)
- func (m *GetPeersRes) XXX_Size() int
- func (m *GetPeersRes) XXX_Unmarshal(b []byte) error
- type PeerClient
- type PeerServer
- type Ping
- func (*Ping) Descriptor() ([]byte, []int)
- func (m *Ping) GetAddr() string
- func (m *Ping) GetNonce() uint64
- func (*Ping) ProtoMessage()
- func (m *Ping) Reset()
- func (m *Ping) String() string
- func (m *Ping) XXX_DiscardUnknown()
- func (m *Ping) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)
- func (dst *Ping) XXX_Merge(src proto.Message)
- func (m *Ping) XXX_Size() int
- func (m *Ping) XXX_Unmarshal(b []byte) error
- type Pong
- func (*Pong) Descriptor() ([]byte, []int)
- func (m *Pong) GetAckNonce() uint64
- func (*Pong) ProtoMessage()
- func (m *Pong) Reset()
- func (m *Pong) String() string
- func (m *Pong) XXX_DiscardUnknown()
- func (m *Pong) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)
- func (dst *Pong) XXX_Merge(src proto.Message)
- func (m *Pong) XXX_Size() int
- func (m *Pong) XXX_Unmarshal(b []byte) error
- type TellReq
- func (*TellReq) Descriptor() ([]byte, []int)
- func (m *TellReq) GetAddr() string
- func (m *TellReq) GetChainId() uint32
- func (m *TellReq) GetHeader() uint32
- func (m *TellReq) GetMsgBody() []byte
- func (m *TellReq) GetMsgType() uint32
- func (*TellReq) ProtoMessage()
- func (m *TellReq) Reset()
- func (m *TellReq) String() string
- func (m *TellReq) XXX_DiscardUnknown()
- func (m *TellReq) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)
- func (dst *TellReq) XXX_Merge(src proto.Message)
- func (m *TellReq) XXX_Size() int
- func (m *TellReq) XXX_Unmarshal(b []byte) error
- type TellRes
- func (*TellRes) Descriptor() ([]byte, []int)
- func (m *TellRes) GetHeader() uint32
- func (*TellRes) ProtoMessage()
- func (m *TellRes) Reset()
- func (m *TellRes) String() string
- func (m *TellRes) XXX_DiscardUnknown()
- func (m *TellRes) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)
- func (dst *TellRes) XXX_Merge(src proto.Message)
- func (m *TellRes) XXX_Size() int
- func (m *TellRes) XXX_Unmarshal(b []byte) error
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func RegisterPeerServer ¶
func RegisterPeerServer(s *grpc.Server, srv PeerServer)
Types ¶
type BroadcastReq ¶
type BroadcastReq struct { Header uint32 `protobuf:"varint,1,opt,name=header,proto3" json:"header,omitempty"` ChainId uint32 `protobuf:"varint,2,opt,name=chain_id,json=chainId,proto3" json:"chain_id,omitempty"` MsgType uint32 `protobuf:"varint,3,opt,name=msg_type,json=msgType,proto3" json:"msg_type,omitempty"` MsgBody []byte `protobuf:"bytes,4,opt,name=msg_body,json=msgBody,proto3" json:"msg_body,omitempty"` MsgChecksum []byte `protobuf:"bytes,5,opt,name=msg_checksum,json=msgChecksum,proto3" json:"msg_checksum,omitempty"` Ttl int32 `protobuf:"varint,6,opt,name=ttl,proto3" json:"ttl,omitempty"` XXX_NoUnkeyedLiteral struct{} `json:"-"` XXX_unrecognized []byte `json:"-"` XXX_sizecache int32 `json:"-"` }
func (*BroadcastReq) Descriptor ¶
func (*BroadcastReq) Descriptor() ([]byte, []int)
func (*BroadcastReq) GetChainId ¶ added in v0.4.0
func (m *BroadcastReq) GetChainId() uint32
func (*BroadcastReq) GetHeader ¶
func (m *BroadcastReq) GetHeader() uint32
func (*BroadcastReq) GetMsgBody ¶
func (m *BroadcastReq) GetMsgBody() []byte
func (*BroadcastReq) GetMsgChecksum ¶ added in v0.3.0
func (m *BroadcastReq) GetMsgChecksum() []byte
func (*BroadcastReq) GetMsgType ¶
func (m *BroadcastReq) GetMsgType() uint32
func (*BroadcastReq) GetTtl ¶ added in v0.2.0
func (m *BroadcastReq) GetTtl() int32
func (*BroadcastReq) ProtoMessage ¶
func (*BroadcastReq) ProtoMessage()
func (*BroadcastReq) Reset ¶
func (m *BroadcastReq) Reset()
func (*BroadcastReq) String ¶
func (m *BroadcastReq) String() string
func (*BroadcastReq) XXX_DiscardUnknown ¶ added in v0.2.0
func (m *BroadcastReq) XXX_DiscardUnknown()
func (*BroadcastReq) XXX_Marshal ¶ added in v0.2.0
func (m *BroadcastReq) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)
func (*BroadcastReq) XXX_Merge ¶ added in v0.2.0
func (dst *BroadcastReq) XXX_Merge(src proto.Message)
func (*BroadcastReq) XXX_Size ¶ added in v0.2.0
func (m *BroadcastReq) XXX_Size() int
func (*BroadcastReq) XXX_Unmarshal ¶ added in v0.2.0
func (m *BroadcastReq) XXX_Unmarshal(b []byte) error
type BroadcastRes ¶
type BroadcastRes struct { Header uint32 `protobuf:"varint,1,opt,name=header,proto3" json:"header,omitempty"` XXX_NoUnkeyedLiteral struct{} `json:"-"` XXX_unrecognized []byte `json:"-"` XXX_sizecache int32 `json:"-"` }
func (*BroadcastRes) Descriptor ¶
func (*BroadcastRes) Descriptor() ([]byte, []int)
func (*BroadcastRes) GetHeader ¶
func (m *BroadcastRes) GetHeader() uint32
func (*BroadcastRes) ProtoMessage ¶
func (*BroadcastRes) ProtoMessage()
func (*BroadcastRes) Reset ¶
func (m *BroadcastRes) Reset()
func (*BroadcastRes) String ¶
func (m *BroadcastRes) String() string
func (*BroadcastRes) XXX_DiscardUnknown ¶ added in v0.2.0
func (m *BroadcastRes) XXX_DiscardUnknown()
func (*BroadcastRes) XXX_Marshal ¶ added in v0.2.0
func (m *BroadcastRes) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)
func (*BroadcastRes) XXX_Merge ¶ added in v0.2.0
func (dst *BroadcastRes) XXX_Merge(src proto.Message)
func (*BroadcastRes) XXX_Size ¶ added in v0.2.0
func (m *BroadcastRes) XXX_Size() int
func (*BroadcastRes) XXX_Unmarshal ¶ added in v0.2.0
func (m *BroadcastRes) XXX_Unmarshal(b []byte) error
type GetPeersReq ¶
type GetPeersReq struct { Count uint32 `protobuf:"varint,1,opt,name=count,proto3" json:"count,omitempty"` XXX_NoUnkeyedLiteral struct{} `json:"-"` XXX_unrecognized []byte `json:"-"` XXX_sizecache int32 `json:"-"` }
func (*GetPeersReq) Descriptor ¶
func (*GetPeersReq) Descriptor() ([]byte, []int)
func (*GetPeersReq) GetCount ¶
func (m *GetPeersReq) GetCount() uint32
func (*GetPeersReq) ProtoMessage ¶
func (*GetPeersReq) ProtoMessage()
func (*GetPeersReq) Reset ¶
func (m *GetPeersReq) Reset()
func (*GetPeersReq) String ¶
func (m *GetPeersReq) String() string
func (*GetPeersReq) XXX_DiscardUnknown ¶ added in v0.2.0
func (m *GetPeersReq) XXX_DiscardUnknown()
func (*GetPeersReq) XXX_Marshal ¶ added in v0.2.0
func (m *GetPeersReq) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)
func (*GetPeersReq) XXX_Merge ¶ added in v0.2.0
func (dst *GetPeersReq) XXX_Merge(src proto.Message)
func (*GetPeersReq) XXX_Size ¶ added in v0.2.0
func (m *GetPeersReq) XXX_Size() int
func (*GetPeersReq) XXX_Unmarshal ¶ added in v0.2.0
func (m *GetPeersReq) XXX_Unmarshal(b []byte) error
type GetPeersRes ¶
type GetPeersRes struct { Addr []string `protobuf:"bytes,1,rep,name=addr,proto3" json:"addr,omitempty"` XXX_NoUnkeyedLiteral struct{} `json:"-"` XXX_unrecognized []byte `json:"-"` XXX_sizecache int32 `json:"-"` }
func (*GetPeersRes) Descriptor ¶
func (*GetPeersRes) Descriptor() ([]byte, []int)
func (*GetPeersRes) GetAddr ¶
func (m *GetPeersRes) GetAddr() []string
func (*GetPeersRes) ProtoMessage ¶
func (*GetPeersRes) ProtoMessage()
func (*GetPeersRes) Reset ¶
func (m *GetPeersRes) Reset()
func (*GetPeersRes) String ¶
func (m *GetPeersRes) String() string
func (*GetPeersRes) XXX_DiscardUnknown ¶ added in v0.2.0
func (m *GetPeersRes) XXX_DiscardUnknown()
func (*GetPeersRes) XXX_Marshal ¶ added in v0.2.0
func (m *GetPeersRes) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)
func (*GetPeersRes) XXX_Merge ¶ added in v0.2.0
func (dst *GetPeersRes) XXX_Merge(src proto.Message)
func (*GetPeersRes) XXX_Size ¶ added in v0.2.0
func (m *GetPeersRes) XXX_Size() int
func (*GetPeersRes) XXX_Unmarshal ¶ added in v0.2.0
func (m *GetPeersRes) XXX_Unmarshal(b []byte) error
type PeerClient ¶
type PeerClient interface { Ping(ctx context.Context, in *Ping, opts ...grpc.CallOption) (*Pong, error) GetPeers(ctx context.Context, in *GetPeersReq, opts ...grpc.CallOption) (*GetPeersRes, error) Broadcast(ctx context.Context, in *BroadcastReq, opts ...grpc.CallOption) (*BroadcastRes, error) Tell(ctx context.Context, in *TellReq, opts ...grpc.CallOption) (*TellRes, error) }
PeerClient is the client API for Peer service.
For semantics around ctx use and closing/ending streaming RPCs, please refer to https://godoc.org/google.golang.org/grpc#ClientConn.NewStream.
func NewPeerClient ¶
func NewPeerClient(cc *grpc.ClientConn) PeerClient
type PeerServer ¶
type PeerServer interface { Ping(context.Context, *Ping) (*Pong, error) GetPeers(context.Context, *GetPeersReq) (*GetPeersRes, error) Broadcast(context.Context, *BroadcastReq) (*BroadcastRes, error) Tell(context.Context, *TellReq) (*TellRes, error) }
PeerServer is the server API for Peer service.
type Ping ¶
type Ping struct { Nonce uint64 `protobuf:"varint,1,opt,name=nonce,proto3" json:"nonce,omitempty"` // Every one who participates into the network needs to tell others its address // TODO: Seperate it as a standalone protocol Addr string `protobuf:"bytes,2,opt,name=addr,proto3" json:"addr,omitempty"` XXX_NoUnkeyedLiteral struct{} `json:"-"` XXX_unrecognized []byte `json:"-"` XXX_sizecache int32 `json:"-"` }
func (*Ping) Descriptor ¶
func (*Ping) ProtoMessage ¶
func (*Ping) ProtoMessage()
func (*Ping) XXX_DiscardUnknown ¶ added in v0.2.0
func (m *Ping) XXX_DiscardUnknown()
func (*Ping) XXX_Marshal ¶ added in v0.2.0
func (*Ping) XXX_Unmarshal ¶ added in v0.2.0
type Pong ¶
type Pong struct { AckNonce uint64 `protobuf:"varint,1,opt,name=ack_nonce,json=ackNonce,proto3" json:"ack_nonce,omitempty"` XXX_NoUnkeyedLiteral struct{} `json:"-"` XXX_unrecognized []byte `json:"-"` XXX_sizecache int32 `json:"-"` }
func (*Pong) Descriptor ¶
func (*Pong) GetAckNonce ¶
func (*Pong) ProtoMessage ¶
func (*Pong) ProtoMessage()
func (*Pong) XXX_DiscardUnknown ¶ added in v0.2.0
func (m *Pong) XXX_DiscardUnknown()
func (*Pong) XXX_Marshal ¶ added in v0.2.0
func (*Pong) XXX_Unmarshal ¶ added in v0.2.0
type TellReq ¶
type TellReq struct { Header uint32 `protobuf:"varint,1,opt,name=header,proto3" json:"header,omitempty"` Addr string `protobuf:"bytes,2,opt,name=addr,proto3" json:"addr,omitempty"` ChainId uint32 `protobuf:"varint,3,opt,name=chain_id,json=chainId,proto3" json:"chain_id,omitempty"` MsgType uint32 `protobuf:"varint,4,opt,name=msg_type,json=msgType,proto3" json:"msg_type,omitempty"` MsgBody []byte `protobuf:"bytes,5,opt,name=msg_body,json=msgBody,proto3" json:"msg_body,omitempty"` XXX_NoUnkeyedLiteral struct{} `json:"-"` XXX_unrecognized []byte `json:"-"` XXX_sizecache int32 `json:"-"` }
func (*TellReq) Descriptor ¶
func (*TellReq) GetChainId ¶ added in v0.4.0
func (*TellReq) GetMsgBody ¶
func (*TellReq) GetMsgType ¶
func (*TellReq) ProtoMessage ¶
func (*TellReq) ProtoMessage()
func (*TellReq) XXX_DiscardUnknown ¶ added in v0.2.0
func (m *TellReq) XXX_DiscardUnknown()
func (*TellReq) XXX_Marshal ¶ added in v0.2.0
func (*TellReq) XXX_Unmarshal ¶ added in v0.2.0
type TellRes ¶
type TellRes struct { Header uint32 `protobuf:"varint,1,opt,name=header,proto3" json:"header,omitempty"` XXX_NoUnkeyedLiteral struct{} `json:"-"` XXX_unrecognized []byte `json:"-"` XXX_sizecache int32 `json:"-"` }
func (*TellRes) Descriptor ¶
func (*TellRes) ProtoMessage ¶
func (*TellRes) ProtoMessage()
func (*TellRes) XXX_DiscardUnknown ¶ added in v0.2.0
func (m *TellRes) XXX_DiscardUnknown()
func (*TellRes) XXX_Marshal ¶ added in v0.2.0
func (*TellRes) XXX_Unmarshal ¶ added in v0.2.0
Click to show internal directories.
Click to hide internal directories.