Help us shape the future of Go! Take the 2026 Go Developer Survey

transform

package
v2.12.1 Latest Latest
Warning

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

Go to latest
Published: Jun 22, 2026 License: Apache-2.0 Imports: 8 Imported by: 1

Documentation

Index

Constants

This section is empty.

Variables

View Source
var DefaultValues = map[tree.Path]Func{}

DefaultValues contains the default value transformers for compose fields

Functions

func Canonical

func Canonical(yaml map[string]any, ignoreParseError bool) (map[string]any, error)

Canonical transforms a compose model into canonical syntax

func RegisterDefaultValue added in v2.8.0

func RegisterDefaultValue(path string, transformer Func)

RegisterDefaultValue registers a custom transformer for the given path pattern

func SetDefaultValues

func SetDefaultValues(yaml map[string]any) (map[string]any, error)

SetDefaultValues transforms a compose model to set default values to missing attributes

Types

type Func added in v2.8.0

type Func func(data any, p tree.Path, ignoreParseError bool) (any, error)

Func is a function that can transform data at a specific path

Jump to

Keyboard shortcuts

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