inproc

package
v1.3.1 Latest Latest
Warning

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

Go to latest
Published: Jun 11, 2026 License: Apache-2.0 Imports: 3 Imported by: 0

Documentation

Overview

Package inproc is the public SDK facade over Harbor's internal/tools/drivers/inproc package — the in-process tool driver that registers plain Go functions as Tools with reflection-derived schemas (RFC §3.6, §6.10; D-204). RegisterFunc is generic, so it is forwarded as a wrapper (Go has no generic function values); the wrapper adds no behavior. Schema-derivation internals are deliberately private.

Index

Constants

This section is empty.

Variables

View Source
var (
	// ErrSchemaBuild — JSON-schema derivation failed for I or O.
	ErrSchemaBuild = internal.ErrSchemaBuild
	// ErrUnsupportedType — I or O is not schema-derivable.
	ErrUnsupportedType = internal.ErrUnsupportedType
)

Re-exported sentinel errors callers compare via errors.Is.

Functions

func RegisterFunc

func RegisterFunc[I any, O any](
	cat tools.ToolCatalog,
	name string,
	fn func(ctx context.Context, in I) (O, error),
	opts ...tools.DescriptorOption,
) error

RegisterFunc registers a Go function as a Tool on the catalog. Input and output schemas are derived from the type parameters I and O via reflection; opts configure the descriptor (policy, scopes, description, examples — see the sdk/tools DescriptorOption set). `fn` must be safe for concurrent invocation (D-025). Thin generic forward over the internal driver; no behavior is added.

Types

This section is empty.

Jump to

Keyboard shortcuts

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