message

package
v0.1.0 Latest Latest
Warning

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

Go to latest
Published: Feb 24, 2018 License: Apache-2.0 Imports: 5 Imported by: 0

Documentation

Overview

Package message is a generated protocol buffer package.

It is generated from these files:

common.proto
service.proto
stream.proto

It has these top-level messages:

Empty
Transaction
TxData
Params
Envelope
StreamMessage
Block
ConnectionEstablish
PeerTable
Peer
ConsensusMessage
View
ElectionMessage

Index

Constants

This section is empty.

Variables

View Source
var Transaction_Status_name = map[int32]string{
	0: "UNCONFIRMED",
	1: "CONFIRMED",
	2: "UNKNOWN",
}
View Source
var Transaction_Status_value = map[string]int32{
	"UNCONFIRMED": 0,
	"CONFIRMED":   1,
	"UNKNOWN":     2,
}
View Source
var TxData_TxDataType_name = map[int32]string{
	0: "Invoke",
	1: "Query",
}
View Source
var TxData_TxDataType_value = map[string]int32{
	"Invoke": 0,
	"Query":  1,
}

Functions

func RegisterPeerServiceServer

func RegisterPeerServiceServer(s *grpc.Server, srv PeerServiceServer)

func RegisterStreamServiceServer

func RegisterStreamServiceServer(s *grpc.Server, srv StreamServiceServer)

func RegisterTransactionServiceServer

func RegisterTransactionServiceServer(s *grpc.Server, srv TransactionServiceServer)

Types

type Block

type Block struct {
	Data []byte `protobuf:"bytes,1,opt,name=data,proto3" json:"data,omitempty"`
}

func (*Block) Descriptor

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

func (*Block) GetData

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

func (*Block) ProtoMessage

func (*Block) ProtoMessage()

func (*Block) Reset

func (m *Block) Reset()

func (*Block) String

func (m *Block) String() string

type ConnectionEstablish

type ConnectionEstablish struct {
}

func (*ConnectionEstablish) Descriptor

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

func (*ConnectionEstablish) ProtoMessage

func (*ConnectionEstablish) ProtoMessage()

func (*ConnectionEstablish) Reset

func (m *ConnectionEstablish) Reset()

func (*ConnectionEstablish) String

func (m *ConnectionEstablish) String() string

type ConsensusMessage

type ConsensusMessage struct {
	ConsensusID string `protobuf:"bytes,1,opt,name=ConsensusID" json:"ConsensusID,omitempty"`
	View        *View  `protobuf:"bytes,2,opt,name=View" json:"View,omitempty"`
	SequenceID  int64  `protobuf:"varint,3,opt,name=SequenceID" json:"SequenceID,omitempty"`
	Block       *Block `protobuf:"bytes,4,opt,name=Block" json:"Block,omitempty"`
	SenderID    string `protobuf:"bytes,5,opt,name=SenderID" json:"SenderID,omitempty"`
	MsgType     int32  `protobuf:"varint,6,opt,name=MsgType" json:"MsgType,omitempty"`
}

func (*ConsensusMessage) Descriptor

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

func (*ConsensusMessage) GetBlock

func (m *ConsensusMessage) GetBlock() *Block

func (*ConsensusMessage) GetConsensusID

func (m *ConsensusMessage) GetConsensusID() string

func (*ConsensusMessage) GetMsgType

func (m *ConsensusMessage) GetMsgType() int32

func (*ConsensusMessage) GetSenderID

func (m *ConsensusMessage) GetSenderID() string

func (*ConsensusMessage) GetSequenceID

func (m *ConsensusMessage) GetSequenceID() int64

func (*ConsensusMessage) GetView

func (m *ConsensusMessage) GetView() *View

func (*ConsensusMessage) ProtoMessage

func (*ConsensusMessage) ProtoMessage()

func (*ConsensusMessage) Reset

func (m *ConsensusMessage) Reset()

func (*ConsensusMessage) String

func (m *ConsensusMessage) String() string

type ElectionMessage

type ElectionMessage struct {
	LastBlockHash string   `protobuf:"bytes,1,opt,name=LastBlockHash" json:"LastBlockHash,omitempty"`
	SenderID      string   `protobuf:"bytes,2,opt,name=SenderID" json:"SenderID,omitempty"`
	MsgType       int32    `protobuf:"varint,3,opt,name=MsgType" json:"MsgType,omitempty"`
	Term          int64    `protobuf:"varint,4,opt,name=Term" json:"Term,omitempty"`
	PeerIDs       []string `protobuf:"bytes,5,rep,name=PeerIDs" json:"PeerIDs,omitempty"`
}

func (*ElectionMessage) Descriptor

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

func (*ElectionMessage) GetLastBlockHash

func (m *ElectionMessage) GetLastBlockHash() string

func (*ElectionMessage) GetMsgType

func (m *ElectionMessage) GetMsgType() int32

func (*ElectionMessage) GetPeerIDs

func (m *ElectionMessage) GetPeerIDs() []string

func (*ElectionMessage) GetSenderID

func (m *ElectionMessage) GetSenderID() string

func (*ElectionMessage) GetTerm

func (m *ElectionMessage) GetTerm() int64

func (*ElectionMessage) ProtoMessage

func (*ElectionMessage) ProtoMessage()

func (*ElectionMessage) Reset

func (m *ElectionMessage) Reset()

func (*ElectionMessage) String

func (m *ElectionMessage) String() string

type Empty

type Empty struct {
}

func (*Empty) Descriptor

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

func (*Empty) ProtoMessage

func (*Empty) ProtoMessage()

func (*Empty) Reset

func (m *Empty) Reset()

func (*Empty) String

func (m *Empty) String() string

type Envelope

type Envelope struct {
	// marshalled Message
	Payload []byte `protobuf:"bytes,1,opt,name=payload,proto3" json:"payload,omitempty"`
	// signed Message
	Signature []byte `protobuf:"bytes,2,opt,name=signature,proto3" json:"signature,omitempty"`
	// sender's public key
	Pubkey []byte `protobuf:"bytes,3,opt,name=pubkey,proto3" json:"pubkey,omitempty"`
}

func (*Envelope) Descriptor

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

func (*Envelope) GetMessage

func (envelope *Envelope) GetMessage() (*StreamMessage, error)

func (*Envelope) GetPayload

func (m *Envelope) GetPayload() []byte

func (*Envelope) GetPubkey

func (m *Envelope) GetPubkey() []byte

func (*Envelope) GetSignature

func (m *Envelope) GetSignature() []byte

func (*Envelope) ProtoMessage

func (*Envelope) ProtoMessage()

func (*Envelope) Reset

func (m *Envelope) Reset()

func (*Envelope) String

func (m *Envelope) String() string

type Params

type Params struct {
	ParamsType int32    `protobuf:"varint,1,opt,name=ParamsType" json:"ParamsType,omitempty"`
	Function   string   `protobuf:"bytes,2,opt,name=Function" json:"Function,omitempty"`
	Args       []string `protobuf:"bytes,3,rep,name=Args" json:"Args,omitempty"`
}

func (*Params) Descriptor

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

func (*Params) GetArgs

func (m *Params) GetArgs() []string

func (*Params) GetFunction

func (m *Params) GetFunction() string

func (*Params) GetParamsType

func (m *Params) GetParamsType() int32

func (*Params) ProtoMessage

func (*Params) ProtoMessage()

func (*Params) Reset

func (m *Params) Reset()

func (*Params) String

func (m *Params) String() string

type Peer

type Peer struct {
	IpAddress string `protobuf:"bytes,1,opt,name=ipAddress" json:"ipAddress,omitempty"`
	Port      string `protobuf:"bytes,2,opt,name=port" json:"port,omitempty"`
	PeerID    string `protobuf:"bytes,3,opt,name=peerID" json:"peerID,omitempty"`
	HeartBeat int32  `protobuf:"varint,4,opt,name=heartBeat" json:"heartBeat,omitempty"`
	PubKey    []byte `protobuf:"bytes,5,opt,name=pubKey,proto3" json:"pubKey,omitempty"`
}

func (*Peer) Descriptor

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

func (*Peer) GetHeartBeat

func (m *Peer) GetHeartBeat() int32

func (*Peer) GetIpAddress

func (m *Peer) GetIpAddress() string

func (*Peer) GetPeerID

func (m *Peer) GetPeerID() string

func (*Peer) GetPort

func (m *Peer) GetPort() string

func (*Peer) GetPubKey

func (m *Peer) GetPubKey() []byte

func (*Peer) ProtoMessage

func (*Peer) ProtoMessage()

func (*Peer) Reset

func (m *Peer) Reset()

func (*Peer) String

func (m *Peer) String() string

type PeerServiceClient

type PeerServiceClient interface {
	GetPeer(ctx context.Context, in *Empty, opts ...grpc.CallOption) (*Peer, error)
}

func NewPeerServiceClient

func NewPeerServiceClient(cc *grpc.ClientConn) PeerServiceClient

type PeerServiceServer

type PeerServiceServer interface {
	GetPeer(context.Context, *Empty) (*Peer, error)
}

type PeerTable

type PeerTable struct {
	MyID    string           `protobuf:"bytes,1,opt,name=MyID" json:"MyID,omitempty"`
	PeerMap map[string]*Peer `` /* 134-byte string literal not displayed */
}

func (*PeerTable) Descriptor

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

func (*PeerTable) GetMyID

func (m *PeerTable) GetMyID() string

func (*PeerTable) GetPeerMap

func (m *PeerTable) GetPeerMap() map[string]*Peer

func (*PeerTable) ProtoMessage

func (*PeerTable) ProtoMessage()

func (*PeerTable) Reset

func (m *PeerTable) Reset()

func (*PeerTable) String

func (m *PeerTable) String() string

type StreamMessage

type StreamMessage struct {
	Channel []byte `protobuf:"bytes,1,opt,name=channel,proto3" json:"channel,omitempty"`
	// Types that are valid to be assigned to Content:
	//	*StreamMessage_Block
	//	*StreamMessage_Transaction
	//	*StreamMessage_PeerTable
	//	*StreamMessage_ConsensusMessage
	//	*StreamMessage_Peer
	//	*StreamMessage_ConnectionEstablish
	//	*StreamMessage_ElectionMessage
	Content isStreamMessage_Content `protobuf_oneof:"content"`
}

func (*StreamMessage) Descriptor

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

func (*StreamMessage) GetBlock

func (m *StreamMessage) GetBlock() *Block

func (*StreamMessage) GetChannel

func (m *StreamMessage) GetChannel() []byte

func (*StreamMessage) GetConnectionEstablish

func (m *StreamMessage) GetConnectionEstablish() *ConnectionEstablish

func (*StreamMessage) GetConsensusMessage

func (m *StreamMessage) GetConsensusMessage() *ConsensusMessage

func (*StreamMessage) GetContent

func (m *StreamMessage) GetContent() isStreamMessage_Content

func (*StreamMessage) GetElectionMessage

func (m *StreamMessage) GetElectionMessage() *ElectionMessage

func (*StreamMessage) GetPeer

func (m *StreamMessage) GetPeer() *Peer

func (*StreamMessage) GetPeerTable

func (m *StreamMessage) GetPeerTable() *PeerTable

func (*StreamMessage) GetTransaction

func (m *StreamMessage) GetTransaction() *Transaction

func (*StreamMessage) ProtoMessage

func (*StreamMessage) ProtoMessage()

func (*StreamMessage) Reset

func (m *StreamMessage) Reset()

func (*StreamMessage) String

func (m *StreamMessage) String() string

func (*StreamMessage) XXX_OneofFuncs

func (*StreamMessage) XXX_OneofFuncs() (func(msg proto.Message, b *proto.Buffer) error, func(msg proto.Message, tag, wire int, b *proto.Buffer) (bool, error), func(msg proto.Message) (n int), []interface{})

XXX_OneofFuncs is for the internal use of the proto package.

type StreamMessage_Block

type StreamMessage_Block struct {
	Block *Block `protobuf:"bytes,2,opt,name=block,oneof"`
}

type StreamMessage_ConnectionEstablish

type StreamMessage_ConnectionEstablish struct {
	ConnectionEstablish *ConnectionEstablish `protobuf:"bytes,7,opt,name=connectionEstablish,oneof"`
}

type StreamMessage_ConsensusMessage

type StreamMessage_ConsensusMessage struct {
	ConsensusMessage *ConsensusMessage `protobuf:"bytes,5,opt,name=consensusMessage,oneof"`
}

type StreamMessage_ElectionMessage

type StreamMessage_ElectionMessage struct {
	ElectionMessage *ElectionMessage `protobuf:"bytes,8,opt,name=electionMessage,oneof"`
}

type StreamMessage_Peer

type StreamMessage_Peer struct {
	Peer *Peer `protobuf:"bytes,6,opt,name=peer,oneof"`
}

type StreamMessage_PeerTable

type StreamMessage_PeerTable struct {
	PeerTable *PeerTable `protobuf:"bytes,4,opt,name=peerTable,oneof"`
}

type StreamMessage_Transaction

type StreamMessage_Transaction struct {
	Transaction *Transaction `protobuf:"bytes,3,opt,name=transaction,oneof"`
}

type StreamServiceClient

type StreamServiceClient interface {
	Stream(ctx context.Context, opts ...grpc.CallOption) (StreamService_StreamClient, error)
}

func NewStreamServiceClient

func NewStreamServiceClient(cc *grpc.ClientConn) StreamServiceClient

type StreamServiceServer

type StreamServiceServer interface {
	Stream(StreamService_StreamServer) error
}

type StreamService_StreamClient

type StreamService_StreamClient interface {
	Send(*Envelope) error
	Recv() (*Envelope, error)
	grpc.ClientStream
}

type StreamService_StreamServer

type StreamService_StreamServer interface {
	Send(*Envelope) error
	Recv() (*Envelope, error)
	grpc.ServerStream
}

type Transaction

type Transaction struct {
	InvokePeerID      string             `protobuf:"bytes,1,opt,name=InvokePeerID" json:"InvokePeerID,omitempty"`
	TransactionID     string             `protobuf:"bytes,2,opt,name=TransactionID" json:"TransactionID,omitempty"`
	TransactionStatus Transaction_Status `protobuf:"varint,3,opt,name=TransactionStatus,enum=message.Transaction_Status" json:"TransactionStatus,omitempty"`
	TransactionHash   string             `protobuf:"bytes,4,opt,name=TransactionHash" json:"TransactionHash,omitempty"`
	TxData            *TxData            `protobuf:"bytes,5,opt,name=TxData" json:"TxData,omitempty"`
	TransactionType   int32              `protobuf:"varint,6,opt,name=TransactionType" json:"TransactionType,omitempty"`
	TimeStamp         int64              `protobuf:"varint,7,opt,name=TimeStamp" json:"TimeStamp,omitempty"`
}

func (*Transaction) Descriptor

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

func (*Transaction) GetInvokePeerID

func (m *Transaction) GetInvokePeerID() string

func (*Transaction) GetTimeStamp

func (m *Transaction) GetTimeStamp() int64

func (*Transaction) GetTransactionHash

func (m *Transaction) GetTransactionHash() string

func (*Transaction) GetTransactionID

func (m *Transaction) GetTransactionID() string

func (*Transaction) GetTransactionStatus

func (m *Transaction) GetTransactionStatus() Transaction_Status

func (*Transaction) GetTransactionType

func (m *Transaction) GetTransactionType() int32

func (*Transaction) GetTxData

func (m *Transaction) GetTxData() *TxData

func (*Transaction) ProtoMessage

func (*Transaction) ProtoMessage()

func (*Transaction) Reset

func (m *Transaction) Reset()

func (*Transaction) String

func (m *Transaction) String() string

type TransactionServiceClient

type TransactionServiceClient interface {
	PostTransaction(ctx context.Context, in *TxData, opts ...grpc.CallOption) (*Transaction, error)
}

func NewTransactionServiceClient

func NewTransactionServiceClient(cc *grpc.ClientConn) TransactionServiceClient

type TransactionServiceServer

type TransactionServiceServer interface {
	PostTransaction(context.Context, *TxData) (*Transaction, error)
}

type Transaction_Status

type Transaction_Status int32
const (
	Transaction_UNCONFIRMED Transaction_Status = 0
	Transaction_CONFIRMED   Transaction_Status = 1
	Transaction_UNKNOWN     Transaction_Status = 2
)

func (Transaction_Status) EnumDescriptor

func (Transaction_Status) EnumDescriptor() ([]byte, []int)

func (Transaction_Status) String

func (x Transaction_Status) String() string

type TxData

type TxData struct {
	Jsonrpc    string            `protobuf:"bytes,1,opt,name=Jsonrpc" json:"Jsonrpc,omitempty"`
	Method     TxData_TxDataType `protobuf:"varint,2,opt,name=Method,enum=message.TxData_TxDataType" json:"Method,omitempty"`
	Params     *Params           `protobuf:"bytes,3,opt,name=Params" json:"Params,omitempty"`
	ContractID string            `protobuf:"bytes,4,opt,name=ContractID" json:"ContractID,omitempty"`
}

func (*TxData) Descriptor

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

func (*TxData) GetContractID

func (m *TxData) GetContractID() string

func (*TxData) GetJsonrpc

func (m *TxData) GetJsonrpc() string

func (*TxData) GetMethod

func (m *TxData) GetMethod() TxData_TxDataType

func (*TxData) GetParams

func (m *TxData) GetParams() *Params

func (*TxData) ProtoMessage

func (*TxData) ProtoMessage()

func (*TxData) Reset

func (m *TxData) Reset()

func (*TxData) String

func (m *TxData) String() string

type TxData_TxDataType

type TxData_TxDataType int32
const (
	TxData_Invoke TxData_TxDataType = 0
	TxData_Query  TxData_TxDataType = 1
)

func (TxData_TxDataType) EnumDescriptor

func (TxData_TxDataType) EnumDescriptor() ([]byte, []int)

func (TxData_TxDataType) String

func (x TxData_TxDataType) String() string

type View

type View struct {
	ViewID   string   `protobuf:"bytes,1,opt,name=ViewID" json:"ViewID,omitempty"`
	LeaderID string   `protobuf:"bytes,2,opt,name=LeaderID" json:"LeaderID,omitempty"`
	PeerID   []string `protobuf:"bytes,3,rep,name=PeerID" json:"PeerID,omitempty"`
}

func (*View) Descriptor

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

func (*View) GetLeaderID

func (m *View) GetLeaderID() string

func (*View) GetPeerID

func (m *View) GetPeerID() []string

func (*View) GetViewID

func (m *View) GetViewID() string

func (*View) ProtoMessage

func (*View) ProtoMessage()

func (*View) Reset

func (m *View) Reset()

func (*View) String

func (m *View) String() string

Jump to

Keyboard shortcuts

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