encoding

package
v0.0.0-...-be15534 Latest Latest
Warning

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

Go to latest
Published: Apr 30, 2024 License: Apache-2.0 Imports: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func DecodeCRTs

func DecodeCRTs(key []byte) uint64

DecodeCRTs decodes CRTs from the given key.

func DecodeKey

func DecodeKey(key []byte) (uniqueID uint32, tableID uint64, startTs, CRTs uint64)

DecodeKey decodes a key to uniqueID, tableID, startTs, CRTs.

func EncodeKey

func EncodeKey(uniqueID uint32, tableID uint64, event *model.PolymorphicEvent) []byte

EncodeKey encodes a key according to event. Format: uniqueID, tableID, CRTs, startTs, delete/update/insert, Key.

func EncodeTsKey

func EncodeTsKey(uniqueID uint32, tableID uint64, CRTs uint64, startTs ...uint64) []byte

EncodeTsKey encodes uniqueID, tableID, CRTs and StartTs. StartTs is optional.

Types

type MsgPackGenSerde

type MsgPackGenSerde struct{}

MsgPackGenSerde encodes model.PolymorphicEvent into bytes and decodes model.PolymorphicEvent from bytes.

func (*MsgPackGenSerde) Marshal

func (m *MsgPackGenSerde) Marshal(event *model.PolymorphicEvent, bytes []byte) ([]byte, error)

Marshal encodes model.PolymorphicEvent into bytes.

func (*MsgPackGenSerde) Unmarshal

func (m *MsgPackGenSerde) Unmarshal(event *model.PolymorphicEvent, bytes []byte) ([]byte, error)

Unmarshal decodes model.PolymorphicEvent from bytes.

type SerializerDeserializer

type SerializerDeserializer interface {
	Marshal(event *model.PolymorphicEvent, bytes []byte) ([]byte, error)
	Unmarshal(event *model.PolymorphicEvent, bytes []byte) ([]byte, error)
}

SerializerDeserializer is the interface encodes and decodes model.PolymorphicEvent.

Jump to

Keyboard shortcuts

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