Documentation ¶
Overview ¶
*
- Description:
- Author: Yihen.Liu
- Create: 2019-07-22
Index ¶
- Constants
- type Config
- func (*Config) Descriptor() ([]byte, []int)
- func (m *Config) GetIp() string
- func (m *Config) GetPort() int32
- func (m *Config) GetProtocol() string
- func (m *Config) GetPubId() string
- func (m *Config) GetSeedlist() []*Seed
- func (*Config) ProtoMessage()
- func (m *Config) Reset()
- func (m *Config) String() string
- func (m *Config) XXX_DiscardUnknown()
- func (m *Config) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)
- func (m *Config) XXX_Merge(src proto.Message)
- func (m *Config) XXX_Size() int
- func (m *Config) XXX_Unmarshal(b []byte) error
- type Instance
- type P2PNode
- func (this *P2PNode) Bootstrap()
- func (this *P2PNode) DoSeedListRequest(pid peer.ID)
- func (s *P2PNode) SayHello(ctx context.Context, in *wire.HelloSeedList) (*wire.HelloReply, error)
- func (this *P2PNode) StartGrpcServer()
- func (this *P2PNode) StartListen(done chan struct{})
- func (this *P2PNode) StartService()
- type Seed
- func (*Seed) Descriptor() ([]byte, []int)
- func (m *Seed) GetIp() string
- func (m *Seed) GetPort() int32
- func (m *Seed) GetProtocol() string
- func (m *Seed) GetPubId() string
- func (*Seed) ProtoMessage()
- func (m *Seed) Reset()
- func (m *Seed) String() string
- func (m *Seed) XXX_DiscardUnknown()
- func (m *Seed) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)
- func (m *Seed) XXX_Merge(src proto.Message)
- func (m *Seed) XXX_Size() int
- func (m *Seed) XXX_Unmarshal(b []byte) error
Constants ¶
View Source
const DefaultSleepInterval = 100 * time.Millisecond
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Config ¶
type Config struct { Protocol string `protobuf:"bytes,1,opt,name=protocol,proto3" json:"protocol,omitempty"` Ip string `protobuf:"bytes,2,opt,name=ip,proto3" json:"ip,omitempty"` Port int32 `protobuf:"varint,3,opt,name=port,proto3" json:"port,omitempty"` PubId string `protobuf:"bytes,4,opt,name=pub_id,json=pubId,proto3" json:"pub_id,omitempty"` Seedlist []*Seed `protobuf:"bytes,5,rep,name=seedlist,proto3" json:"seedlist,omitempty"` XXX_NoUnkeyedLiteral struct{} `json:"-"` XXX_unrecognized []byte `json:"-"` XXX_sizecache int32 `json:"-"` }
func (*Config) Descriptor ¶
func (*Config) GetProtocol ¶
func (*Config) GetSeedlist ¶
func (*Config) ProtoMessage ¶
func (*Config) ProtoMessage()
func (*Config) XXX_DiscardUnknown ¶
func (m *Config) XXX_DiscardUnknown()
func (*Config) XXX_Marshal ¶
func (*Config) XXX_Unmarshal ¶
type Instance ¶
Instance is a log.Handler that handles logs.
type P2PNode ¶
type P2PNode struct { Host core.Host Protocols protocol.Protocol Config *Config // contains filtered or unexported fields }
func NewP2PNode ¶
func (*P2PNode) DoSeedListRequest ¶
func (*P2PNode) SayHello ¶
func (s *P2PNode) SayHello(ctx context.Context, in *wire.HelloSeedList) (*wire.HelloReply, error)
SayHello implements helloworld.GreeterServer
func (*P2PNode) StartGrpcServer ¶
func (this *P2PNode) StartGrpcServer()
func (*P2PNode) StartListen ¶
func (this *P2PNode) StartListen(done chan struct{})
func (*P2PNode) StartService ¶
func (this *P2PNode) StartService()
type Seed ¶
type Seed struct { Protocol string `protobuf:"bytes,1,opt,name=protocol,proto3" json:"protocol,omitempty"` Ip string `protobuf:"bytes,2,opt,name=ip,proto3" json:"ip,omitempty"` Port int32 `protobuf:"varint,3,opt,name=port,proto3" json:"port,omitempty"` PubId string `protobuf:"bytes,4,opt,name=pub_id,json=pubId,proto3" json:"pub_id,omitempty"` XXX_NoUnkeyedLiteral struct{} `json:"-"` XXX_unrecognized []byte `json:"-"` XXX_sizecache int32 `json:"-"` }
func (*Seed) Descriptor ¶
func (*Seed) GetProtocol ¶
func (*Seed) ProtoMessage ¶
func (*Seed) ProtoMessage()
func (*Seed) XXX_DiscardUnknown ¶
func (m *Seed) XXX_DiscardUnknown()
func (*Seed) XXX_Unmarshal ¶
Click to show internal directories.
Click to hide internal directories.