staging

package
v0.0.4 Latest Latest
Warning

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

Go to latest
Published: Jul 21, 2022 License: GPL-3.0 Imports: 11 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Operation

type Operation struct {
	Delete bool        `json:"del,omitempty"`
	Put    *gotfs.Root `json:"put,omitempty"`
}

type Stage

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

func New

func New(stor Storage) *Stage

func (*Stage) Apply

func (s *Stage) Apply(ctx context.Context, fsop *gotfs.Operator, ms, ds cadata.Store, base *gotfs.Root) (*gotfs.Root, error)

func (*Stage) CheckConflict

func (s *Stage) CheckConflict(ctx context.Context, p string) error

func (*Stage) Delete

func (s *Stage) Delete(ctx context.Context, p string) error

Delete removes a file at p with root

func (*Stage) Discard

func (s *Stage) Discard(ctx context.Context, p string) error

func (*Stage) ForEach

func (s *Stage) ForEach(ctx context.Context, fn func(p string, op Operation) error) error

func (*Stage) Get

func (s *Stage) 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 (*Stage) IsEmpty

func (s *Stage) IsEmpty(ctx context.Context) (bool, error)

func (*Stage) Put

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

Put replaces a path at p with root

func (*Stage) Reset

func (s *Stage) Reset(ctx context.Context) error

type Storage

type Storage interface {
	state.KVStore[[]byte, []byte]
}

Jump to

Keyboard shortcuts

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