carrier

package
v0.4.0 Latest Latest
Warning

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

Go to latest
Published: Dec 20, 2025 License: MIT Imports: 2 Imported by: 0

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.

Jump to

Keyboard shortcuts

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