copier

package
v0.3.3 Latest Latest
Warning

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

Go to latest
Published: Sep 16, 2026 License: Apache-2.0 Imports: 1 Imported by: 0

Documentation

Overview

Package copier defines chunked shadow-table copy contracts enforcing CO-4 and LK-3.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Chunk

type Chunk struct {
	// contains filtered or unexported fields
}

Chunk is a closed range of a single-column integer primary key. Its fields are unexported so that lower <= upper holds for every value the chunker can observe; NewChunk is the only way to obtain a non-zero Chunk.

func NewChunk

func NewChunk(lower, upper int64) (Chunk, error)

NewChunk validates and returns the closed range [lower, upper].

func (Chunk) Lower

func (c Chunk) Lower() int64

Lower returns the inclusive lower bound.

func (Chunk) Upper

func (c Chunk) Upper() int64

Upper returns the inclusive upper bound.

type Watermark

type Watermark struct {
	// contains filtered or unexported fields
}

Watermark identifies the highest primary key below which every chunk was copied. The zero value means no chunk has been copied yet; a valid watermark is obtainable only from NewWatermark, so a value can never be paired with the wrong validity flag.

func NewWatermark

func NewWatermark(value int64) Watermark

NewWatermark returns a valid copied-through watermark.

func (Watermark) Valid

func (w Watermark) Valid() bool

Valid reports whether any chunk has been copied. Value is meaningful only when Valid is true.

func (Watermark) Value

func (w Watermark) Value() int64

Value returns the copied-through primary key. It is zero for an invalid watermark; callers check Valid first.

Jump to

Keyboard shortcuts

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