headstorage

package
v0.6.0-alpha.6 Latest Latest
Warning

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

Go to latest
Published: Jan 23, 2025 License: MIT Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type DeletedStatus

type DeletedStatus int
const (
	DeletedStatusNotDeleted DeletedStatus = iota
	DeletedStatusQueued
	DeletedStatusDeleted
)

type EntryIterator

type EntryIterator func(entry HeadsEntry) (bool, error)

type HeadStorage

type HeadStorage interface {
	AddObserver(observer Observer)
	IterateEntries(ctx context.Context, iterOpts IterOpts, iter EntryIterator) error
	GetEntry(ctx context.Context, id string) (HeadsEntry, error)
	DeleteEntryTx(txCtx context.Context, id string) error
	UpdateEntryTx(txCtx context.Context, update HeadsUpdate) error
	UpdateEntry(ctx context.Context, update HeadsUpdate) error
}

func New

func New(ctx context.Context, store anystore.DB) (HeadStorage, error)

type HeadsEntry

type HeadsEntry struct {
	Id             string
	Heads          []string
	CommonSnapshot string
	DeletedStatus  DeletedStatus
	IsDerived      bool
}

type HeadsUpdate

type HeadsUpdate struct {
	Id             string
	Heads          []string
	CommonSnapshot *string
	DeletedStatus  *DeletedStatus
	IsDerived      *bool
}

type IterOpts

type IterOpts struct {
	Deleted bool
}

type Observer

type Observer interface {
	OnUpdate(update HeadsUpdate)
}

Jump to

Keyboard shortcuts

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