protobuf_object

package
v0.0.0-...-c92cbe1 Latest Latest
Warning

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

Go to latest
Published: Dec 24, 2023 License: Apache-2.0 Imports: 6 Imported by: 0

README

ProtoBuf Object

Overview

Protocol Buffers is a very nice modeling & optimized serialization method developed by Google, supporting generating binding to multiple languages from a single model definition. However, it is missing a key feature, the Protobuf Object. You cannot define an attribute of a protobuf message as generic/object, e.g. can be anything.

Why is Protobuf Object important?

Simple, without a Protobuf Object a MicroService cannot update its peers on Delta Changes within its model and must share the entire model instance. This is a major drawback when the microservice model is a complex tree structure, with millions of instances.

Generic/Object implementation

In preparation to support Delta Notifications between MicroServices, ProtobufObject was implemented as a vessel/infra to allow the capability of one MicroService to Delta Notify another MicroService with model changes in an optimal and optimized way & extremely reduce, over the wire, network utilization.

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Bool

type Bool struct{}

func (*Bool) Add

func (_type *Bool) Add(any interface{}) ([]byte, int)

func (*Bool) Get

func (_type *Bool) Get(data []byte, location int) (interface{}, int)

type Float32

type Float32 struct{}

func (*Float32) Add

func (_type *Float32) Add(any interface{}) ([]byte, int)

func (*Float32) Get

func (_type *Float32) Get(data []byte, location int) (interface{}, int)

type Float64

type Float64 struct{}

func (*Float64) Add

func (_type *Float64) Add(any interface{}) ([]byte, int)

func (*Float64) Get

func (_type *Float64) Get(data []byte, location int) (interface{}, int)

type Int

type Int struct{}

func (*Int) Add

func (_type *Int) Add(any interface{}) ([]byte, int)

func (*Int) Get

func (_type *Int) Get(data []byte, location int) (interface{}, int)

type Int32

type Int32 struct{}

func (*Int32) Add

func (_type *Int32) Add(any interface{}) ([]byte, int)

func (*Int32) Get

func (_type *Int32) Get(data []byte, location int) (interface{}, int)

type Int64

type Int64 struct{}

func (*Int64) Add

func (_type *Int64) Add(any interface{}) ([]byte, int)

func (*Int64) Get

func (_type *Int64) Get(data []byte, location int) (interface{}, int)

type Map

type Map struct{}

func (*Map) Add

func (_type *Map) Add(any interface{}) ([]byte, int)

func (*Map) Get

func (_type *Map) Get(data []byte, location int) (interface{}, int)

type Proto

type Proto struct {
}

func (*Proto) Add

func (_type *Proto) Add(any interface{}) ([]byte, int)

func (*Proto) Get

func (_type *Proto) Get(data []byte, location int) (interface{}, int)

type ProtobufObject

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

func NewProtobufObject

func NewProtobufObject(data []byte, location int) *ProtobufObject

func (*ProtobufObject) Add

func (obj *ProtobufObject) Add(any interface{}) error

func (*ProtobufObject) Data

func (obj *ProtobufObject) Data() []byte

func (*ProtobufObject) Get

func (obj *ProtobufObject) Get() (interface{}, error)

func (*ProtobufObject) Location

func (obj *ProtobufObject) Location() int

type Slice

type Slice struct{}

func (*Slice) Add

func (_type *Slice) Add(any interface{}) ([]byte, int)

func (*Slice) Get

func (_type *Slice) Get(data []byte, location int) (interface{}, int)

type String

type String struct{}

func (*String) Add

func (_type *String) Add(any interface{}) ([]byte, int)

func (*String) Get

func (_type *String) Get(data []byte, location int) (interface{}, int)

type UInt32

type UInt32 struct{}

func (*UInt32) Add

func (_type *UInt32) Add(any interface{}) ([]byte, int)

func (*UInt32) Get

func (_type *UInt32) Get(data []byte, location int) (interface{}, int)

type UInt64

type UInt64 struct{}

func (*UInt64) Add

func (_type *UInt64) Add(any interface{}) ([]byte, int)

func (*UInt64) Get

func (_type *UInt64) Get(data []byte, location int) (interface{}, int)

Jump to

Keyboard shortcuts

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