receipt

package
v0.2.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: 20 Imported by: 3

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type AnyReceipt

type AnyReceipt Receipt[ipld.Node, ipld.Node]

func Issue

func Issue[O, X ipld.Builder](issuer ucan.Signer, out result.Result[O, X], ran ran.Ran, opts ...Option) (AnyReceipt, error)

type Option

type Option func(cfg *receiptConfig) error

Option is an option configuring a UCAN delegation.

func WithFork

func WithFork(forks ...fx.Effect) Option

WithFork configures the forks for the receipt.

func WithJoin

func WithJoin(join fx.Effect) Option

WithJoin configures the join for the receipt.

func WithMeta

func WithMeta(meta map[string]any) Option

WithMeta configures the metadata for the receipt.

func WithProofs

func WithProofs(prf delegation.Proofs) Option

WithProofs configures the proofs for the receipt. If the `issuer` of this `Receipt` is not the resource owner / service provider, for the delegated capabilities, the `proofs` must contain valid `Proof`s containing delegations to the `issuer`.

type Receipt

type Receipt[O, X any] interface {
	ipld.View
	Ran() invocation.Invocation
	Out() result.Result[O, X]
	Fx() fx.Effects
	Meta() map[string]any
	Issuer() ucan.Principal
	Proofs() delegation.Proofs
	Signature() signature.SignatureView
}

Receipt represents a view of the invocation receipt. This interface provides an ergonomic API and allows you to reference linked IPLD objects if they are included in the source DAG.

func NewReceipt

func NewReceipt[O, X any](root ipld.Link, blocks blockstore.BlockReader, typ schema.Type) (Receipt[O, X], error)

type ReceiptReader

type ReceiptReader[O, X any] interface {
	Read(rcpt ipld.Link, blks iter.Seq2[block.Block, error]) (Receipt[O, X], error)
}

func NewReceiptReader

func NewReceiptReader[O, X any](resultschema []byte) (ReceiptReader[O, X], error)

func NewReceiptReaderFromTypes

func NewReceiptReaderFromTypes[O, X any](successType schema.Type, errType schema.Type) (ReceiptReader[O, X], error)

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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