checkpoint

package
v0.11.0 Latest Latest
Warning

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

Go to latest
Published: Aug 2, 2026 License: MIT Imports: 2 Imported by: 0

Documentation

Overview

Package checkpoint defines durable queue snapshot types.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type ActiveBatchSnapshot

type ActiveBatchSnapshot struct {
	PRs            []PullRequestSnapshot `json:"PRs"`
	StagingBranch  string                `json:"StagingBranch"`
	StagingSHA     string                `json:"StagingSHA"`
	BaseGeneration int                   `json:"BaseGeneration"`
	Outcome        string                `json:"Outcome"`
}

ActiveBatchSnapshot records a staging branch currently waiting on its gate. Restores re-queue active batches for fresh staging instead of trusting an old run from before the process restart.

type PullRequestSnapshot

type PullRequestSnapshot struct {
	Number  int    `json:"Number"`
	HeadSHA string `json:"HeadSHA"`
}

PullRequestSnapshot is the PR identity needed to resume a staged batch.

type QueueKey

type QueueKey struct {
	Owner string `json:"Owner"`
	Repo  string `json:"Repo"`
	Base  string `json:"Base"`
}

QueueKey identifies a single merge queue.

func (QueueKey) Validate

func (k QueueKey) Validate() error

Validate checks that the queue key can safely address one storage row.

type QueueSnapshot

type QueueSnapshot struct {
	Key             QueueKey              `json:"Key"`
	Pending         [][]int               `json:"Pending"`
	Active          []ActiveBatchSnapshot `json:"Active"`
	LingerSince     time.Time             `json:"LingerSince"`
	BaseGeneration  int                   `json:"BaseGeneration"`
	StagingSequence int                   `json:"StagingSequence"`
}

QueueSnapshot is the durable shape of queue state.

func (QueueSnapshot) Clone

func (s QueueSnapshot) Clone() QueueSnapshot

Clone returns a deep copy of the snapshot.

func (QueueSnapshot) Validate

func (s QueueSnapshot) Validate() error

Validate checks the snapshot before it is persisted or restored.

Directories

Path Synopsis
Package bolt provides a bbolt-backed queue checkpoint store.
Package bolt provides a bbolt-backed queue checkpoint store.
Package postgres provides a database/sql-backed Postgres queue checkpoint store.
Package postgres provides a database/sql-backed Postgres queue checkpoint store.

Jump to

Keyboard shortcuts

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