bchttp

package
v0.0.0-...-1ef88f4 Latest Latest
Warning

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

Go to latest
Published: Jul 14, 2025 License: GPL-3.0 Imports: 12 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 AwaitReq

type AwaitReq = bcnet.AwaitReq

type AwaitResp

type AwaitResp = bcnet.AwaitResp

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 (*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) Commit

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

func (*Client) CreateVolume

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

func (*Client) Delete

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

func (*Client) DeleteEntry

func (c *Client) DeleteEntry(ctx context.Context, ns blobcache.Handle, name string) 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, cid blobcache.CID) (bool, error)

func (*Client) Get

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

func (*Client) GetEntry

func (c *Client) GetEntry(ctx context.Context, ns blobcache.Handle, name string) (*blobcache.Entry, error)

func (*Client) InspectHandle

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

func (*Client) InspectVolume

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

func (*Client) KeepAlive

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

func (*Client) ListNames

func (c *Client) ListNames(ctx context.Context, ns blobcache.Handle) ([]string, error)

func (*Client) Load

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

func (*Client) Open

func (c *Client) Open(ctx context.Context, x blobcache.OID) (*blobcache.Handle, error)

func (*Client) OpenAt

func (c *Client) OpenAt(ctx context.Context, ns blobcache.Handle, name string) (*blobcache.Handle, error)

func (*Client) Post

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

func (*Client) PutEntry

func (c *Client) PutEntry(ctx context.Context, ns blobcache.Handle, name string, target blobcache.Handle) error

type CommitReq

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

type CommitResp

type CommitResp struct{}

type CreateVolumeReq

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

type CreateVolumeResp

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

type DeleteEntryReq

type DeleteEntryReq = bcnet.DeleteEntryReq

Namespace messages.

type DeleteEntryResp

type DeleteEntryResp = bcnet.DeleteEntryResp

Namespace messages.

type DeleteReq

type DeleteReq struct {
	CID blobcache.CID `json:"cid"`
}

type DeleteResp

type DeleteResp struct{}

type DropReq

type DropReq = bcnet.DropReq

Handle messages.

type DropResp

type DropResp = bcnet.DropResp

Handle messages.

type EndpointReq

type EndpointReq struct{}

type EndpointResp

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

type ExistsReq

type ExistsReq struct {
	CID blobcache.CID `json:"cid"`
}

type ExistsResp

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

type GetEntryReq

type GetEntryReq = bcnet.GetEntryReq

Namespace messages.

type GetEntryResp

type GetEntryResp = bcnet.GetEntryResp

Namespace messages.

type GetReq

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

type InspectHandleReq

type InspectHandleReq = bcnet.InspectHandleReq

Handle messages.

type InspectHandleResp

type InspectHandleResp = bcnet.InspectHandleResp

Handle messages.

type KeepAliveReq

type KeepAliveReq = bcnet.KeepAliveReq

Handle messages.

type KeepAliveResp

type KeepAliveResp = bcnet.KeepAliveResp

Handle messages.

type ListNamesReq

type ListNamesReq = bcnet.ListNamesReq

Namespace messages.

type ListNamesResp

type ListNamesResp = bcnet.ListNamesResp

Namespace messages.

type LoadReq

type LoadReq struct{}

type LoadResp

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

type OpenAtReq

type OpenAtReq = bcnet.OpenAtReq

Namespace messages.

type OpenAtResp

type OpenAtResp = bcnet.OpenAtResp

Namespace messages.

type OpenReq

type OpenReq = bcnet.OpenReq

Handle messages.

type OpenResp

type OpenResp = bcnet.OpenResp

Handle messages.

type PutEntryReq

type PutEntryReq = bcnet.PutEntryReq

Namespace messages.

type PutEntryResp

type PutEntryResp = bcnet.PutEntryResp

Namespace messages.

type Server

type Server struct {
	Service blobcache.Service
}

func (*Server) ServeHTTP

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

Jump to

Keyboard shortcuts

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