aliasdata

package
v0.2.0 Latest Latest
Warning

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

Go to latest
Published: Nov 18, 2026 License: Apache-2.0 Imports: 5 Imported by: ? modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Overview

Package aliasdata supplies node-based YAML anchor and alias policies. New without options explicitly selects retention of stream anchors. Source options default to document scope; WithPath(true) enables stream scope. WithStream explicitly overrides either default. Without an explicit selection, go-yaml uses ordinary document scope.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Option

type Option func(*Plugin)

Option configures an Alias-Data plugin.

func WithData

func WithData(data map[string]any) Option

WithData supplies named external values, converted to nodes per stream.

func WithDisable

func WithDisable(disabled bool) Option

WithDisable rejects alias references while allowing anchor declarations. Disabled policies do not read or validate saved source configuration.

func WithEnv

func WithEnv(selector any) Option

WithEnv selects environment values with a bool, string, or string sequence. Only * has wildcard meaning in a string selector.

func WithFile

func WithFile(path string) Option

WithFile supplies a single mapping document of named external values.

func WithPath

func WithPath(enabled bool) Option

WithPath controls dotted mapping and sequence lookups in alias names. Enabling paths enables stream mode unless WithStream overrides that default.

func WithStream

func WithStream(enabled bool) Option

WithStream controls retention of anchors across documents in one stream.

type Plugin

type Plugin struct {
	// contains filtered or unexported fields
}

Plugin stores reusable configuration. Sources are read once per context. Callers must not mutate supplied data while a new context is being created.

func New

func New(options ...Option) (*Plugin, error)

New creates a reusable plugin. Empty explicit selection enables stream mode. Validation does not read files or environment values.

func NewFromYAML

func NewFromYAML(config map[string]any) (*Plugin, error)

NewFromYAML validates configuration without reading any source data. Nonempty configurations default to document scope unless path is true. An explicit stream setting overrides that default, matching YAMLStar.

func (*Plugin) NewAliasDataContext

func (p *Plugin) NewAliasDataContext(
	services libyaml.AliasDataServices,
) (libyaml.AliasDataContext, error)

NewAliasDataContext snapshots configured sources for a fresh input stream.

Jump to

Keyboard shortcuts

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