Documentation
¶
Index ¶
Constants ¶
const ( PriorityDefault = 0 PrioritySource = 0 PriorityTransform = 10 PriorityDependent = 20 )
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type AuthoritativeLocator ¶ added in v0.2.0
AuthoritativeLocator distinguishes an owned absence from provider fallback.
type BodyNullPolicyLocator ¶ added in v0.4.0
type BodyNullPolicyLocator interface {
ValueWithBodyNullPolicy(context.Context, reflect.Type, string, string) (any, bool, error)
}
BodyNullPolicyLocator recognizes body null in its native source decoder. The policy is invocation-local: implementations must never mutate a provider or treat an arbitrary provider's nil value as evidence of JSON literal null.
type CachePolicy ¶ added in v0.2.0
type CachePolicy interface{ DefaultCacheable() bool }
type MetadataScope ¶ added in v0.2.0
type MetadataScope interface{ MetadataRequested() bool }
MetadataScope is an optional capability; existing Scope implementations need not implement it. Providers may avoid producing metadata unless requested.
type Provider ¶
type Provider interface {
Locate(state *structology.State) Locator
Kind() string
Priority() int
}
func ComposeProviders ¶ added in v0.2.0
func ComposeProviders(kind string, layers ...ProviderLayer) (Provider, error)
type ProviderLayer ¶ added in v0.2.0
type Registry ¶
func NewRegistry ¶
func NewRegistry() *Registry
func (*Registry) Child ¶ added in v0.3.0
Child creates an empty provider layer that falls back to this registry.
func (*Registry) Keys ¶ added in v0.3.0
Keys returns the distinct provider kinds visible in this registry. Local providers shadow parent providers with the same kind.
func (*Registry) Unregister ¶
Unregister unregisters a provider for a given kind
type ScopedLocator ¶ added in v0.2.0
type SourceCapturer ¶ added in v0.2.0
type SourceCapturer interface {
CaptureSource(context.Context, reflect.Type, string) (any, bool, error)
}
SourceCapturer lets a source preserve its raw representation before target decoding (for example JSON body omission/number precision). JSON source bytes use json.RawMessage; other values retain normal declared source conversion. Implementations must not bind targets or evaluate downstream dependencies.
type ValueWithMetadata ¶ added in v0.2.0
ValueWithMetadata is a reserved provider result envelope. Bindly exposes Value through its ordinary APIs and transports Metadata only to an opt-in observer. Metadata is opaque, invocation-scoped, and must be immutable or otherwise safe for all consumers of a cached resolution. It is never serialized by Bindly.