badgerpb4.pb.go
badgerpb4.pb.go - Overview
This file defines the protocol buffer messages used for data serialization and communication within the Badger database.
Detailed Documentation
EncryptionAlgo
type EncryptionAlgo int32
Purpose: Enumerates the encryption algorithms supported.
Constants:
EncryptionAlgo_aes
: Represents the AES encryption algorithm.
Enum()
func (x EncryptionAlgo) Enum() *EncryptionAlgo
Purpose: Returns a pointer to the EncryptionAlgo
enum.
Returns: A pointer to the EncryptionAlgo
enum.
String()
func (x EncryptionAlgo) String() string
Purpose: Returns the string representation of the EncryptionAlgo
enum.
Returns: The string representation of the EncryptionAlgo
enum.
Descriptor()
func (EncryptionAlgo) Descriptor() protoreflect.EnumDescriptor
Purpose: Returns the descriptor of the EncryptionAlgo
enum.
Returns: The descriptor of the EncryptionAlgo
enum.
Type()
func (EncryptionAlgo) Type() protoreflect.EnumType
Purpose: Returns the type of the EncryptionAlgo
enum.
Returns: The type of the EncryptionAlgo
enum.
Number()
func (x EncryptionAlgo) Number() protoreflect.EnumNumber
Purpose: Returns the number of the EncryptionAlgo
enum.
Returns: The number of the EncryptionAlgo
enum.
EnumDescriptor()
func (EncryptionAlgo) EnumDescriptor() ([]byte, []int)
Purpose: Deprecated: Use EncryptionAlgo.Descriptor
instead.
Returns: A byte slice and an integer slice.
ManifestChange_Operation
type ManifestChange_Operation int32
Purpose: Enumerates the operations that can be performed on a manifest change.
Constants:
ManifestChange_CREATE
: Represents a create operation.ManifestChange_DELETE
: Represents a delete operation.
Enum()
func (x ManifestChange_Operation) Enum() *ManifestChange_Operation
Purpose: Returns a pointer to the ManifestChange_Operation
enum.
Returns: A pointer to the ManifestChange_Operation
enum.
String()
func (x ManifestChange_Operation) String() string
Purpose: Returns the string representation of the ManifestChange_Operation
enum.
Returns: The string representation of the ManifestChange_Operation
enum.
Descriptor()
func (ManifestChange_Operation) Descriptor() protoreflect.EnumDescriptor
Purpose: Returns the descriptor of the ManifestChange_Operation
enum.
Returns: The descriptor of the ManifestChange_Operation
enum.
Type()
func (ManifestChange_Operation) Type() protoreflect.EnumType
Purpose: Returns the type of the ManifestChange_Operation
enum.
Returns: The type of the ManifestChange_Operation
enum.
Number()
func (x ManifestChange_Operation) Number() protoreflect.EnumNumber
Purpose: Returns the number of the ManifestChange_Operation
enum.
Returns: The number of the ManifestChange_Operation
enum.
EnumDescriptor()
func (ManifestChange_Operation) EnumDescriptor() ([]byte, []int)
Purpose: Deprecated: Use ManifestChange_Operation.Descriptor
instead.
Returns: A byte slice and an integer slice.
Checksum_Algorithm
type Checksum_Algorithm int32
Purpose: Enumerates the checksum algorithms supported.
Constants:
Checksum_CRC32C
: Represents the CRC32C checksum algorithm.Checksum_XXHash64
: Represents the XXHash64 checksum algorithm.
Enum()
func (x Checksum_Algorithm) Enum() *Checksum_Algorithm
Purpose: Returns a pointer to the Checksum_Algorithm
enum.
Returns: A pointer to the Checksum_Algorithm
enum.
String()
func (x Checksum_Algorithm) String() string
Purpose: Returns the string representation of the Checksum_Algorithm
enum.
Returns: The string representation of the Checksum_Algorithm
enum.
Descriptor()
func (Checksum_Algorithm) Descriptor() protoreflect.EnumDescriptor
Purpose: Returns the descriptor of the Checksum_Algorithm
enum.
Returns: The descriptor of the Checksum_Algorithm
enum.
Type()
func (Checksum_Algorithm) Type() protoreflect.EnumType
Purpose: Returns the type of the Checksum_Algorithm
enum.
Returns: The type of the Checksum_Algorithm
enum.
Number()
func (x Checksum_Algorithm) Number() protoreflect.EnumNumber
Purpose: Returns the number of the Checksum_Algorithm
enum.
Returns: The number of the Checksum_Algorithm
enum.
EnumDescriptor()
func (Checksum_Algorithm) EnumDescriptor() ([]byte, []int)
Purpose: Deprecated: Use Checksum_Algorithm.Descriptor
instead.
Returns: A byte slice and an integer slice.
KV
type KV struct {
state protoimpl.MessageState
sizeCache protoimpl.SizeCache
unknownFields protoimpl.UnknownFields
Key []byte `protobuf:"bytes,1,opt,name=key,proto3" json:"key,omitempty"`
Value []byte `protobuf:"bytes,2,opt,name=value,proto3" json:"value,omitempty"`
UserMeta []byte `protobuf:"bytes,3,opt,name=user_meta,json=userMeta,proto3" json:"user_meta,omitempty"`
Version uint64 `protobuf:"varint,4,opt,name=version,proto3" json:"version,omitempty"`
ExpiresAt uint64 `protobuf:"varint,5,opt,name=expires_at,json=expiresAt,proto3" json:"expires_at,omitempty"`
Meta []byte `protobuf:"bytes,6,opt,name=meta,proto3" json:"meta,omitempty"`
// Stream id is used to identify which stream the KV came from.
StreamId uint32 `protobuf:"varint,10,opt,name=stream_id,json=streamId,proto3" json:"stream_id,omitempty"`
// Stream done is used to indicate end of stream.
StreamDone bool `protobuf:"varint,11,opt,name=stream_done,json=streamDone,proto3" json:"stream_done,omitempty"`
}
Purpose: Represents a key-value pair.
Parameters:
Key
: The key as a byte slice.Value
: The value as a byte slice.UserMeta
: User-defined metadata as a byte slice.Version
: The version of the key-value pair.ExpiresAt
: The expiration timestamp of the key-value pair.Meta
: Metadata as a byte slice.StreamId
: Identifier of the stream.StreamDone
: Indicates if the stream is done.
Reset()
func (x *KV) Reset()
Purpose: Resets the KV struct to its default values.
String()
func (x *KV) String() string
Purpose: Returns the string representation of the KV struct. Returns: The string representation of the KV struct.
ProtoMessage()
func (*KV) ProtoMessage()
Purpose: This method is empty.
ProtoReflect()
func (x *KV) ProtoReflect() protoreflect.Message
Purpose: Returns the reflection interface for the KV struct. Returns: The reflection interface for the KV struct.
Descriptor()
func (*KV) Descriptor() ([]byte, []int)
Purpose: Deprecated: Use KV.ProtoReflect.Descriptor
instead.
Returns: A byte slice and an integer slice.
GetKey()
func (x *KV) GetKey() []byte
Purpose: Returns the key. Returns: The key as a byte slice.
GetValue()
func (x *KV) GetValue() []byte
Purpose: Returns the value. Returns: The value as a byte slice.
GetUserMeta()
func (x *KV) GetUserMeta() []byte
Purpose: Returns the user metadata. Returns: The user metadata as a byte slice.
GetVersion()
func (x *KV) GetVersion() uint64
Purpose: Returns the version. Returns: The version as a uint64.
GetExpiresAt()
func (x *KV) GetExpiresAt() uint64
Purpose: Returns the expiration timestamp. Returns: The expiration timestamp as a uint64.
GetMeta()
func (x *KV) GetMeta() []byte
Purpose: Returns the metadata. Returns: The metadata as a byte slice.
GetStreamId()
func (x *KV) GetStreamId() uint32
Purpose: Returns the stream ID. Returns: The stream ID as a uint32.
GetStreamDone()
func (x *KV) GetStreamDone() bool
Purpose: Returns stream done indicator. Returns: A boolean indicating if the stream is done.
KVList
type KVList struct {
state protoimpl.MessageState
sizeCache protoimpl.SizeCache
unknownFields protoimpl.UnknownFields
Kv []*KV `protobuf:"bytes,1,rep,name=kv,proto3" json:"kv,omitempty"`
// alloc_ref used internally for memory management.
AllocRef uint64 `protobuf:"varint,10,opt,name=alloc_ref,json=allocRef,proto3" json:"alloc_ref,omitempty"`
}
Purpose: Represents a list of key-value pairs.
Parameters:
Kv
: A slice ofKV
structs.AllocRef
: An allocation reference for memory management.
Reset()
func (x *KVList) Reset()
Purpose: Resets the KVList struct to its default values.
String()
func (x *KVList) String() string
Purpose: Returns the string representation of the KVList struct. Returns: The string representation of the KVList struct.
ProtoMessage()
func (*KVList) ProtoMessage()
Purpose: This method is empty.
ProtoReflect()
func (x *KVList) ProtoReflect() protoreflect.Message
Purpose: Returns the reflection interface for the KVList struct. Returns: The reflection interface for the KVList struct.
Descriptor()
func (*KVList) Descriptor() ([]byte, []int)
Purpose: Deprecated: Use KVList.ProtoReflect.Descriptor
instead.
Returns: A byte slice and an integer slice.
GetKv()
func (x *KVList) GetKv() []*KV
Purpose: Returns the list of key-value pairs.
Returns: A slice of KV
structs.
GetAllocRef()
func (x *KVList) GetAllocRef() uint64
Purpose: Returns the allocation reference. Returns: The allocation reference as a uint64.
ManifestChangeSet
type ManifestChangeSet struct {
state protoimpl.MessageState
sizeCache protoimpl.SizeCache
unknownFields protoimpl.UnknownFields
// A set of changes that are applied atomically.
Changes []*ManifestChange `protobuf:"bytes,1,rep,name=changes,proto3" json:"changes,omitempty"`
}
Purpose: Represents a set of manifest changes that are applied atomically.
Parameters:
Changes
: A slice ofManifestChange
structs representing the changes.
Reset()
func (x *ManifestChangeSet) Reset()
Purpose: Resets the ManifestChangeSet struct to its default values.
String()
func (x *ManifestChangeSet) String() string
Purpose: Returns the string representation of the ManifestChangeSet struct. Returns: The string representation of the ManifestChangeSet struct.
ProtoMessage()
func (*ManifestChangeSet) ProtoMessage()
Purpose: This method is empty.
ProtoReflect()
func (x *ManifestChangeSet) ProtoReflect() protoreflect.Message
Purpose: Returns the reflection interface for the ManifestChangeSet struct. Returns: The reflection interface for the ManifestChangeSet struct.
Descriptor()
func (*ManifestChangeSet) Descriptor() ([]byte, []int)
Purpose: Deprecated: Use ManifestChangeSet.ProtoReflect.Descriptor
instead.
Returns: A byte slice and an integer slice.
GetChanges()
func (x *ManifestChangeSet) GetChanges() []*ManifestChange
Purpose: Returns the list of manifest changes.
Returns: A slice of ManifestChange
structs.
ManifestChange
type ManifestChange struct {
state protoimpl.MessageState
sizeCache protoimpl.SizeCache
unknownFields protoimpl.UnknownFields
Id uint64 `protobuf:"varint,1,opt,name=Id,proto3" json:"Id,omitempty"` // Table ID.
Op ManifestChange_Operation `protobuf:"varint,2,opt,name=Op,proto3,enum=badgerpb4.ManifestChange_Operation" json:"Op,omitempty"`
Level uint32 `protobuf:"varint,3,opt,name=Level,proto3" json:"Level,omitempty"` // Only used for CREATE.
KeyId uint64 `protobuf:"varint,4,opt,name=key_id,json=keyId,proto3" json:"key_id,omitempty"`
EncryptionAlgo EncryptionAlgo `protobuf:"varint,5,opt,name=encryption_algo,json=encryptionAlgo,proto3,enum=badgerpb4.EncryptionAlgo" json:"encryption_algo,omitempty"`
Compression uint32 `protobuf:"varint,6,opt,name=compression,proto3" json:"compression,omitempty"` // Only used for CREATE Op.
}
Purpose: Represents a change to the manifest.
Parameters:
Id
: The table ID.Op
: The operation to perform (CREATE
orDELETE
).Level
: The level of the table (only used forCREATE
).KeyId
: The key ID.EncryptionAlgo
: The encryption algorithm used.Compression
: The compression type (only used forCREATE
).
Reset()
func (x *ManifestChange) Reset()
Purpose: Resets the ManifestChange struct to its default values.
String()
func (x *ManifestChange) String() string
Purpose: Returns the string representation of the ManifestChange struct. Returns: The string representation of the ManifestChange struct.
ProtoMessage()
func (*ManifestChange) ProtoMessage()
Purpose: This method is empty.
ProtoReflect()
func (x *ManifestChange) ProtoReflect() protoreflect.Message
Purpose: Returns the reflection interface for the ManifestChange struct. Returns: The reflection interface for the ManifestChange struct.
Descriptor()
func (*ManifestChange) Descriptor() ([]byte, []int)
Purpose: Deprecated: Use ManifestChange.ProtoReflect.Descriptor
instead.
Returns: A byte slice and an integer slice.
GetId()
func (x *ManifestChange) GetId() uint64
Purpose: Returns the table ID. Returns: The table ID as a uint64.
GetOp()
func (x *ManifestChange) GetOp() ManifestChange_Operation
Purpose: Returns the operation.
Returns: The operation as a ManifestChange_Operation
enum.
GetLevel()
func (x *ManifestChange) GetLevel() uint32
Purpose: Returns the level. Returns: The level as a uint32.
GetKeyId()
func (x *ManifestChange) GetKeyId() uint64
Purpose: Returns the key ID. Returns: The key ID as a uint64.
GetEncryptionAlgo()
func (x *ManifestChange) GetEncryptionAlgo() EncryptionAlgo
Purpose: Returns the encryption algorithm.
Returns: The encryption algorithm as an EncryptionAlgo
enum.
GetCompression()
func (x *ManifestChange) GetCompression() uint32
Purpose: Returns the compression type. Returns: The compression type as a uint32.
Checksum
type Checksum struct {
state protoimpl.MessageState
sizeCache protoimpl.SizeCache
unknownFields protoimpl.UnknownFields
Algo Checksum_Algorithm `protobuf:"varint,1,opt,name=algo,proto3,enum=badgerpb4.Checksum_Algorithm" json:"algo,omitempty"` // For storing type of Checksum algorithm used
Sum uint64 `protobuf:"varint,2,opt,name=sum,proto3" json:"sum,omitempty"`
}
Purpose: Represents a checksum value.
Parameters:
Algo
: The checksum algorithm used.Sum
: The checksum value.
Reset()
func (x *Checksum) Reset()
Purpose: Resets the Checksum struct to its default values.
String()
func (x *Checksum) String() string
Purpose: Returns the string representation of the Checksum struct. Returns: The string representation of the Checksum struct.
ProtoMessage()
func (*Checksum) ProtoMessage()
Purpose: This method is empty.
ProtoReflect()
func (x *Checksum) ProtoReflect() protoreflect.Message
Purpose: Returns the reflection interface for the Checksum struct. Returns: The reflection interface for the Checksum struct.
Descriptor()
func (*Checksum) Descriptor() ([]byte, []int)
Purpose: Deprecated: Use Checksum.ProtoReflect.Descriptor
instead.
Returns: A byte slice and an integer slice.
GetAlgo()
func (x *Checksum) GetAlgo() Checksum_Algorithm
Purpose: Returns the checksum algorithm.
Returns: The checksum algorithm as a Checksum_Algorithm
enum.
GetSum()
func (x *Checksum) GetSum() uint64
Purpose: Returns the checksum value. Returns: The checksum value as a uint64.
DataKey
type DataKey struct {
state protoimpl.MessageState
sizeCache protoimpl.SizeCache
unknownFields protoimpl.UnknownFields
KeyId uint64 `protobuf:"varint,1,opt,name=key_id,json=keyId,proto3" json:"key_id,omitempty"`
Data []byte `protobuf:"bytes,2,opt,name=data,proto3" json:"data,omitempty"`
Iv []byte `protobuf:"bytes,3,opt,name=iv,proto3" json:"iv,omitempty"`
CreatedAt int64 `protobuf:"varint,4,opt,name=created_at,json=createdAt,proto3" json:"created_at,omitempty"`
}
Purpose: Represents a data key used for encryption.
Parameters:
KeyId
: The key ID.Data
: The encrypted data.Iv
: The initialization vector.CreatedAt
: The creation timestamp.
Reset()
func (x *DataKey) Reset()
Purpose: Resets the DataKey struct to its default values.
String()
func (x *DataKey) String() string
Purpose: Returns the string representation of the DataKey struct. Returns: The string representation of the DataKey struct.
ProtoMessage()
func (*DataKey) ProtoMessage()
Purpose: This method is empty.
ProtoReflect()
func (x *DataKey) ProtoReflect() protoreflect.Message
Purpose: Returns the reflection interface for the DataKey struct. Returns: The reflection interface for the DataKey struct.
Descriptor()
func (*DataKey) Descriptor() ([]byte, []int)
Purpose: Deprecated: Use DataKey.ProtoReflect.Descriptor
instead.
Returns: A byte slice and an integer slice.
GetKeyId()
func (x *DataKey) GetKeyId() uint64
Purpose: Returns the key ID. Returns: The key ID as a uint64.
GetData()
func (x *DataKey) GetData() []byte
Purpose: Returns the encrypted data. Returns: The encrypted data as a byte slice.
GetIv()
func (x *DataKey) GetIv() []byte
Purpose: Returns the initialization vector. Returns: The initialization vector as a byte slice.
GetCreatedAt()
func (x *DataKey) GetCreatedAt() int64
Purpose: Returns the creation timestamp. Returns: The creation timestamp as an int64.
Match
type Match struct {
state protoimpl.MessageState
sizeCache protoimpl.SizeCache
unknownFields protoimpl.UnknownFields
Prefix []byte `protobuf:"bytes,1,opt,name=prefix,proto3" json:"prefix,omitempty"`
IgnoreBytes string `protobuf:"bytes,2,opt,name=ignore_bytes,json=ignoreBytes,proto3" json:"ignore_bytes,omitempty"` // Comma separated with dash to represent ranges "1, 2-3, 4-7, 9"
}
Purpose: Represents a match for filtering keys based on a prefix and bytes to ignore.
Parameters:
Prefix
: The prefix to match.IgnoreBytes
: Comma-separated list of byte indices or ranges to ignore during matching (e.g., "1, 2-3, 4-7, 9").
Reset()
func (x *Match) Reset()
Purpose: Resets the Match struct to its default values.
String()
func (x *Match) String() string
Purpose: Returns the string representation of the Match struct. Returns: The string representation of the Match struct.
ProtoMessage()
func (*Match) ProtoMessage()
Purpose: This method is empty.
ProtoReflect()
func (x *Match) ProtoReflect() protoreflect.Message
Purpose: Returns the reflection interface for the Match struct. Returns: The reflection interface for the Match struct.
Descriptor()
func (*Match) Descriptor() ([]byte, []int)
Purpose: Deprecated: Use Match.ProtoReflect.Descriptor
instead.
Returns: A byte slice and an integer slice.
GetPrefix()
func (x *Match) GetPrefix() []byte
Purpose: Returns the prefix. Returns: The prefix as a byte slice.
GetIgnoreBytes()
func (x *Match) GetIgnoreBytes() string
Purpose: Returns the ignore bytes string. Returns: The ignore bytes string.