unmarshal

package
v0.145.0 Latest Latest
Warning

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

Go to latest
Published: Dec 17, 2024 License: Apache-2.0 Imports: 10 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func FromRaw added in v0.115.0

func FromRaw(body []byte, format RawFormat, out proto.Message, doValidate bool) error

func LoadJSONBytes

func LoadJSONBytes(rawData []byte, extension string) ([]byte, error)

LoadJSONBytes Extracts raw data in JSON format from different sources, i.e cue or yaml files

Types

type RawFormat

type RawFormat string
const (
	RawFormatJSON RawFormat = "json"
	RawFormatYAML RawFormat = "yaml"
	RawFormatCUE  RawFormat = "cue"
)

func IdentifyFormat

func IdentifyFormat(raw []byte) (RawFormat, error)

IdentifyFormat does best effort to identify the format of the raw contract by going the unmarshalling path in the following order: json, cue, yaml NOTE that we are just validating the format, not the content using regular marshalling not even proto marshalling, that comes later once we know the format

func (RawFormat) Values

func (RawFormat) Values() (kinds []string)

Implements https://pkg.go.dev/entgo.io/ent/schema/field#EnumValues

Jump to

Keyboard shortcuts

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