bcsdk

package
v0.0.2 Latest Latest
Warning

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

Go to latest
Published: Dec 15, 2025 License: GPL-3.0 Imports: 4 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func CreateOnSameHost

CreateOnSameHost creates a new subvolume on the same host as the base volume.

func ExistsSingle

func ExistsSingle(ctx context.Context, s interface {
	Exists(ctx context.Context, txh Handle, cids []CID, dst []bool) error
}, txh Handle, cid CID) (bool, error)

ExistsSingle is a convenience function for checking if a single CID exists using the slice based API.

func Modify added in v0.0.2

func Modify(ctx context.Context, svc blobcache.Service, volh blobcache.Handle, fn func(s RW, root []byte) ([]byte, error)) error

Modify performs a modifying transaction on the volume.

func ModifyTx added in v0.0.2

func ModifyTx(ctx context.Context, svc blobcache.Service, volh blobcache.Handle, fn func(tx *Tx, root []byte) ([]byte, error)) error

func OpenURL added in v0.0.2

func URLFor added in v0.0.2

URLFor produces a URL for a Volume. If the Volume is a remote Volume than the OID of the Volume on the remote Node and the Endpoint of the remote Node will be included in the URL instead of the local Node.

func View added in v0.0.2

func View(ctx context.Context, svc blobcache.Service, volh blobcache.Handle, fn func(s RO, root []byte) error) error

func View1 added in v0.0.2

func View1[T any](ctx context.Context, svc blobcache.Service, volh blobcache.Handle, fn func(s RO, root []byte) (T, error)) (T, error)

Types

type ActionSet

type ActionSet = blobcache.ActionSet

type CID

type CID = blobcache.CID

type Handle

type Handle = blobcache.Handle

type Loader added in v0.0.2

type Loader interface {
	Load(ctx context.Context, dst *[]byte) error
}

type OID

type OID = blobcache.OID

type RO added in v0.0.2

type RO interface {
	Get(ctx context.Context, cid blobcache.CID, buf []byte) (int, error)
	Exists(ctx context.Context, cids []blobcache.CID, dst []bool) error
	Hash(data []byte) blobcache.CID
	MaxSize() int
}

RO is read-only Store methods

type RW added in v0.0.2

type RW interface {
	RO
	WO
}

RW is Read-Write Store methods

type RWD added in v0.0.2

type RWD interface {
	RW
	Delete(ctx context.Context, cids []blobcache.CID) error
}

RWD is Read-Write-Delete Store methods

type Saver added in v0.0.2

type Saver interface {
	Save(ctx context.Context, src []byte) error
}

type Tx

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

Tx is a convenience type for managing a transaction within a Service.

func BeginTx

func BeginTx(ctx context.Context, s blobcache.Service, volH blobcache.Handle, txp blobcache.TxParams) (*Tx, error)

BeginTx begins a new transaction and returns the Tx type.

func NewTx

func NewTx(s blobcache.Service, h blobcache.Handle, hash blobcache.HashFunc, maxSize int) *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) Copy

func (tx *Tx) Copy(ctx context.Context, srcs []*Tx, cids []CID, success []bool) error

func (*Tx) Delete

func (tx *Tx) Delete(ctx context.Context, cids []CID) error

func (*Tx) Exists

func (tx *Tx) Exists(ctx context.Context, cids []CID, exists []bool) error

func (*Tx) Get

func (tx *Tx) Get(ctx context.Context, cid CID, buf []byte) (int, error)

func (*Tx) Hash

func (tx *Tx) Hash(data []byte) CID

func (*Tx) IsVisited

func (tx *Tx) IsVisited(ctx context.Context, cids []CID, yesVisited []bool) error

func (*Tx) KeepAlive

func (tx *Tx) KeepAlive(ctx context.Context) error
func (tx *Tx) Link(ctx context.Context, target blobcache.Handle, mask ActionSet) error

func (*Tx) Load

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

func (*Tx) MaxSize

func (tx *Tx) MaxSize() int

func (*Tx) Post

func (tx *Tx) Post(ctx context.Context, data []byte) (CID, error)

func (*Tx) Save

func (tx *Tx) Save(ctx context.Context, src []byte) error
func (tx *Tx) Unlink(ctx context.Context, targets []OID) error

func (*Tx) Visit

func (tx *Tx) Visit(ctx context.Context, cids []CID) error
func (tx *Tx) VisitLinks(ctx context.Context, targets []OID) error

type TxSalt

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

TxSalt is a convenience type for managing a salted transaction within a Service.

func BeginTxSalt

func BeginTxSalt(ctx context.Context, s blobcache.Service, volH Handle, txp blobcache.TxParams) (*TxSalt, error)

BeginTxSalt is the salted variant of BeginTx.

func NewTxSalt

func NewTxSalt(s blobcache.Service, h Handle, hash blobcache.HashFunc, maxSize int) *TxSalt

func (*TxSalt) Abort

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

func (*TxSalt) Commit

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

func (*TxSalt) Delete

func (tx *TxSalt) Delete(ctx context.Context, cid CID) error

func (*TxSalt) Exists

func (tx *TxSalt) Exists(ctx context.Context, cid CID) (bool, error)

func (*TxSalt) Get

func (tx *TxSalt) Get(ctx context.Context, cid CID, buf []byte, opts blobcache.GetOpts) (int, error)

func (*TxSalt) Hash

func (tx *TxSalt) Hash(salt *CID, data []byte) CID

func (*TxSalt) KeepAlive

func (tx *TxSalt) KeepAlive(ctx context.Context) error

func (*TxSalt) Load

func (tx *TxSalt) Load(ctx context.Context, dst *[]byte) error

func (*TxSalt) MaxSize

func (tx *TxSalt) MaxSize() int

func (*TxSalt) Post

func (tx *TxSalt) Post(ctx context.Context, data []byte, opts blobcache.PostOpts) (CID, error)

func (*TxSalt) Save

func (tx *TxSalt) Save(ctx context.Context, src []byte) error

type WO added in v0.0.2

type WO interface {
	Post(ctx context.Context, data []byte) (blobcache.CID, error)
	Exists(ctx context.Context, cids []blobcache.CID, dst []bool) error
	Hash(data []byte) blobcache.CID
	MaxSize() int
}

Jump to

Keyboard shortcuts

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