Documentation ¶
Index ¶
- type ProtobufGuide
- type ProtobufMessage
- func (protoMessage *ProtobufMessage) SendToAddress(address string) error
- func (protoMessage *ProtobufMessage) SendToAddressResult(address string) ([]byte, error)
- func (protoMessage *ProtobufMessage) SendToShard(shardAddress string, port int) error
- func (protoMessage *ProtobufMessage) SendToShardResult(shardAddress string, port int) ([]byte, error)
- func (protoMessage *ProtobufMessage) String() string
- func (protoMessage *ProtobufMessage) ToBytes() ([]byte, error)
- type Test
- func (*Test) Descriptor() ([]byte, []int)
- func (m *Test) GetTest() string
- func (m *Test) GetTest2() string
- func (*Test) ProtoMessage()
- func (m *Test) Reset()
- func (m *Test) String() string
- func (m *Test) XXX_DiscardUnknown()
- func (m *Test) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)
- func (m *Test) XXX_Merge(src proto.Message)
- func (m *Test) XXX_Size() int
- func (m *Test) XXX_Unmarshal(b []byte) error
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type ProtobufGuide ¶
type ProtobufGuide struct { ProtoID string // ProtoID - determines 'class' of protofile (specified by user) ProtoGuide []byte // ProtoGuide - serialized proto file, used for reading of protobuf message GoGuide []byte // GoGuide - serialized golang support file, used for reading of protobuf message }
ProtobufGuide - container holding metadata/supporting proto file
func NewProtobufGuide ¶
func NewProtobufGuide(protofilePath string, protoID string) (*ProtobufGuide, error)
NewProtobufGuide - initialize and register protobuf message guide
func ReadGuideFromMemory ¶
func ReadGuideFromMemory(path string) (*ProtobufGuide, error)
ReadGuideFromMemory - read protobufGuide from memory
func (*ProtobufGuide) WriteToMemory ¶
func (protoGuide *ProtobufGuide) WriteToMemory(path string) error
WriteToMemory - write protobufGuide to memory
type ProtobufMessage ¶
type ProtobufMessage struct { Message []byte // Message - serialized protobuf message Guide *ProtobufGuide // Guide - messag protobuf guide }
ProtobufMessage - container holding protobuf message, metadata/supporting proto file
func FromBytes ¶
func FromBytes(b []byte) (*ProtobufMessage, error)
FromBytes - attempt to decode byte array to protobufMessage
func NewProtobufMessage ¶
func NewProtobufMessage(guidePath string, data []byte) (*ProtobufMessage, error)
NewProtobufMessage - initialize protobuf message
func (*ProtobufMessage) SendToAddress ¶
func (protoMessage *ProtobufMessage) SendToAddress(address string) error
SendToAddress - common.SendBytes() wrapper
func (*ProtobufMessage) SendToAddressResult ¶
func (protoMessage *ProtobufMessage) SendToAddressResult(address string) ([]byte, error)
SendToAddressResult - common.SendBytesResult() wrapper
func (*ProtobufMessage) SendToShard ¶
func (protoMessage *ProtobufMessage) SendToShard(shardAddress string, port int) error
SendToShard - shard.SendBytesShard() wrapper
func (*ProtobufMessage) SendToShardResult ¶
func (protoMessage *ProtobufMessage) SendToShardResult(shardAddress string, port int) ([]byte, error)
SendToShardResult - shard.SendBytesShardResult() wrapper
func (*ProtobufMessage) String ¶
func (protoMessage *ProtobufMessage) String() string
String - convert message to string
func (*ProtobufMessage) ToBytes ¶
func (protoMessage *ProtobufMessage) ToBytes() ([]byte, error)
ToBytes - common.SerializeToBytes() protobufMessage wrapper
type Test ¶
type Test struct { Test string `protobuf:"bytes,1,opt,name=test,proto3" json:"test,omitempty"` Test2 string `protobuf:"bytes,2,opt,name=test2,proto3" json:"test2,omitempty"` XXX_NoUnkeyedLiteral struct{} `json:"-"` XXX_unrecognized []byte `json:"-"` XXX_sizecache int32 `json:"-"` }
func (*Test) Descriptor ¶
func (*Test) ProtoMessage ¶
func (*Test) ProtoMessage()
func (*Test) XXX_DiscardUnknown ¶
func (m *Test) XXX_DiscardUnknown()