staging

package
v0.1.0 Latest Latest
Warning

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

Go to latest
Published: Jan 24, 2026 License: GPL-3.0 Imports: 14 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func DefaultGotKV

func DefaultGotKV() gotkv.Machine

Types

type DeleteOp

type DeleteOp struct{}

DeleteOp deletes a path and everything beneath it

type Entry

type Entry struct {
	Path string    `json:"p"`
	Op   Operation `json:"op"`
}

type Iterator

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

func (*Iterator) Next

func (it *Iterator) Next(ctx context.Context, dsts []Entry) (int, error)

type Operation

type Operation struct {
	Delete *DeleteOp `json:"del,omitempty"`
	Put    *PutOp    `json:"put,omitempty"`
}

type PutOp

type PutOp = gotfs.Root

PutOp replaces a path with a filesystem.

type Tx

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

Tx is a transaction on a stage

func New

func New(kvmach *gotkv.Machine, tx volumes.Tx, paramHash *[32]byte) *Tx

New wraps a transaction to create a transaction on a Stage paramHash if not-nil, causes operations to error if it does not match the paramHash in the stage

func (*Tx) Abort

func (tx *Tx) Abort(ctx context.Context) error

func (*Tx) Apply

func (tx *Tx) Apply(ctx context.Context, fsag *gotfs.Machine, ss [2]stores.RW, base *gotfs.Root) (*gotfs.Root, error)

func (*Tx) CheckConflict

func (tx *Tx) CheckConflict(ctx context.Context, p string) error

func (*Tx) Clear

func (tx *Tx) Clear(ctx context.Context) error

Clear deletes all entries from the staging area

func (*Tx) Commit

func (tx *Tx) Commit(ctx context.Context) error

func (*Tx) Delete

func (tx *Tx) Delete(ctx context.Context, p string) error

Delete removes a file at p with root

func (*Tx) Discard

func (tx *Tx) Discard(ctx context.Context, p string) error

func (*Tx) ForEach

func (tx *Tx) ForEach(ctx context.Context, fn func(Entry) error) error

func (*Tx) Get

func (tx *Tx) Get(ctx context.Context, p string) (*Operation, error)

Get returns the operation, if any, staged for the path p If there is no operation staged Get returns (nil, nil)

func (*Tx) IsEmpty

func (tx *Tx) IsEmpty(ctx context.Context) (bool, error)

func (*Tx) Iterate

func (tx *Tx) Iterate(ctx context.Context, span gotkv.Span) (*Iterator, error)

func (*Tx) Put

func (tx *Tx) Put(ctx context.Context, p string, root gotfs.Root) error

Put replaces a path at p with root

func (*Tx) Store

func (tx *Tx) Store() stores.RW

Jump to

Keyboard shortcuts

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