model

package
v0.0.1 Latest Latest
Warning

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

Go to latest
Published: Dec 2, 2025 License: Apache-2.0 Imports: 14 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func NaturalDecode

func NaturalDecode(data any, es *entity.EncodedSchema) (*entity.Entity, error)

Types

type ParsedFile

type ParsedFile struct {
	Format   string
	Entities []*entity.Entity
}

type SchemaValue

type SchemaValue struct {
	Id       string         `json:"id,omitempty" yaml:"id,omitempty" cbor:"id,omitempty"`
	Kind     string         `json:"kind" yaml:"kind" cbor:"kind"`
	Version  string         `json:"version" yaml:"version" cbor:"version"`
	Metadata map[string]any `json:"metadata,omitempty" yaml:"metadata,omitempty" cbor:"metadata,omitempty"`
	Spec     map[string]any `json:"spec" yaml:"spec" cbor:"spec"`
}

func NaturalEncode

func NaturalEncode(e *entity.Entity, es *entity.EncodedSchema) (*SchemaValue, error)

type TextFormatter

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

func NewTextFormatter

func NewTextFormatter(sc *entity.SchemaCache) (*TextFormatter, error)

func (*TextFormatter) Format

func (f *TextFormatter) Format(ctx context.Context, ent *entity.Entity) (string, error)

Format produces a textual representation of an entity by YAML encoding its attributes.

func (*TextFormatter) Parse

func (f *TextFormatter) Parse(ctx context.Context, data []byte) (*ParsedFile, error)

Jump to

Keyboard shortcuts

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