bcipc

package
v0.4.0 Latest Latest
Warning

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

Go to latest
Published: Feb 22, 2026 License: GPL-3.0 Imports: 11 Imported by: 0

Documentation

Overview

Package bcipc implements the Blobcache Protocol over UNIX sockets

Index

Constants

View Source
const MaxMessageLen = 1<<24 + bcp.HeaderLen

Variables

This section is empty.

Functions

func Listen

func Listen(p string) (*net.UnixListener, error)

func ListenAndServe

func ListenAndServe(ctx context.Context, p string, srv bcp.Handler) error

func Serve

func Serve(ctx context.Context, lis *net.UnixListener, srv bcp.Handler) error

Types

type Client

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

func NewClient

func NewClient(sockPath string) *Client

func (*Client) Abort

func (c *Client) Abort(ctx context.Context, tx blobcache.Handle) error

Abort aborts a transaction.

func (*Client) BeginTx

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

func (*Client) CloneVolume

func (c *Client) CloneVolume(ctx context.Context, caller *blobcache.PeerID, volh blobcache.Handle) (*blobcache.Handle, error)

func (*Client) Close

func (c *Client) Close() error

func (*Client) Commit

func (c *Client) Commit(ctx context.Context, tx blobcache.Handle) error

Commit commits a transaction.

func (*Client) Copy

func (c *Client) Copy(ctx context.Context, tx blobcache.Handle, srcTxns []blobcache.Handle, cids []blobcache.CID, success []bool) error

func (*Client) CreateQueue

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

func (*Client) CreateVolume

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

CreateVolume creates a new volume.

func (*Client) Delete

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

Delete deletes a CID from the volume

func (*Client) Dequeue

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

func (*Client) Drop

func (c *Client) Drop(ctx context.Context, h blobcache.Handle) error

func (*Client) Endpoint

func (c *Client) Endpoint(ctx context.Context) (blobcache.Endpoint, error)

Endpoint returns the endpoint of the remote service.

func (*Client) Enqueue

func (c *Client) Enqueue(ctx context.Context, qh blobcache.Handle, msgs []blobcache.Message) (*blobcache.InsertResp, error)

func (*Client) Exists

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

Exists checks if a CID exists in the volume

func (*Client) Get

func (c *Client) 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 (*Client) InspectHandle

func (c *Client) InspectHandle(ctx context.Context, h blobcache.Handle) (*blobcache.HandleInfo, error)

func (*Client) InspectQueue

func (c *Client) InspectQueue(ctx context.Context, qh blobcache.Handle) (blobcache.QueueInfo, error)

func (*Client) InspectTx

func (c *Client) InspectTx(ctx context.Context, tx blobcache.Handle) (*blobcache.TxInfo, error)

InspectTx returns info about a transaction.

func (*Client) InspectVolume

func (c *Client) InspectVolume(ctx context.Context, h blobcache.Handle) (*blobcache.VolumeInfo, error)

InspectVolume returns info about a Volume.

func (*Client) IsVisited

func (c *Client) IsVisited(ctx context.Context, tx blobcache.Handle, cids []blobcache.CID, dst []bool) error

func (*Client) KeepAlive

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

Link allows the Volume to reference another volume.

func (*Client) Load

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

Load loads the volume root into dst

func (*Client) OpenFiat

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

func (*Client) OpenFrom

func (*Client) Post

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

Post posts data to the volume

func (*Client) Save

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

Save writes to the volume root.

func (*Client) Share

func (*Client) SubToVolume

func (c *Client) SubToVolume(ctx context.Context, qh blobcache.Handle, volh blobcache.Handle, spec blobcache.VolSubSpec) error
func (c *Client) Unlink(ctx context.Context, tx blobcache.Handle, targets []blobcache.LinkToken) error

func (*Client) Visit

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

type Server

type Server = bcp.Server

func NewServer

func NewServer(svc blobcache.Service) *Server

Jump to

Keyboard shortcuts

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