adapter

package
v1.12.0 Latest Latest
Warning

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

Go to latest
Published: Nov 23, 2026 License: MIT Imports: 4 Imported by: ? modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Overview

Package adapter implements the type-erased adapter boundary for typed activities.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Assign

func Assign(dst, src any) error

Assign copies a result into its typed destination without a serialization round trip.

func ValidateCall

func ValidateCall(name string, input any) error

ValidateCall rejects malformed invocations before scheduling commands.

Types

type Handler

type Handler struct {
	// contains filtered or unexported fields
}

Handler retains the concrete function signature required by backend codecs.

func New

func New(fn any) (Handler, error)

New validates a handler once, before backend registration.

func (Handler) Call

func (h Handler) Call(ctx context.Context, input any) (any, error)

Call invokes a validated handler without a serialization round trip.

func (Handler) Wrap

func (h Handler) Wrap(ctxFn func(context.Context) context.Context, errFn func(error) error) any

Wrap preserves the native signature while adapting context and errors.

Jump to

Keyboard shortcuts

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