netlibp2p

package module
v0.0.0-...-359f6b4 Latest Latest
Warning

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

Go to latest
Published: Oct 20, 2018 License: GPL-3.0 Imports: 26 Imported by: 0

Documentation

Index

Constants

View Source
const ConversationProtocol = "/blocktop/conversation/" + ConversationProtocolVersion
View Source
const ConversationProtocolVersion = "0.0.1"

Variables

This section is empty.

Functions

This section is empty.

Types

type ConversationMessage

type ConversationMessage struct {
	Version              string            `protobuf:"bytes,5,opt,name=version,proto3" json:"version,omitempty"`
	ID                   string            `protobuf:"bytes,10,opt,name=ID,proto3" json:"ID,omitempty"`
	Protocol             string            `protobuf:"bytes,15,opt,name=protocol,proto3" json:"protocol,omitempty"`
	From                 string            `protobuf:"bytes,20,opt,name=from,proto3" json:"from,omitempty"`
	Timestamp            int64             `protobuf:"varint,25,opt,name=timestamp,proto3" json:"timestamp,omitempty"`
	Hash                 string            `protobuf:"bytes,30,opt,name=hash,proto3" json:"hash,omitempty"`
	Signature            string            `protobuf:"bytes,35,opt,name=signature,proto3" json:"signature,omitempty"`
	PubKey               string            `protobuf:"bytes,40,opt,name=pubKey,proto3" json:"pubKey,omitempty"`
	HangUp               bool              `protobuf:"varint,45,opt,name=hangUp,proto3" json:"hangUp,omitempty"`
	Data                 []byte            `protobuf:"bytes,50,opt,name=data,proto3" json:"data,omitempty"`
	Links                map[string]string `` /* 152-byte string literal not displayed */
	XXX_NoUnkeyedLiteral struct{}          `json:"-"`
	XXX_unrecognized     []byte            `json:"-"`
	XXX_sizecache        int32             `json:"-"`
}

func (*ConversationMessage) Descriptor

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

func (*ConversationMessage) GetData

func (m *ConversationMessage) GetData() []byte

func (*ConversationMessage) GetFrom

func (m *ConversationMessage) GetFrom() string

func (*ConversationMessage) GetHangUp

func (m *ConversationMessage) GetHangUp() bool

func (*ConversationMessage) GetHash

func (m *ConversationMessage) GetHash() string

func (*ConversationMessage) GetID

func (m *ConversationMessage) GetID() string
func (m *ConversationMessage) GetLinks() map[string]string

func (*ConversationMessage) GetProtocol

func (m *ConversationMessage) GetProtocol() string

func (*ConversationMessage) GetPubKey

func (m *ConversationMessage) GetPubKey() string

func (*ConversationMessage) GetSignature

func (m *ConversationMessage) GetSignature() string

func (*ConversationMessage) GetTimestamp

func (m *ConversationMessage) GetTimestamp() int64

func (*ConversationMessage) GetVersion

func (m *ConversationMessage) GetVersion() string

func (*ConversationMessage) ProtoMessage

func (*ConversationMessage) ProtoMessage()

func (*ConversationMessage) Reset

func (m *ConversationMessage) Reset()

func (*ConversationMessage) String

func (m *ConversationMessage) String() string

func (*ConversationMessage) XXX_DiscardUnknown

func (m *ConversationMessage) XXX_DiscardUnknown()

func (*ConversationMessage) XXX_Marshal

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

func (*ConversationMessage) XXX_Merge

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

func (*ConversationMessage) XXX_Size

func (m *ConversationMessage) XXX_Size() int

func (*ConversationMessage) XXX_Unmarshal

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

type DiscoveryNotifee

type DiscoveryNotifee struct {
	// contains filtered or unexported fields
}

func (*DiscoveryNotifee) HandlePeerFound

func (n *DiscoveryNotifee) HandlePeerFound(pi pstore.PeerInfo)

type NetworkNode

type NetworkNode struct {
	PublicKey        string
	PrivateKey       string
	Host             p2phost.Host
	Bootstrapper     *boot.Bootstrap
	DiscoveryService discovery.Service
	// contains filtered or unexported fields
}

func NewNode

func NewNode() (*NetworkNode, error)

func (*NetworkNode) Bootstrap

func (n *NetworkNode) Bootstrap(ctx context.Context) error

func (*NetworkNode) Broadcast

func (n *NetworkNode) Broadcast(netMsgs []*spec.NetworkMessage)

func (*NetworkNode) Close

func (n *NetworkNode) Close()

func (*NetworkNode) Listen

func (n *NetworkNode) Listen(ctx context.Context)

func (*NetworkNode) OnMessageReceived

func (n *NetworkNode) OnMessageReceived(f spec.MessageReceiver)

func (*NetworkNode) PeerID

func (n *NetworkNode) PeerID() string

func (*NetworkNode) Sign

func (n *NetworkNode) Sign(data []byte) ([]byte, error)

func (*NetworkNode) Verify

func (n *NetworkNode) Verify(peerID string, data []byte, sig []byte, pubKey []byte) (bool, error)

Jump to

Keyboard shortcuts

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