bind

package
v1.0.0 Latest Latest
Warning

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

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

Documentation

Overview

Package bind holds public binder-scoped provider, scope, and typed lookup contracts.

It exists for stable DI/value-resolution contracts only. It intentionally stops short of promoting Datly's current reflection/type-specific injection logic, because that logic is still runtime-colored rather than a proven cross-runtime public contract.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Lookup

func Lookup[T any](ctx context.Context, binder xhandler.Binder, key xhandler.ValueKey) (T, bool, error)

Lookup resolves a binder value and type-asserts it to T. Unknown keys return (zero, false, nil).

func MustLookup

func MustLookup[T any](ctx context.Context, binder xhandler.Binder, key xhandler.ValueKey) (T, error)

MustLookup resolves a binder value, returning an error when the key is unknown or when the resolved value does not match T.

Types

type Provider

type Provider interface {
	Key() xhandler.ValueKey
	Resolve(ctx context.Context) (any, error)
}

Provider resolves one binder-scoped value. Implementations remain runtime- owned; this package only defines the public contract they target.

type Scope

type Scope interface {
	Binder() xhandler.Binder
}

Scope exposes the binder-backed resolution surface for one invocation or other bounded value scope.

Jump to

Keyboard shortcuts

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