internal

package
v1.0.0-beta.25 Latest Latest
Warning

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

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

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	UserTableKeyPrefix = []byte("data")
	PartitionKeyPrefix = []byte("part")
	CacheKeyPrefix     = "cache"
)

Functions

func Encode

func Encode(data *TableData) ([]byte, error)

Encode is used to encode data to the raw bytes which is used to store in storage as value. The first byte is storing the type corresponding to this Data. This is important and used by the decoder later to decode back.

func EncodeCacheData

func EncodeCacheData(data *CacheData) ([]byte, error)

func EncodeStreamData

func EncodeStreamData(event *StreamData) ([]byte, error)

Types

type DataType

type DataType byte

DataType is to define the different data types for the data stored in the storage engine.

const (
	Unknown DataType = iota
	TableDataType
	CacheDataType
	StreamDataType
)

Note: Do not change the order. Order is important because encoder is adding the type as the first byte. Check the Encode/Decode method to see how it is getting used.

type UserDataEncType

type UserDataEncType int8
const (
	MsgpackEncoding UserDataEncType = 1
	JsonEncoding    UserDataEncType = 2
)

Jump to

Keyboard shortcuts

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