allocation

package
v0.0.0 Latest Latest
Warning

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

Go to latest
Published: Oct 28, 2024 License: Apache-2.0, MIT Imports: 11 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Encode

func Encode(alloc Allocation, enc codec.Encoder) ([]byte, error)

Types

type Allocation

type Allocation struct {
	// Space is the DID of the space this data was allocated for.
	Space did.DID
	// Blob is the details of the data that was allocated.
	Blob Blob
	// Expires is the time (in seconds since unix epoch) at which the
	// allocation becomes invalid and can no longer be accepted.
	Expires uint64
	// Cause is a link to the UCAN that requested the allocation.
	Cause ucan.Link
}

func Decode

func Decode(data []byte, dec codec.Decoder) (Allocation, error)

func (Allocation) ToIPLD

func (a Allocation) ToIPLD() (datamodel.Node, error)

type Blob

type Blob struct {
	// Digest is the hash of the data.
	Digest multihash.Multihash
	// Size of the data in bytes.
	Size uint64
}

Jump to

Keyboard shortcuts

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