bcsdk

package
v0.0.1 Latest Latest
Warning

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

Go to latest
Published: Nov 25, 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.

Types

type ActionSet

type ActionSet = blobcache.ActionSet

type CID

type CID = blobcache.CID

type Handle

type Handle = blobcache.Handle

type OID

type OID = blobcache.OID

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

Jump to

Keyboard shortcuts

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