http

package
v0.7.3 Latest Latest
Warning

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

Go to latest
Published: Feb 10, 2026 License: Apache-2.0, MIT Imports: 14 Imported by: 3

Documentation

Index

Constants

View Source
const PutAbility = "http/put"

Variables

View Source
var Put = validator.NewCapability(
	PutAbility,
	schema.DIDString(),
	PutCaveatsReader,
	func(claimed, delegated ucan.Capability[PutCaveats]) failure.Failure {

		if fail := equalWith(claimed, delegated); fail != nil {
			return fail
		}

		if fail := equalURL(claimed, delegated); fail != nil {
			return fail
		}

		if fail := equalHeaders(claimed, delegated); fail != nil {
			return fail
		}

		if fail := equalBody(claimed, delegated); fail != nil {
			return fail
		}

		return nil
	},
)

Put is a capability that allows the agent to perform an HTTP PUT request.

Functions

func PutCaveatsType

func PutCaveatsType() schema.Type

func PutOkType

func PutOkType() schema.Type

Types

type Body

type Body struct {
	// Digest is the multihash of the blob included in the request body.
	Digest multihash.Multihash

	// Size is the size in bytes of the blob included in the request body.
	Size uint64
}

Body describes the contents of the HTTP PUT request body.

type PutCaveats

type PutCaveats struct {
	URL     types.Promise
	Headers types.Promise
	Body    Body
}

PutCaveats represents the caveats required to perform a http/put invocation.

func (PutCaveats) ToIPLD

func (pc PutCaveats) ToIPLD() (datamodel.Node, error)

type PutOk

type PutOk struct {
}

PutOk represents the successful response for a http/put invocation.

func (PutOk) ToIPLD

func (po PutOk) ToIPLD() (datamodel.Node, error)

type PutReceipt added in v0.0.7

type PutReceipt receipt.Receipt[PutOk, failure.Failure]

type PutReceiptReader added in v0.0.7

type PutReceiptReader receipt.ReceiptReader[PutOk, failure.Failure]

func NewPutReceiptReader added in v0.0.7

func NewPutReceiptReader() (PutReceiptReader, error)

Jump to

Keyboard shortcuts

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