client

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: 10 Imported by: 4

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Connection

type Connection interface {
	ID() ucan.Principal
	Channel() transport.Channel
	Codec() transport.OutboundCodec
	Hasher() hash.Hash
}

func NewConnection

func NewConnection(id ucan.Principal, channel transport.Channel, options ...Option) (Connection, error)

type ExecutionResponse

type ExecutionResponse interface {
	// Blocks returns an iterator of all the IPLD blocks that are included in
	// the response.
	Blocks() iter.Seq2[block.Block, error]
	// Get returns a link to a receipt, given an invocation link.
	Get(inv ucan.Link) (ucan.Link, bool)
}

func Execute

func Execute(invocations []invocation.Invocation, conn Connection) (ExecutionResponse, error)

type Option

type Option func(cfg *connConfig) error

Option is an option configuring a ucanto connection.

func WithHasher

func WithHasher(hasher func() hash.Hash) Option

WithHasher configures the hasher factory.

func WithOutboundCodec

func WithOutboundCodec(codec transport.OutboundCodec) Option

WithOutboundCodec configures the codec used to encode requests and decode responses.

Jump to

Keyboard shortcuts

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