Documentation
¶
Index ¶
- func CreateOnSameHost(ctx context.Context, s blobcache.Service, base blobcache.Handle, ...) (*blobcache.Handle, *blobcache.FQOID, error)
- func ExistsSingle(ctx context.Context, s interface{ ... }, txh Handle, cid CID) (bool, error)
- func Modify(ctx context.Context, svc blobcache.Service, volh blobcache.Handle, ...) error
- func ModifyTx(ctx context.Context, svc blobcache.Service, volh blobcache.Handle, ...) error
- func OpenURL(ctx context.Context, bc blobcache.Service, u blobcache.URL) (*blobcache.Handle, error)
- func URLFor(ctx context.Context, bc blobcache.Service, volh blobcache.Handle) (*blobcache.URL, error)
- func View(ctx context.Context, svc blobcache.Service, volh blobcache.Handle, ...) error
- func View1[T any](ctx context.Context, svc blobcache.Service, volh blobcache.Handle, ...) (T, error)
- type ActionSet
- type CID
- type Handle
- type Loader
- type OID
- type RO
- type RW
- type RWD
- type Saver
- type Tx
- func (tx *Tx) Abort(ctx context.Context) error
- func (tx *Tx) Commit(ctx context.Context) error
- func (tx *Tx) Copy(ctx context.Context, srcs []*Tx, cids []CID, success []bool) error
- func (tx *Tx) Delete(ctx context.Context, cids []CID) error
- func (tx *Tx) Exists(ctx context.Context, cids []CID, exists []bool) error
- func (tx *Tx) Get(ctx context.Context, cid CID, buf []byte) (int, error)
- func (tx *Tx) Hash(data []byte) CID
- func (tx *Tx) IsVisited(ctx context.Context, cids []CID, yesVisited []bool) error
- func (tx *Tx) KeepAlive(ctx context.Context) error
- func (tx *Tx) Link(ctx context.Context, target blobcache.Handle, mask ActionSet) error
- func (tx *Tx) Load(ctx context.Context, dst *[]byte) error
- func (tx *Tx) MaxSize() int
- func (tx *Tx) Post(ctx context.Context, data []byte) (CID, error)
- func (tx *Tx) Save(ctx context.Context, src []byte) error
- func (tx *Tx) Unlink(ctx context.Context, targets []OID) error
- func (tx *Tx) Visit(ctx context.Context, cids []CID) error
- func (tx *Tx) VisitLinks(ctx context.Context, targets []OID) error
- type TxSalt
- func (tx *TxSalt) Abort(ctx context.Context) error
- func (tx *TxSalt) Commit(ctx context.Context) error
- func (tx *TxSalt) Delete(ctx context.Context, cid CID) error
- func (tx *TxSalt) Exists(ctx context.Context, cid CID) (bool, error)
- func (tx *TxSalt) Get(ctx context.Context, cid CID, buf []byte, opts blobcache.GetOpts) (int, error)
- func (tx *TxSalt) Hash(salt *CID, data []byte) CID
- func (tx *TxSalt) KeepAlive(ctx context.Context) error
- func (tx *TxSalt) Load(ctx context.Context, dst *[]byte) error
- func (tx *TxSalt) MaxSize() int
- func (tx *TxSalt) Post(ctx context.Context, data []byte, opts blobcache.PostOpts) (CID, error)
- func (tx *TxSalt) Save(ctx context.Context, src []byte) error
- type WO
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func CreateOnSameHost ¶
func CreateOnSameHost(ctx context.Context, s blobcache.Service, base blobcache.Handle, spec blobcache.VolumeSpec) (*blobcache.Handle, *blobcache.FQOID, error)
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 URLFor ¶ added in v0.0.2
func URLFor(ctx context.Context, bc blobcache.Service, volh blobcache.Handle) (*blobcache.URL, error)
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.
Types ¶
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 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.
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.