blob

package
v0.0.0-...-0f47c2d Latest Latest
Warning

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

Go to latest
Published: May 18, 2026 License: Apache-2.0, MIT Imports: 14 Imported by: 0

Documentation

Index

Constants

View Source
const AcceptCommand = "/blob/accept"
View Source
const AddCommand = "/blob/add"
View Source
const AllocateCommand = "/blob/allocate"
View Source
const ListCommand = "/blob/list"
View Source
const MaxBlobSize = 268_435_456
View Source
const RemoveCommand = "/blob/remove"
View Source
const ReplicateCommand = "/blob/replicate"
View Source
const RetrieveCommand = "/blob/retrieve"

Variables

Replicate is a capability that allows an agent to replicate a Blob into a space identified by did:key in the `with` field.

A Replicate capability may only be invoked after a `/blob/accept` receipt has been receieved, indicating the source node has successfully received the blob. Each Replicate task MUST target a different node, and they MUST NOT target the original upload target.

The Replicate task receipt includes async tasks for `/blob/replica/allocate` and `/blob/replica/transfer`. Successful completion of the `/blob/replica/transfer` task indicates the replication target has transferred and stored the blob. The number of `/blob/replica/allocate` and `/blob/replica/transfer` tasks corresponds directly to number of replicas requested.

Retrieve is the service-level retrieval capability (e.g. used by the indexer to fetch content claims from a Piri node). It is NOT space-scoped: any holder of a valid delegation for `/blob/retrieve` may fetch the blob by digest, regardless of which space it was originally stored under.

For user-facing retrieval that requires an allocation in a specific space see `libforge/capabilities/content.Retrieve` (the `/content/retrieve` capability).

Functions

This section is empty.

Types

type AcceptArguments

type AcceptArguments struct {
	Blob Blob            `cborgen:"blob" dagjsongen:"blob"`
	Put  promise.AwaitOK `cborgen:"_put" dagjsongen:"_put"`
}

func (*AcceptArguments) MarshalCBOR

func (t *AcceptArguments) MarshalCBOR(w io.Writer) error

func (*AcceptArguments) MarshalDagJSON

func (t *AcceptArguments) MarshalDagJSON(w io.Writer) error

func (*AcceptArguments) UnmarshalCBOR

func (t *AcceptArguments) UnmarshalCBOR(r io.Reader) (err error)

func (*AcceptArguments) UnmarshalDagJSON

func (t *AcceptArguments) UnmarshalDagJSON(r io.Reader) (err error)

type AcceptOK

type AcceptOK struct {
	Site cid.Cid `cborgen:"site" dagjsongen:"site"`
}

func (*AcceptOK) MarshalCBOR

func (t *AcceptOK) MarshalCBOR(w io.Writer) error

func (*AcceptOK) MarshalDagJSON

func (t *AcceptOK) MarshalDagJSON(w io.Writer) error

func (*AcceptOK) UnmarshalCBOR

func (t *AcceptOK) UnmarshalCBOR(r io.Reader) (err error)

func (*AcceptOK) UnmarshalDagJSON

func (t *AcceptOK) UnmarshalDagJSON(r io.Reader) (err error)

type AddArguments

type AddArguments struct {
	Blob Blob `cborgen:"blob" dagjsongen:"blob"`
}

func (*AddArguments) MarshalCBOR

func (t *AddArguments) MarshalCBOR(w io.Writer) error

func (*AddArguments) MarshalDagJSON

func (t *AddArguments) MarshalDagJSON(w io.Writer) error

func (*AddArguments) UnmarshalCBOR

func (t *AddArguments) UnmarshalCBOR(r io.Reader) (err error)

func (*AddArguments) UnmarshalDagJSON

func (t *AddArguments) UnmarshalDagJSON(r io.Reader) (err error)

type AddOK

type AddOK struct {
	// Site is a promise of the `/blob/accept` task result, which contains a
	// location claim for the blob, describing where it can be retrieved from.
	Site promise.AwaitOK `cborgen:"site" dagjsongen:"site"`
}

func (*AddOK) MarshalCBOR

func (t *AddOK) MarshalCBOR(w io.Writer) error

func (*AddOK) MarshalDagJSON

func (t *AddOK) MarshalDagJSON(w io.Writer) error

func (*AddOK) UnmarshalCBOR

func (t *AddOK) UnmarshalCBOR(r io.Reader) (err error)

func (*AddOK) UnmarshalDagJSON

func (t *AddOK) UnmarshalDagJSON(r io.Reader) (err error)

type AllocateArguments

type AllocateArguments struct {
	Blob  Blob    `cborgen:"blob" dagjsongen:"blob"`
	Cause cid.Cid `cborgen:"cause" dagjsongen:"cause"`
}

func (*AllocateArguments) MarshalCBOR

func (t *AllocateArguments) MarshalCBOR(w io.Writer) error

func (*AllocateArguments) MarshalDagJSON

func (t *AllocateArguments) MarshalDagJSON(w io.Writer) error

func (*AllocateArguments) UnmarshalCBOR

func (t *AllocateArguments) UnmarshalCBOR(r io.Reader) (err error)

func (*AllocateArguments) UnmarshalDagJSON

func (t *AllocateArguments) UnmarshalDagJSON(r io.Reader) (err error)

type AllocateOK

type AllocateOK struct {
	Size    uint64       `cborgen:"size" dagjsongen:"size"`
	Address *BlobAddress `cborgen:"address,omitempty" dagjsongen:"address,omitempty"`
}

func (*AllocateOK) MarshalCBOR

func (t *AllocateOK) MarshalCBOR(w io.Writer) error

func (*AllocateOK) MarshalDagJSON

func (t *AllocateOK) MarshalDagJSON(w io.Writer) error

func (*AllocateOK) UnmarshalCBOR

func (t *AllocateOK) UnmarshalCBOR(r io.Reader) (err error)

func (*AllocateOK) UnmarshalDagJSON

func (t *AllocateOK) UnmarshalDagJSON(r io.Reader) (err error)

type Blob

type Blob struct {
	Digest multihash.Multihash `cborgen:"digest" dagjsongen:"digest"`
	Size   uint64              `cborgen:"size" dagjsongen:"size"`
}

func (*Blob) MarshalCBOR

func (t *Blob) MarshalCBOR(w io.Writer) error

func (*Blob) MarshalDagJSON

func (t *Blob) MarshalDagJSON(w io.Writer) error

func (*Blob) UnmarshalCBOR

func (t *Blob) UnmarshalCBOR(r io.Reader) (err error)

func (*Blob) UnmarshalDagJSON

func (t *Blob) UnmarshalDagJSON(r io.Reader) (err error)

type BlobAddress

type BlobAddress struct {
	URL     capabilities.CborURL `cborgen:"url" dagjsongen:"url"`
	Headers map[string]string    `cborgen:"headers" dagjsongen:"headers"`
	Expires int64                `cborgen:"expires" dagjsongen:"expires"`
}

func (*BlobAddress) MarshalCBOR

func (t *BlobAddress) MarshalCBOR(w io.Writer) error

func (*BlobAddress) MarshalDagJSON

func (t *BlobAddress) MarshalDagJSON(w io.Writer) error

func (*BlobAddress) UnmarshalCBOR

func (t *BlobAddress) UnmarshalCBOR(r io.Reader) (err error)

func (*BlobAddress) UnmarshalDagJSON

func (t *BlobAddress) UnmarshalDagJSON(r io.Reader) (err error)

type ListArguments

type ListArguments struct {
	Cursor *string `cborgen:"cursor,omitempty" dagjsongen:"cursor,omitempty"`
	Size   *uint64 `cborgen:"size,omitempty" dagjsongen:"size,omitempty"`
}

func (*ListArguments) MarshalCBOR

func (t *ListArguments) MarshalCBOR(w io.Writer) error

func (*ListArguments) MarshalDagJSON

func (t *ListArguments) MarshalDagJSON(w io.Writer) error

func (*ListArguments) UnmarshalCBOR

func (t *ListArguments) UnmarshalCBOR(r io.Reader) (err error)

func (*ListArguments) UnmarshalDagJSON

func (t *ListArguments) UnmarshalDagJSON(r io.Reader) (err error)

type ListBlobItem

type ListBlobItem struct {
	Blob       Blob  `cborgen:"blob" dagjsongen:"blob"`
	InsertedAt int64 `cborgen:"insertedAt" dagjsongen:"insertedAt"`
}

func (*ListBlobItem) MarshalCBOR

func (t *ListBlobItem) MarshalCBOR(w io.Writer) error

func (*ListBlobItem) MarshalDagJSON

func (t *ListBlobItem) MarshalDagJSON(w io.Writer) error

func (*ListBlobItem) UnmarshalCBOR

func (t *ListBlobItem) UnmarshalCBOR(r io.Reader) (err error)

func (*ListBlobItem) UnmarshalDagJSON

func (t *ListBlobItem) UnmarshalDagJSON(r io.Reader) (err error)

type ListOK

type ListOK struct {
	Cursor  *string        `cborgen:"cursor,omitempty" dagjsongen:"cursor,omitempty"`
	Size    uint64         `cborgen:"size" dagjsongen:"size"`
	Results []ListBlobItem `cborgen:"results" dagjsongen:"results"`
}

func (*ListOK) MarshalCBOR

func (t *ListOK) MarshalCBOR(w io.Writer) error

func (*ListOK) MarshalDagJSON

func (t *ListOK) MarshalDagJSON(w io.Writer) error

func (*ListOK) UnmarshalCBOR

func (t *ListOK) UnmarshalCBOR(r io.Reader) (err error)

func (*ListOK) UnmarshalDagJSON

func (t *ListOK) UnmarshalDagJSON(r io.Reader) (err error)

type RemoveArguments

type RemoveArguments struct {
	Digest multihash.Multihash `cborgen:"digest" dagjsongen:"digest"`
}

func (*RemoveArguments) MarshalCBOR

func (t *RemoveArguments) MarshalCBOR(w io.Writer) error

func (*RemoveArguments) MarshalDagJSON

func (t *RemoveArguments) MarshalDagJSON(w io.Writer) error

func (*RemoveArguments) UnmarshalCBOR

func (t *RemoveArguments) UnmarshalCBOR(r io.Reader) (err error)

func (*RemoveArguments) UnmarshalDagJSON

func (t *RemoveArguments) UnmarshalDagJSON(r io.Reader) (err error)

type RemoveOK

type RemoveOK = capabilities.Unit

type ReplicateArguments

type ReplicateArguments struct {
	// Blob is the blob that must be replicated.
	Blob Blob `cborgen:"blob" dagjsongen:"blob"`
	// Replicas is the number of replicas to ensure.
	// e.g. Replicas: 3 will ensure 3 copies of the data exist in a network in total.
	Replicas uint64 `cborgen:"replicas" dagjsongen:"replicas"`
	// Site is a link to a location commitment indicating where the Blob must be
	// fetched from.
	Site cid.Cid `cborgen:"site" dagjsongen:"site"`
}

func (*ReplicateArguments) MarshalCBOR

func (t *ReplicateArguments) MarshalCBOR(w io.Writer) error

func (*ReplicateArguments) MarshalDagJSON

func (t *ReplicateArguments) MarshalDagJSON(w io.Writer) error

func (*ReplicateArguments) UnmarshalCBOR

func (t *ReplicateArguments) UnmarshalCBOR(r io.Reader) (err error)

func (*ReplicateArguments) UnmarshalDagJSON

func (t *ReplicateArguments) UnmarshalDagJSON(r io.Reader) (err error)

type ReplicateOK

type ReplicateOK struct {
	// Site resolves to additional locations for the blob. They are links to
	// `/blob/replica/transfer` tasks.
	Site []promise.AwaitOK `cborgen:"site" dagjsongen:"site"`
}

func (*ReplicateOK) MarshalCBOR

func (t *ReplicateOK) MarshalCBOR(w io.Writer) error

func (*ReplicateOK) MarshalDagJSON

func (t *ReplicateOK) MarshalDagJSON(w io.Writer) error

func (*ReplicateOK) UnmarshalCBOR

func (t *ReplicateOK) UnmarshalCBOR(r io.Reader) (err error)

func (*ReplicateOK) UnmarshalDagJSON

func (t *ReplicateOK) UnmarshalDagJSON(r io.Reader) (err error)

type RetrieveArguments

type RetrieveArguments struct {
	Blob RetrieveBlob `cborgen:"blob" dagjsongen:"blob"`
}

RetrieveArguments is the argument shape of the `/blob/retrieve` capability — a service-level (not space-scoped) retrieval handle. Compare to `content.RetrieveArguments` which is space-scoped and carries a byte Range; the `/blob/retrieve` flow is consumed by service principals (e.g. the indexer) fetching content claims that aren't bound to any space.

func (*RetrieveArguments) MarshalCBOR

func (t *RetrieveArguments) MarshalCBOR(w io.Writer) error

func (*RetrieveArguments) MarshalDagJSON

func (t *RetrieveArguments) MarshalDagJSON(w io.Writer) error

func (*RetrieveArguments) UnmarshalCBOR

func (t *RetrieveArguments) UnmarshalCBOR(r io.Reader) (err error)

func (*RetrieveArguments) UnmarshalDagJSON

func (t *RetrieveArguments) UnmarshalDagJSON(r io.Reader) (err error)

type RetrieveBlob

type RetrieveBlob struct {
	Digest multihash.Multihash `cborgen:"digest" dagjsongen:"digest"`
}

RetrieveBlob identifies a blob solely by its content multihash. Used by the service-level `/blob/retrieve` capability where the caller is fetching data by hash without prior knowledge of the byte size.

func (*RetrieveBlob) MarshalCBOR

func (t *RetrieveBlob) MarshalCBOR(w io.Writer) error

func (*RetrieveBlob) MarshalDagJSON

func (t *RetrieveBlob) MarshalDagJSON(w io.Writer) error

func (*RetrieveBlob) UnmarshalCBOR

func (t *RetrieveBlob) UnmarshalCBOR(r io.Reader) (err error)

func (*RetrieveBlob) UnmarshalDagJSON

func (t *RetrieveBlob) UnmarshalDagJSON(r io.Reader) (err error)

type RetrieveOK

type RetrieveOK struct{}

RetrieveOK is the success return for `/blob/retrieve`. The blob bytes themselves are streamed back through the response container's body (the libforge HTTPHeader retrieval transport); the typed OK record is empty.

func (*RetrieveOK) MarshalCBOR

func (t *RetrieveOK) MarshalCBOR(w io.Writer) error

func (*RetrieveOK) MarshalDagJSON

func (t *RetrieveOK) MarshalDagJSON(w io.Writer) error

func (*RetrieveOK) UnmarshalCBOR

func (t *RetrieveOK) UnmarshalCBOR(r io.Reader) (err error)

func (*RetrieveOK) UnmarshalDagJSON

func (t *RetrieveOK) UnmarshalDagJSON(r io.Reader) (err error)

Directories

Path Synopsis
gen command

Jump to

Keyboard shortcuts

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