gotns

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 DefaultVolumeSpec

func DefaultVolumeSpec() blobcache.VolumeSpec

func NewGotKV

func NewGotKV() gotkv.Machine

Types

type MarkState

type MarkState struct {
	// Info is stored as json
	Info marks.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 marks.Volume
	DMach  *gdat.Machine
	KVMach *gotkv.Machine
}

func (*Space) Create

func (s *Space) Create(ctx context.Context, name string, cfg marks.Metadata) (*marks.Info, error)

Create implements marks.Space.

func (*Space) Delete

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

Delete implements marks.Space.

func (*Space) Inspect

func (s *Space) Inspect(ctx context.Context, name string) (*marks.Info, error)

Inspect implements marks.Space.

func (*Space) List

func (s *Space) List(ctx context.Context, span marks.Span, limit int) ([]string, error)

List implements marks.Space.

func (*Space) Open

func (s *Space) Open(ctx context.Context, name string) (*marks.Mark, error)

Open implements marks.Space.

func (*Space) Set

func (s *Space) Set(ctx context.Context, name string, cfg marks.Metadata) error

Set implements marks.Space.

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) 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) ListNames

func (tx *Tx) ListNames(ctx context.Context, span marks.Span, limit int) ([]string, error)

func (*Tx) LoadBranchRoot

func (tx *Tx) LoadBranchRoot(ctx context.Context, name string, dst *[]byte) error

func (*Tx) Put

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

func (*Tx) SaveMarkRoot

func (tx *Tx) SaveMarkRoot(ctx context.Context, name string, data []byte) error

type VirtVolume

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

VirtVolume is a virtual volume containing the a Marks root as the VirtVolume root.

func (*VirtVolume) BeginTx

func (v *VirtVolume) BeginTx(ctx context.Context, tp volumes.TxParams) (volumes.Tx, error)

BeginTx implements volumes.Volume.

type VirtVolumeTx

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

VirtVolumeTx is a transaction on a branch volume.

func (*VirtVolumeTx) Abort

func (vvt *VirtVolumeTx) Abort(ctx context.Context) error

Abort implements volumes.Tx.

func (*VirtVolumeTx) Commit

func (vvt *VirtVolumeTx) Commit(ctx context.Context) error

Commit implements volumes.Tx.

func (*VirtVolumeTx) Exists

func (vvt *VirtVolumeTx) Exists(ctx context.Context, cids []blobcache.CID, dst []bool) error

Exists implements volumes.Tx.

func (*VirtVolumeTx) Get

func (vvt *VirtVolumeTx) Get(ctx context.Context, cid blobcache.CID, buf []byte) (int, error)

Get implements volumes.Tx.

func (*VirtVolumeTx) Hash

func (vvt *VirtVolumeTx) Hash(data []byte) blobcache.CID

Hash implements volumes.Tx.

func (*VirtVolumeTx) Load

func (vvt *VirtVolumeTx) Load(ctx context.Context, dst *[]byte) error

Load implements volumes.Tx.

func (*VirtVolumeTx) MaxSize

func (vvt *VirtVolumeTx) MaxSize() int

MaxSize implements volumes.Tx.

func (*VirtVolumeTx) Post

func (vvt *VirtVolumeTx) Post(ctx context.Context, data []byte) (blobcache.CID, error)

Post implements volumes.Tx.

func (*VirtVolumeTx) Save

func (vvt *VirtVolumeTx) Save(ctx context.Context, src []byte) error

Save implements volumes.Tx.

Jump to

Keyboard shortcuts

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