package walpb

import "go.etcd.io/etcd/server/v3/storage/wal/walpb"

Index

Variables

var ErrCRCMismatch = errors.New("walpb: crc mismatch")
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

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

Deprecated: Use Record.ProtoReflect.Descriptor instead.

func (*Record) GetCrc

func (x *Record) GetCrc() uint32

func (*Record) GetData

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

func (*Record) GetType

func (x *Record) GetType() int64

func (*Record) ProtoMessage

func (*Record) ProtoMessage()

func (*Record) ProtoReflect

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

func (s *Snapshot) Clone() *Snapshot

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

func (*Snapshot) Descriptor

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

Deprecated: Use Snapshot.ProtoReflect.Descriptor instead.

func (*Snapshot) GetConfState

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

func (*Snapshot) GetIndex

func (x *Snapshot) GetIndex() uint64

func (*Snapshot) GetTerm

func (x *Snapshot) GetTerm() uint64

func (*Snapshot) ProtoMessage

func (*Snapshot) ProtoMessage()

func (*Snapshot) ProtoReflect

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

func (*Snapshot) Reset

func (x *Snapshot) Reset()

func (*Snapshot) String

func (x *Snapshot) String() string

Source Files

record.go record.pb.go

Version
v3.7.1 (latest)
Published
Jul 23, 2026
Platform
linux/amd64
Imports
9 packages
Last checked
4 hours ago

Tools for package owners.