protocols_p2p

package
v0.0.2 Latest Latest
Warning

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

Go to latest
Published: Aug 3, 2018 License: Apache-2.0 Imports: 4 Imported by: 0

README

Info

See:

  1. golang/protobuf
  2. gogo/protobutf
  3. libp2p/go-libp2p/examples/multipro

Installation

First, install protobuffs. Then:

$ go get github.com/gogo/protobuf/protoc-gen-gogofast

Usage

$ protoc -I=. -I=$GOPATH/src -I=$GOPATH/src/github.com/gogo/protobuf/protobuf --gogofast_out=. p2p.proto

Documentation

Overview

Package protocols_p2p is a generated protocol buffer package.

It is generated from these files:

p2p.proto

It has these top-level messages:

MessageData
EchoRequest
EchoResponse
HeadBlockRequest
HeadBlockResponse
ProcessTransactionRequest
ProcessTransactionResponse

Index

Constants

This section is empty.

Variables

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

Functions

This section is empty.

Types

type EchoRequest

type EchoRequest struct {
	MessageData *MessageData `protobuf:"bytes,1,opt,name=messageData" json:"messageData,omitempty"`
	// method specific data
	Message string `protobuf:"bytes,2,opt,name=message,proto3" json:"message,omitempty"`
}

a protocol define a set of reuqest and responses

func (*EchoRequest) Descriptor

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

func (*EchoRequest) GetMessage

func (m *EchoRequest) GetMessage() string

func (*EchoRequest) GetMessageData

func (m *EchoRequest) GetMessageData() *MessageData

func (*EchoRequest) Marshal

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

func (*EchoRequest) MarshalTo

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

func (*EchoRequest) ProtoMessage

func (*EchoRequest) ProtoMessage()

func (*EchoRequest) Reset

func (m *EchoRequest) Reset()

func (*EchoRequest) Size

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

func (*EchoRequest) String

func (m *EchoRequest) String() string

func (*EchoRequest) Unmarshal

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

type EchoResponse

type EchoResponse struct {
	MessageData *MessageData `protobuf:"bytes,1,opt,name=messageData" json:"messageData,omitempty"`
	// response specific data
	Message string `protobuf:"bytes,2,opt,name=message,proto3" json:"message,omitempty"`
}

func (*EchoResponse) Descriptor

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

func (*EchoResponse) GetMessage

func (m *EchoResponse) GetMessage() string

func (*EchoResponse) GetMessageData

func (m *EchoResponse) GetMessageData() *MessageData

func (*EchoResponse) Marshal

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

func (*EchoResponse) MarshalTo

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

func (*EchoResponse) ProtoMessage

func (*EchoResponse) ProtoMessage()

func (*EchoResponse) Reset

func (m *EchoResponse) Reset()

func (*EchoResponse) Size

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

func (*EchoResponse) String

func (m *EchoResponse) String() string

func (*EchoResponse) Unmarshal

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

type HeadBlockRequest

type HeadBlockRequest struct {
	MessageData *MessageData `protobuf:"bytes,1,opt,name=messageData" json:"messageData,omitempty"`
}

a protocol define a set of reuqest and responses

func (*HeadBlockRequest) Descriptor

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

func (*HeadBlockRequest) GetMessageData

func (m *HeadBlockRequest) GetMessageData() *MessageData

func (*HeadBlockRequest) Marshal

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

func (*HeadBlockRequest) MarshalTo

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

func (*HeadBlockRequest) ProtoMessage

func (*HeadBlockRequest) ProtoMessage()

func (*HeadBlockRequest) Reset

func (m *HeadBlockRequest) Reset()

func (*HeadBlockRequest) Size

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

func (*HeadBlockRequest) String

func (m *HeadBlockRequest) String() string

func (*HeadBlockRequest) Unmarshal

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

type HeadBlockResponse

type HeadBlockResponse struct {
	MessageData *MessageData `protobuf:"bytes,1,opt,name=messageData" json:"messageData,omitempty"`
	// response specific data
	HeadBlockBytes []byte `protobuf:"bytes,2,opt,name=headBlockBytes,proto3" json:"headBlockBytes,omitempty"`
}

func (*HeadBlockResponse) Descriptor

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

func (*HeadBlockResponse) GetHeadBlockBytes

func (m *HeadBlockResponse) GetHeadBlockBytes() []byte

func (*HeadBlockResponse) GetMessageData

func (m *HeadBlockResponse) GetMessageData() *MessageData

func (*HeadBlockResponse) Marshal

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

func (*HeadBlockResponse) MarshalTo

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

func (*HeadBlockResponse) ProtoMessage

func (*HeadBlockResponse) ProtoMessage()

func (*HeadBlockResponse) Reset

func (m *HeadBlockResponse) Reset()

func (*HeadBlockResponse) Size

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

func (*HeadBlockResponse) String

func (m *HeadBlockResponse) String() string

func (*HeadBlockResponse) Unmarshal

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

type MessageData

type MessageData struct {
	// shared between all requests
	ClientVersion string `protobuf:"bytes,1,opt,name=clientVersion,proto3" json:"clientVersion,omitempty"`
	Timestamp     int64  `protobuf:"varint,2,opt,name=timestamp,proto3" json:"timestamp,omitempty"`
	Id            string `protobuf:"bytes,3,opt,name=id,proto3" json:"id,omitempty"`
	Gossip        bool   `protobuf:"varint,4,opt,name=gossip,proto3" json:"gossip,omitempty"`
	NodeId        string `protobuf:"bytes,5,opt,name=nodeId,proto3" json:"nodeId,omitempty"`
	NodePubKey    []byte `protobuf:"bytes,6,opt,name=nodePubKey,proto3" json:"nodePubKey,omitempty"`
	Sign          string `protobuf:"bytes,7,opt,name=sign,proto3" json:"sign,omitempty"`
}

https://github.com/libp2p/go-libp2p/blob/master/examples/multipro/pb/p2p.proto designed to be shared between all app protocols

func (*MessageData) Descriptor

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

func (*MessageData) GetClientVersion

func (m *MessageData) GetClientVersion() string

func (*MessageData) GetGossip

func (m *MessageData) GetGossip() bool

func (*MessageData) GetId

func (m *MessageData) GetId() string

func (*MessageData) GetNodeId

func (m *MessageData) GetNodeId() string

func (*MessageData) GetNodePubKey

func (m *MessageData) GetNodePubKey() []byte

func (*MessageData) GetSign

func (m *MessageData) GetSign() string

func (*MessageData) GetTimestamp

func (m *MessageData) GetTimestamp() int64

func (*MessageData) Marshal

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

func (*MessageData) MarshalTo

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

func (*MessageData) ProtoMessage

func (*MessageData) ProtoMessage()

func (*MessageData) Reset

func (m *MessageData) Reset()

func (*MessageData) Size

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

func (*MessageData) String

func (m *MessageData) String() string

func (*MessageData) Unmarshal

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

type ProcessTransactionRequest

type ProcessTransactionRequest struct {
	MessageData *MessageData `protobuf:"bytes,1,opt,name=messageData" json:"messageData,omitempty"`
	TxBytes     []byte       `protobuf:"bytes,2,opt,name=txBytes,proto3" json:"txBytes,omitempty"`
}

a protocol define a set of reuqest and responses

func (*ProcessTransactionRequest) Descriptor

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

func (*ProcessTransactionRequest) GetMessageData

func (m *ProcessTransactionRequest) GetMessageData() *MessageData

func (*ProcessTransactionRequest) GetTxBytes

func (m *ProcessTransactionRequest) GetTxBytes() []byte

func (*ProcessTransactionRequest) Marshal

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

func (*ProcessTransactionRequest) MarshalTo

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

func (*ProcessTransactionRequest) ProtoMessage

func (*ProcessTransactionRequest) ProtoMessage()

func (*ProcessTransactionRequest) Reset

func (m *ProcessTransactionRequest) Reset()

func (*ProcessTransactionRequest) Size

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

func (*ProcessTransactionRequest) String

func (m *ProcessTransactionRequest) String() string

func (*ProcessTransactionRequest) Unmarshal

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

type ProcessTransactionResponse

type ProcessTransactionResponse struct {
	MessageData *MessageData `protobuf:"bytes,1,opt,name=messageData" json:"messageData,omitempty"`
	// response specific data
	Success bool   `protobuf:"varint,2,opt,name=success,proto3" json:"success,omitempty"`
	Message string `protobuf:"bytes,3,opt,name=message,proto3" json:"message,omitempty"`
	Hash    string `protobuf:"bytes,4,opt,name=hash,proto3" json:"hash,omitempty"`
}

func (*ProcessTransactionResponse) Descriptor

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

func (*ProcessTransactionResponse) GetHash

func (m *ProcessTransactionResponse) GetHash() string

func (*ProcessTransactionResponse) GetMessage

func (m *ProcessTransactionResponse) GetMessage() string

func (*ProcessTransactionResponse) GetMessageData

func (m *ProcessTransactionResponse) GetMessageData() *MessageData

func (*ProcessTransactionResponse) GetSuccess

func (m *ProcessTransactionResponse) GetSuccess() bool

func (*ProcessTransactionResponse) Marshal

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

func (*ProcessTransactionResponse) MarshalTo

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

func (*ProcessTransactionResponse) ProtoMessage

func (*ProcessTransactionResponse) ProtoMessage()

func (*ProcessTransactionResponse) Reset

func (m *ProcessTransactionResponse) Reset()

func (*ProcessTransactionResponse) Size

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

func (*ProcessTransactionResponse) String

func (m *ProcessTransactionResponse) String() string

func (*ProcessTransactionResponse) Unmarshal

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

Jump to

Keyboard shortcuts

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