util

package
v0.14.0 Latest Latest
Warning

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

Go to latest
Published: Jan 27, 2022 License: Apache-2.0 Imports: 16 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func CheckForElidedFields

func CheckForElidedFields(struct_ interface{}) report.Report

Report an ErrFieldElided warning for any non-zero top-level fields in the specified output struct. The caller will probably want to use translate.PrefixReport() to reparent the report into the right place in the `json` hierarchy, and then TranslateReportPaths() to map back into `yaml` space.

func Translate

func Translate(cfg interface{}, translateMethod string, options common.TranslateOptions) (interface{}, report.Report, error)

Translate translates cfg to the corresponding Ignition config version using the named translation method on cfg, and returns the marshaled Ignition config. It returns a report of any errors or warnings in the source and resultant config. If the report has fatal errors or it encounters other problems translating, an error is returned.

func TranslateBytes

func TranslateBytes(input []byte, container interface{}, translateMethod string, options common.TranslateBytesOptions) ([]byte, report.Report, error)

TranslateBytes unmarshals the Butane config specified in input into the struct pointed to by container, translates it to the corresponding Ignition config version using the named translation method, and returns the marshaled Ignition config. It returns a report of any errors or warnings in the source and resultant config. If the report has fatal errors or it encounters other problems translating, an error is returned.

func TranslateBytesYAML

func TranslateBytesYAML(input []byte, container interface{}, translateMethod string, options common.TranslateBytesOptions) ([]byte, report.Report, error)

func TranslateReportPaths

func TranslateReportPaths(r report.Report, ts translate.TranslationSet) report.Report

TranslateReportPaths takes a report from a camelCase json document and a set of translations rules, applies those rules and converts all camelCase to snake_case.

Types

This section is empty.

Jump to

Keyboard shortcuts

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