...

Package walpb

import "go.etcd.io/etcd/server/v3/wal/walpb"
Overview
Index

Overview ▾

Index ▾

Variables
func ValidateSnapshotForWrite(e *Snapshot) error
type Record
    func (*Record) Descriptor() ([]byte, []int)
    func (m *Record) Marshal() (dAtA []byte, err error)
    func (m *Record) MarshalTo(dAtA []byte) (int, error)
    func (m *Record) MarshalToSizedBuffer(dAtA []byte) (int, error)
    func (*Record) ProtoMessage()
    func (m *Record) Reset()
    func (m *Record) Size() (n int)
    func (m *Record) String() string
    func (m *Record) Unmarshal(dAtA []byte) error
    func (rec *Record) Validate(crc uint32) error
    func (m *Record) XXX_DiscardUnknown()
    func (m *Record) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)
    func (m *Record) XXX_Merge(src proto.Message)
    func (m *Record) XXX_Size() int
    func (m *Record) XXX_Unmarshal(b []byte) error
type Snapshot
    func (*Snapshot) Descriptor() ([]byte, []int)
    func (m *Snapshot) Marshal() (dAtA []byte, err error)
    func (m *Snapshot) MarshalTo(dAtA []byte) (int, error)
    func (m *Snapshot) MarshalToSizedBuffer(dAtA []byte) (int, error)
    func (*Snapshot) ProtoMessage()
    func (m *Snapshot) Reset()
    func (m *Snapshot) Size() (n int)
    func (m *Snapshot) String() string
    func (m *Snapshot) Unmarshal(dAtA []byte) error
    func (m *Snapshot) XXX_DiscardUnknown()
    func (m *Snapshot) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)
    func (m *Snapshot) XXX_Merge(src proto.Message)
    func (m *Snapshot) XXX_Size() int
    func (m *Snapshot) XXX_Unmarshal(b []byte) error

Package files

record.go record.pb.go

Variables

var (
    ErrInvalidLengthRecord        = fmt.Errorf("proto: negative length found during unmarshaling")
    ErrIntOverflowRecord          = fmt.Errorf("proto: integer overflow")
    ErrUnexpectedEndOfGroupRecord = fmt.Errorf("proto: unexpected end of group")
)
var (
    ErrCRCMismatch = errors.New("walpb: crc mismatch")
)

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.

type Record

type Record struct {
    Type                 int64    `protobuf:"varint,1,opt,name=type" json:"type"`
    Crc                  uint32   `protobuf:"varint,2,opt,name=crc" json:"crc"`
    Data                 []byte   `protobuf:"bytes,3,opt,name=data" json:"data,omitempty"`
    XXX_NoUnkeyedLiteral struct{} `json:"-"`
    XXX_unrecognized     []byte   `json:"-"`
    XXX_sizecache        int32    `json:"-"`
}

func (*Record) Descriptor

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

func (*Record) Marshal

func (m *Record) Marshal() (dAtA []byte, err error)

func (*Record) MarshalTo

func (m *Record) MarshalTo(dAtA []byte) (int, error)

func (*Record) MarshalToSizedBuffer

func (m *Record) MarshalToSizedBuffer(dAtA []byte) (int, error)

func (*Record) ProtoMessage

func (*Record) ProtoMessage()

func (*Record) Reset

func (m *Record) Reset()

func (*Record) Size

func (m *Record) Size() (n int)

func (*Record) String

func (m *Record) String() string

func (*Record) Unmarshal

func (m *Record) Unmarshal(dAtA []byte) error

func (*Record) Validate

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

func (*Record) XXX_DiscardUnknown

func (m *Record) XXX_DiscardUnknown()

func (*Record) XXX_Marshal

func (m *Record) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)

func (*Record) XXX_Merge

func (m *Record) XXX_Merge(src proto.Message)

func (*Record) XXX_Size

func (m *Record) XXX_Size() int

func (*Record) XXX_Unmarshal

func (m *Record) XXX_Unmarshal(b []byte) error

type Snapshot

Keep in sync with raftpb.SnapshotMetadata.

type Snapshot struct {
    Index uint64 `protobuf:"varint,1,opt,name=index" json:"index"`
    Term  uint64 `protobuf:"varint,2,opt,name=term" json:"term"`
    // Field populated since >=etcd-3.5.0.
    ConfState            *raftpb.ConfState `protobuf:"bytes,3,opt,name=conf_state,json=confState" json:"conf_state,omitempty"`
    XXX_NoUnkeyedLiteral struct{}          `json:"-"`
    XXX_unrecognized     []byte            `json:"-"`
    XXX_sizecache        int32             `json:"-"`
}

func (*Snapshot) Descriptor

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

func (*Snapshot) Marshal

func (m *Snapshot) Marshal() (dAtA []byte, err error)

func (*Snapshot) MarshalTo

func (m *Snapshot) MarshalTo(dAtA []byte) (int, error)

func (*Snapshot) MarshalToSizedBuffer

func (m *Snapshot) MarshalToSizedBuffer(dAtA []byte) (int, error)

func (*Snapshot) ProtoMessage

func (*Snapshot) ProtoMessage()

func (*Snapshot) Reset

func (m *Snapshot) Reset()

func (*Snapshot) Size

func (m *Snapshot) Size() (n int)

func (*Snapshot) String

func (m *Snapshot) String() string

func (*Snapshot) Unmarshal

func (m *Snapshot) Unmarshal(dAtA []byte) error

func (*Snapshot) XXX_DiscardUnknown

func (m *Snapshot) XXX_DiscardUnknown()

func (*Snapshot) XXX_Marshal

func (m *Snapshot) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)

func (*Snapshot) XXX_Merge

func (m *Snapshot) XXX_Merge(src proto.Message)

func (*Snapshot) XXX_Size

func (m *Snapshot) XXX_Size() int

func (*Snapshot) XXX_Unmarshal

func (m *Snapshot) XXX_Unmarshal(b []byte) error