Documentation
¶
Overview ¶
Package branching defines optional database checkpoint and branching capabilities.
The contracts deliberately live beside dal rather than inside dal.DB. A provider can opt in without widening the mandatory data-access interface.
Index ¶
Constants ¶
This section is empty.
Variables ¶
View Source
var ( // ErrUnsupportedCapability identifies a database configuration a provider // cannot safely checkpoint or branch. ErrUnsupportedCapability = errors.New("dalgo branching: unsupported capability") ErrNilSourceDB = errors.New("dalgo branching: source database is nil") ErrNilBranchDB = errors.New("dalgo branching: branch database is nil") ErrReleased = errors.New("dalgo branching: checkpoint is released") ErrEmptyGeneration = errors.New("dalgo branching: checkpoint generation is empty") )
Functions ¶
This section is empty.
Types ¶
type Capability ¶
Capability is stable provider metadata recorded in a state-holder manifest.
type Checkpoint ¶
type Checkpoint interface {
Generation() string
Branch(context.Context) (Branch, error)
Release(context.Context) error
}
Checkpoint is immutable provider state from which fresh branches are created. Release must be idempotent.
type Provider ¶
type Provider interface {
Capability() Capability
Capture(context.Context, dal.DB) (Checkpoint, error)
}
Provider captures immutable state from one source database.
type UnsupportedError ¶
UnsupportedError names the provider mode rejected by an optional capability.
func (*UnsupportedError) Error ¶
func (e *UnsupportedError) Error() string
func (*UnsupportedError) Unwrap ¶
func (e *UnsupportedError) Unwrap() error
Unwrap supports errors.Is(err, ErrUnsupportedCapability).
Click to show internal directories.
Click to hide internal directories.