Documentation
¶
Overview ¶
Package carrier provides carrier type matching for context propagation.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func Match ¶
func Match(param *dst.Field, registry *config.CarrierRegistry) (config.CarrierDef, string, bool)
Match extracts carrier info from a function parameter. It returns the carrier definition, variable name, and a boolean indicating success.
The function supports:
- Direct types with resolved paths (from NewDecoratorFromPackage)
- Selector expressions (pkg.Type) with path set by decorator
- Pointer types (*T)
Note: This requires type-resolved DST (via NewDecoratorFromPackage). The dst.Ident.Path field must be set for carrier matching to work.
Parameters:
- param: The function parameter field to analyze
- registry: The carrier registry to lookup types
Returns:
- config.CarrierDef: The matched carrier definition
- string: The variable name of the parameter
- bool: true if a carrier was matched, false otherwise
Types ¶
This section is empty.
Click to show internal directories.
Click to hide internal directories.