walpb

package
v3.7.1 Latest Latest
Warning

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

Go to latest
Published: Jul 23, 2026 License: Apache-2.0 Imports: 9 Imported by: 12

Documentation

Index

Constants

This section is empty.

Variables

View Source
var ErrCRCMismatch = errors.New("walpb: crc mismatch")
View Source
var File_record_proto protoreflect.FileDescriptor

Functions

func ValidateSnapshotForWrite

func ValidateSnapshotForWrite(e *Snapshot) error

ValidateSnapshotForWrite ensures the Snapshot the newly written snapshot is valid.

There might exist log-entries written by old etcd versions that does not conform to the requirements.

Types

type Record

type Record struct {
	Type *int64  `protobuf:"varint,1,opt,name=type" json:"type,omitempty"`
	Crc  *uint32 `protobuf:"varint,2,opt,name=crc" json:"crc,omitempty"`
	Data []byte  `protobuf:"bytes,3,opt,name=data" json:"data,omitempty"`
	// contains filtered or unexported fields
}

func (*Record) Descriptor deprecated

func (*Record) Descriptor() ([]byte, []int)

Deprecated: Use Record.ProtoReflect.Descriptor instead.

func (*Record) GetCrc added in v3.7.0

func (x *Record) GetCrc() uint32

func (*Record) GetData added in v3.7.0

func (x *Record) GetData() []byte

func (*Record) GetType added in v3.7.0

func (x *Record) GetType() int64

func (*Record) ProtoMessage

func (*Record) ProtoMessage()

func (*Record) ProtoReflect added in v3.7.0

func (x *Record) ProtoReflect() protoreflect.Message

func (*Record) Reset

func (x *Record) Reset()

func (*Record) String

func (x *Record) String() string

func (*Record) Validate

func (rec *Record) Validate(crc uint32) error

type Snapshot

type Snapshot struct {
	Index *uint64 `protobuf:"varint,1,opt,name=index" json:"index,omitempty"`
	Term  *uint64 `protobuf:"varint,2,opt,name=term" json:"term,omitempty"`
	// Field populated since >=etcd-3.5.0.
	ConfState *raftpb.ConfState `protobuf:"bytes,3,opt,name=conf_state,json=confState" json:"conf_state,omitempty"`
	// contains filtered or unexported fields
}

Keep in sync with raftpb.SnapshotMetadata.

func (*Snapshot) Clone added in v3.7.0

func (s *Snapshot) Clone() *Snapshot

Clone returns a deep copy of s, or an empty Snapshot if s is nil.

func (*Snapshot) Descriptor deprecated

func (*Snapshot) Descriptor() ([]byte, []int)

Deprecated: Use Snapshot.ProtoReflect.Descriptor instead.

func (*Snapshot) GetConfState added in v3.7.0

func (x *Snapshot) GetConfState() *raftpb.ConfState

func (*Snapshot) GetIndex added in v3.7.0

func (x *Snapshot) GetIndex() uint64

func (*Snapshot) GetTerm added in v3.7.0

func (x *Snapshot) GetTerm() uint64

func (*Snapshot) ProtoMessage

func (*Snapshot) ProtoMessage()

func (*Snapshot) ProtoReflect added in v3.7.0

func (x *Snapshot) ProtoReflect() protoreflect.Message

func (*Snapshot) Reset

func (x *Snapshot) Reset()

func (*Snapshot) String

func (x *Snapshot) String() string

Jump to

Keyboard shortcuts

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