bcremote

package
v0.8.1 Latest Latest
Warning

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

Go to latest
Published: Jun 24, 2026 License: GPL-3.0 Imports: 9 Imported by: ? modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Overview

Package bcremote implements a blobcache.Service over Blobcache Network Protocol (BCNP). This is useful for applications written in Go, or that have a QUIC implementation.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Service

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

func Dial

func Dial(privateKey ed25519.PrivateKey, ep blobcache.Endpoint) (*Service, error)

Dial starts listening via UDP on any available port, then calls New to create a Service.

func New

func New(privateKey ed25519.PrivateKey, pc net.PacketConn, ep blobcache.Endpoint) *Service

New creates a Service, which is implemented remotely. Endpoint describes the service to connect to. Connections will be established out of pc. privateKey is used to authenticate to the service.

func (*Service) Abort

func (s *Service) Abort(ctx context.Context, tx blobcache.Handle) error

Abort aborts a transaction.

func (*Service) AwaitReady

func (s *Service) AwaitReady(ctx context.Context) error

AwaitReady pings the server in a loop and awaits a response. Any error returned will be from ctx.Err()

func (*Service) BeginTx

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

func (*Service) Close

func (s *Service) Close() error

Close closes the Service.

func (*Service) Commit

func (s *Service) Commit(ctx context.Context, tx blobcache.Handle) error

Commit commits a transaction.

func (*Service) Copy

func (s *Service) Copy(ctx context.Context, tx blobcache.Handle, srcTxns []blobcache.Handle, cids []blobcache.CID, success *blobcache.BitMap) error

func (*Service) CreateQueue

func (s *Service) CreateQueue(ctx context.Context, _ *blobcache.Endpoint, qspec blobcache.QueueSpec) (*blobcache.Handle, error)

func (*Service) CreateVolume

func (s *Service) CreateVolume(ctx context.Context, host *blobcache.Endpoint, vspec blobcache.VolumeSpec) (*blobcache.Handle, error)

CreateVolume creates a new volume.

func (*Service) Delete

func (s *Service) Delete(ctx context.Context, tx blobcache.Handle, cids []blobcache.CID) error

Delete deletes a CID from the volume

func (*Service) Dequeue added in v0.4.0

func (s *Service) Dequeue(ctx context.Context, qh blobcache.Handle, buf []blobcache.Message, opts blobcache.DequeueOpts) (int, error)

func (*Service) Drop

func (s *Service) Drop(ctx context.Context, h blobcache.Handle) error

func (*Service) Endpoint

func (s *Service) Endpoint(ctx context.Context) (blobcache.Endpoint, error)

Endpoint returns the endpoint of the remote service.

func (*Service) Enqueue added in v0.4.0

func (*Service) Exists

func (s *Service) Exists(ctx context.Context, tx blobcache.Handle, cids []blobcache.CID, dst *blobcache.BitMap) error

Exists checks if a CID exists in the volume

func (*Service) Get

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

Get returns the data for a CID.

func (*Service) Inspect added in v0.6.0

func (s *Service) Inspect(ctx context.Context, h blobcache.Handle) (blobcache.Info, error)

func (*Service) InspectHandle

func (s *Service) InspectHandle(ctx context.Context, h blobcache.Handle) (*blobcache.HandleInfo, error)

func (*Service) InspectQueue added in v0.4.0

func (s *Service) InspectQueue(ctx context.Context, qh blobcache.Handle) (blobcache.QueueInfo, error)

func (*Service) InspectTx

func (s *Service) InspectTx(ctx context.Context, tx blobcache.Handle) (*blobcache.TxInfo, error)

InspectTx returns info about a transaction.

func (*Service) InspectVolume

func (s *Service) InspectVolume(ctx context.Context, h blobcache.Handle) (*blobcache.VolumeInfo, error)

InspectVolume returns info about a Volume.

func (*Service) IsVisited

func (s *Service) IsVisited(ctx context.Context, tx blobcache.Handle, cids []blobcache.CID, dst *blobcache.BitMap) error

func (*Service) KeepAlive

func (s *Service) KeepAlive(ctx context.Context, hs []blobcache.Handle) error

Link allows the Volume to reference another volume.

func (*Service) Load

func (s *Service) Load(ctx context.Context, tx blobcache.Handle, dst *[]byte) error

Load loads the volume root into dst

func (*Service) OpenFiat

func (s *Service) OpenFiat(ctx context.Context, target blobcache.OID, mask blobcache.ActionSet) (*blobcache.Handle, error)

func (*Service) OpenFrom

func (*Service) Post

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

Post posts data to the volume

func (*Service) Save

func (s *Service) Save(ctx context.Context, tx blobcache.Handle, src []byte) error

Save writes to the volume root.

func (*Service) ShareIn added in v0.6.0

func (*Service) ShareOut added in v0.6.0

func (*Service) SubToVolume

func (s *Service) SubToVolume(ctx context.Context, qh blobcache.Handle, volh blobcache.Handle, spec blobcache.VolSubSpec) error
func (s *Service) Unlink(ctx context.Context, tx blobcache.Handle, targets []blobcache.LinkID) error

func (*Service) Visit

func (s *Service) Visit(ctx context.Context, tx blobcache.Handle, cids []blobcache.CID) error
func (s *Service) VisitLinks(ctx context.Context, tx blobcache.Handle, targets []blobcache.LinkID) error

Jump to

Keyboard shortcuts

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