bchttp

package
v0.0.0-...-575026b Latest Latest
Warning

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

Go to latest
Published: Sep 30, 2025 License: GPL-3.0 Imports: 11 Imported by: 0

Documentation

Overview

Package bchttp implements a Blobcache service over HTTP.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type AbortReq

type AbortReq struct{}

type AbortResp

type AbortResp struct{}

type AddFromReq

type AddFromReq struct {
	CIDs []blobcache.CID    `json:"cids"`
	Srcs []blobcache.Handle `json:"srcs"`
}

type AddFromResp

type AddFromResp struct {
	Added []bool `json:"added"`
}

type AllowLinkReq

type AllowLinkReq struct {
	Target blobcache.Handle `json:"target"`
}

type AllowLinkResp

type AllowLinkResp struct{}

type AwaitReq

type AwaitReq struct {
	Cond blobcache.Conditions `json:"cond"`
}

type AwaitResp

type AwaitResp struct{}

type BeginTxReq

type BeginTxReq struct {
	Volume blobcache.Handle   `json:"volume"`
	Params blobcache.TxParams `json:"params"`
}

type BeginTxResp

type BeginTxResp struct {
	Tx blobcache.Handle `json:"handle"`
}

type Client

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

func NewClient

func NewClient(hc *http.Client, ep string) *Client

func (*Client) Abort

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

func (*Client) Await

func (c *Client) Await(ctx context.Context, cond blobcache.Conditions) error

func (*Client) BeginTx

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

func (*Client) CloneVolume

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

func (*Client) Commit

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

func (*Client) Copy

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

func (*Client) CreateVolume

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

func (*Client) Delete

func (c *Client) Delete(ctx context.Context, tx blobcache.Handle, cids []blobcache.CID) 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)

func (*Client) Exists

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

func (*Client) Get

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

func (*Client) InspectHandle

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

func (*Client) InspectTx

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

func (*Client) InspectVolume

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

func (*Client) IsVisited

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

func (*Client) KeepAlive

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

func (*Client) Load

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

func (*Client) OpenFiat

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

func (*Client) OpenFrom

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

func (*Client) Post

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

func (*Client) Save

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

func (*Client) Share

func (*Client) Visit

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

type CloneVolumeReq

type CloneVolumeReq struct {
	// Volume is the handle to the volume to clone.
	Volume blobcache.Handle `json:"volume"`
}

type CloneVolumeResp

type CloneVolumeResp struct {
	// Clone is the handle to the cloned volume.
	Clone blobcache.Handle `json:"clone"`
}

type CommitReq

type CommitReq struct{}

type CommitResp

type CommitResp struct{}

type CreateSubVolumeReq

type CreateSubVolumeReq struct {
	Spec blobcache.VolumeSpec `json:"spec"`
}

type CreateSubVolumeResp

type CreateSubVolumeResp struct {
	Volume blobcache.VolumeInfo `json:"volume"`
}

type CreateVolumeReq

type CreateVolumeReq struct {
	Host *blobcache.Endpoint  `json:"host,omitempty"`
	Spec blobcache.VolumeSpec `json:"spec"`
}

type CreateVolumeResp

type CreateVolumeResp struct {
	Handle blobcache.Handle `json:"handle"`
}

type DeleteReq

type DeleteReq struct {
	CIDs []blobcache.CID `json:"cids"`
}

type DeleteResp

type DeleteResp struct{}

type DropReq

type DropReq struct {
	Handle blobcache.Handle `json:"handle"`
}

type DropResp

type DropResp struct{}

type EndpointReq

type EndpointReq struct{}

type EndpointResp

type EndpointResp struct {
	Endpoint blobcache.Endpoint `json:"endpoint"`
}

type ExistsReq

type ExistsReq struct {
	CIDs []blobcache.CID `json:"cids"`
}

type ExistsResp

type ExistsResp struct {
	Exists []bool `json:"exists"`
}

type GetReq

type GetReq struct {
	CID  blobcache.CID  `json:"cid"`
	Salt *blobcache.CID `json:"salt,omitempty"`
}

type InspectHandleReq

type InspectHandleReq struct {
	Handle blobcache.Handle `json:"handle"`
}

Handle messages.

type InspectHandleResp

type InspectHandleResp struct {
	Info blobcache.HandleInfo `json:"info"`
}

type InspectTxReq

type InspectTxReq struct {
	Tx blobcache.Handle `json:"tx"`
}

type InspectTxResp

type InspectTxResp struct {
	Info blobcache.TxInfo `json:"info"`
}

type InspectVolumeReq

type InspectVolumeReq struct {
	Volume blobcache.Handle `json:"volume"`
}

type IsVisitedReq

type IsVisitedReq struct {
	CIDs []blobcache.CID `json:"cids"`
}

type IsVisitedResp

type IsVisitedResp struct {
	Visited []bool `json:"visited"`
}

type KeepAliveReq

type KeepAliveReq struct {
	Handles []blobcache.Handle `json:"handles"`
}

type KeepAliveResp

type KeepAliveResp struct{}

type LoadReq

type LoadReq struct{}

type LoadResp

type LoadResp struct {
	Root []byte `json:"root"`
}

type OpenFiatReq

type OpenFiatReq struct {
	Target blobcache.OID       `json:"target"`
	Mask   blobcache.ActionSet `json:"mask"`
}

type OpenFiatResp

type OpenFiatResp struct {
	Handle blobcache.Handle     `json:"handle"`
	Info   blobcache.VolumeInfo `json:"info"`
}

type OpenFromReq

type OpenFromReq struct {
	Base   blobcache.Handle    `json:"base"`
	Target blobcache.OID       `json:"target"`
	Mask   blobcache.ActionSet `json:"mask"`
}

type OpenFromResp

type OpenFromResp struct {
	Handle blobcache.Handle     `json:"handle"`
	Info   blobcache.VolumeInfo `json:"info"`
}

type SaveReq

type SaveReq struct {
	Root []byte `json:"root"`
}

type SaveResp

type SaveResp struct{}

type Server

type Server struct {
	Service blobcache.Service
}

func (*Server) ServeHTTP

func (s *Server) ServeHTTP(w http.ResponseWriter, r *http.Request)

type ShareReq

type ShareReq struct {
	Handle blobcache.Handle    `json:"handle"`
	Peer   blobcache.PeerID    `json:"peer"`
	Mask   blobcache.ActionSet `json:"mask"`
}

type ShareResp

type ShareResp struct {
	Handle blobcache.Handle `json:"handle"`
}

type VisitReq

type VisitReq struct {
	CIDs []blobcache.CID `json:"cids"`
}

type VisitResp

type VisitResp struct{}

Jump to

Keyboard shortcuts

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