refs

package
v0.13.0 Latest Latest
Warning

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

Go to latest
Published: Apr 30, 2026 License: Apache-2.0 Imports: 7 Imported by: 0

Documentation

Overview

Package refs provides functions for extracting resolver references from Go templates and CEL expressions.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ExtractFromCEL

func ExtractFromCEL(ctx context.Context, expr string) ([]string, error)

ExtractFromCEL extracts resolver references from a CEL expression.

func ExtractFromTemplate

func ExtractFromTemplate(content, leftDelim, rightDelim string) ([]string, error)

ExtractFromTemplate extracts resolver references from a Go template string.

func ExtractFromTemplateFile

func ExtractFromTemplateFile(filePath, leftDelim, rightDelim string) ([]string, error)

ExtractFromTemplateFile reads a template file and extracts resolver references.

func ExtractResolverName

func ExtractResolverName(path string) string

ExtractResolverName extracts the resolver name from a template path. e.g., "._.config.host" -> "config", ".config" -> "config"

func ReadStdin

func ReadStdin(r io.Reader) (string, error)

ReadStdin reads all content from the given reader, trimming trailing newlines.

Types

type Output

type Output struct {
	Source     string   `json:"source" yaml:"source"`
	SourceType string   `json:"sourceType" yaml:"sourceType"`
	References []string `json:"references" yaml:"references"`
	Count      int      `json:"count" yaml:"count"`
}

Output represents the output structure for resolver reference extraction.

Jump to

Keyboard shortcuts

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