gotns

package
v0.3.1 Latest Latest
Warning

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

Go to latest
Published: Feb 22, 2026 License: GPL-3.0 Imports: 15 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func DefaultVolumeSpec

func DefaultVolumeSpec() blobcache.VolumeSpec

func NewGotKV

func NewGotKV() gotkv.Machine

Types

type MarkState

type MarkState struct {
	// Info is stored as json
	Info gotcore.Info `json:"info"`
	// Target is stored as json.
	Target gdat.Ref `json:"target"`
}

func (MarkState) Marshal

func (b MarkState) Marshal(out []byte) []byte

func (*MarkState) Unmarshal

func (s *MarkState) Unmarshal(data []byte) error

type Root

type Root struct {
	Marks gotkv.Root
	// BrokenSet is the set of CIDs which the Space cannot dereference.
	// This is used to correctly Sync even with incomplete structures.
	BrokenSet gotkv.Root
}

Root is the root of a gotns namespace

func ParseRoot

func ParseRoot(data []byte) (*Root, error)

func (Root) Marshal

func (r Root) Marshal(out []byte) []byte

func (*Root) Unmarshal

func (r *Root) Unmarshal(data []byte) error

type Space

type Space struct {
	Volume volumes.Volume
	DMach  *gdat.Machine
	KVMach *gotkv.Machine
}

func (*Space) Do added in v0.3.0

func (s *Space) Do(ctx context.Context, modify bool, fn func(sptx gotcore.SpaceTx) error) error

type SpaceTx added in v0.3.0

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

func (*SpaceTx) All added in v0.3.0

func (s *SpaceTx) All(ctx context.Context) iter.Seq2[string, error]

List implements gotcore.Space.

func (*SpaceTx) Create added in v0.3.0

func (s *SpaceTx) Create(ctx context.Context, name string, md gotcore.Metadata) (*gotcore.Info, error)

Create implements gotcore.Space.

func (*SpaceTx) Delete added in v0.3.0

func (s *SpaceTx) Delete(ctx context.Context, name string) error

Delete implements gotcore.Space.

func (*SpaceTx) GetTarget added in v0.3.0

func (s *SpaceTx) GetTarget(ctx context.Context, name string, dst *gdat.Ref) (bool, error)

func (*SpaceTx) Inspect added in v0.3.0

func (s *SpaceTx) Inspect(ctx context.Context, name string) (*gotcore.Info, error)

Inspect implements gotcore.Space.

func (*SpaceTx) SetMetadata added in v0.3.0

func (s *SpaceTx) SetMetadata(ctx context.Context, name string, md gotcore.Metadata) error

Set implements gotcore.Space.

func (*SpaceTx) SetTarget added in v0.3.0

func (s *SpaceTx) SetTarget(ctx context.Context, name string, ref gdat.Ref) error

func (*SpaceTx) Stores added in v0.3.0

func (s *SpaceTx) Stores() [3]stores.RW

type Tx

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

Tx is a transaction on a Namespace

func BeginTx

func BeginTx(ctx context.Context, dmach *gdat.Machine, kvmach *gotkv.Machine, vol volumes.Volume, modify bool) (*Tx, error)

func NewTx

func NewTx(tx volumes.Tx, dmach *gdat.Machine, kvmach *gotkv.Machine) *Tx

func (*Tx) Abort

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

func (*Tx) AllNames added in v0.3.0

func (tx *Tx) AllNames(ctx context.Context) iter.Seq2[string, error]

func (*Tx) Commit

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

func (*Tx) Delete

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

func (*Tx) Get

func (tx *Tx) Get(ctx context.Context, name string) (*MarkState, error)

func (*Tx) Put

func (tx *Tx) Put(ctx context.Context, name string, b MarkState) error

Jump to

Keyboard shortcuts

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