Help us shape the future of Go! Take the 2026 Go Developer Survey

adapter

package
v1.10.0-alpha.15 Latest Latest
Warning

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

Go to latest
Published: Oct 21, 2026 License: MIT Imports: 4 Imported by: 0

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