remotebe

package
v0.5.0 Latest Latest
Warning

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

Go to latest
Published: Mar 10, 2026 License: GPL-3.0 Imports: 12 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type PeerLocator added in v0.5.0

type PeerLocator interface {
	WhereIs(ctx context.Context, peer blobcache.PeerID) iter.Seq[netip.AddrPort]
}

PeerLocator finds the address of peers.

type PeerParams added in v0.5.0

type PeerParams = blobcache.VolumeBackend_Peer

type PeerSystem added in v0.5.0

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

func NewPeerSystem added in v0.5.0

func NewPeerSystem(inner *System, locator PeerLocator) PeerSystem

func (*PeerSystem) VolumeDestroy added in v0.5.0

func (ps *PeerSystem) VolumeDestroy(ctx context.Context, vol *Volume) error

func (*PeerSystem) VolumeUp added in v0.5.0

func (ps *PeerSystem) VolumeUp(ctx context.Context, p PeerParams) (*Volume, error)

type Queue

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

Queue is a remote queue.

func NewQueue

func NewQueue(sys *System, node bcp.Asker, ep blobcache.Endpoint, h blobcache.Handle, cfg blobcache.QueueConfig) *Queue

func (*Queue) Config

func (q *Queue) Config() blobcache.QueueConfig

func (*Queue) Dequeue

func (q *Queue) Dequeue(ctx context.Context, buf []blobcache.Message, opts blobcache.DequeueOpts) (int, error)

func (*Queue) Enqueue

func (q *Queue) Enqueue(ctx context.Context, msgs []blobcache.Message) (int, error)

func (*Queue) QueueDown

func (q *Queue) QueueDown(ctx context.Context) error

type QueueParams

type QueueParams = blobcache.QueueBackend_Remote

type System

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

func New

func New(node *atomic.Pointer[bcnet.Node]) System

func (*System) CreateQueue

func (sys *System) CreateQueue(ctx context.Context, ep blobcache.Endpoint, qspec blobcache.QueueSpec) (*Queue, *blobcache.QueueInfo, error)

CreateQueue creates a queue on the remote node and returns a local proxy.

func (*System) OpenFrom

func (sys *System) OpenFrom(ctx context.Context, base *Volume, token blobcache.LinkToken, mask blobcache.ActionSet) (blobcache.ActionSet, *Volume, error)

func (*System) QueueUp

func (sys *System) QueueUp(ctx context.Context, p *blobcache.QueueBackend_Remote) (*Queue, error)

QueueUp opens an existing remote queue and returns a local proxy.

func (*System) SubToVol

func (sys *System) SubToVol(ctx context.Context, vol *Volume, q backend.Queue, spec blobcache.VolSubSpec) error

func (*System) VolumeDestroy

func (sys *System) VolumeDestroy(ctx context.Context, vol *Volume) error

func (*System) VolumeDown

func (sys *System) VolumeDown(ctx context.Context, vol *Volume) error

func (*System) VolumeUp

func (sys *System) VolumeUp(ctx context.Context, p Params) (*Volume, error)

type Tx

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

Tx is a transaction on a remote volume.

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, cids []blobcache.CID) error

func (*Tx) Exists

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

func (*Tx) Get

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

func (*Tx) Hash

func (tx *Tx) Hash(salt *blobcache.CID, data []byte) blobcache.CID

func (*Tx) IsVisited

func (tx *Tx) IsVisited(ctx context.Context, cids []blobcache.CID, dst []bool) error
func (tx *Tx) Link(ctx context.Context, svoid blobcache.OID, rights blobcache.ActionSet, targetVol backend.Volume) (*blobcache.LinkToken, error)

func (*Tx) Load

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

func (*Tx) MaxSize

func (tx *Tx) MaxSize() int

func (*Tx) Params

func (tx *Tx) Params() blobcache.TxParams

func (*Tx) Post

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

func (*Tx) Save

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

func (*Tx) Visit

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

func (*Tx) Volume

func (tx *Tx) Volume() backend.Volume

type Volume

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

Volume is a remote volume.

func NewVolume

func NewVolume(sys *System, node bcp.Asker, ep blobcache.Endpoint, h blobcache.Handle, info *blobcache.VolumeInfo) *Volume

func (*Volume) AccessSubVolume

func (v *Volume) AccessSubVolume(ctx context.Context, ltok blobcache.LinkToken) (blobcache.ActionSet, error)

func (*Volume) BeginTx

func (v *Volume) BeginTx(ctx context.Context, spec blobcache.TxParams) (backend.Tx, error)

func (*Volume) Endpoint

func (v *Volume) Endpoint() blobcache.Endpoint

func (*Volume) GetBackend

func (v *Volume) GetBackend() blobcache.VolumeBackend[blobcache.OID]

func (*Volume) GetParams

func (v *Volume) GetParams() blobcache.VolumeConfig

func (*Volume) Handle

func (v *Volume) Handle() blobcache.Handle

func (*Volume) VolumeDown

func (v *Volume) VolumeDown(ctx context.Context) error

Jump to

Keyboard shortcuts

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