valuesutil

package
v0.0.0-...-5f287d4 Latest Latest
Warning

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

Go to latest
Published: Jun 5, 2024 License: Apache-2.0 Imports: 11 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Generate

func Generate(rng *rand.Rand, s *jsonschema.Schema) any

Generate generates a go values that is valid for the provided JSON schema. It may be used to "fuzz" or property test charts to ensure that all paths are appropriately explored and that the schema is well formed for the chart.

func GenerateSchema

func GenerateSchema(instance any) *jsonschema.Schema

func RoundTripThrough

func RoundTripThrough[T any, K any](input K) (K, error)

RoundTripThrough round trips input through T. It may be used to understand how various types affect JSON marshalling or apply go's defaulting to an untyped value.

func UnmarshalInto

func UnmarshalInto[T any](input any) (T, error)

UnmarshalInto "converts" input into T by marshalling input to JSON and then unmarshalling into T.

func Validate

func Validate(schema *jsonschema.Schema, instance any) error

Validate returns an error if instance is not considered valid by schema. Otherwise it returns nil.

Types

This section is empty.

Jump to

Keyboard shortcuts

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