schema

package
v0.9.0 Latest Latest
Warning

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

Go to latest
Published: Nov 24, 2026 License: Apache-2.0 Imports: 8 Imported by: ? modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func JSONSchema

func JSONSchema(d *Desc, target string) (map[string]any, error)

func Parse

func Parse(d *Desc, value any, report Report) rt.V

func Payload

func Payload(d *Desc, v rt.V) any

Types

type Desc

type Desc struct {
	Kind          string
	Name          string
	GoType        string
	Bits          int
	Bound         string
	First, Second *Desc
	Variants      []Variant
	Cases         []string
	Bounds        map[string]string
	Ref           func() *Desc
}

type Field

type Field struct {
	Key            string
	Desc           *Desc
	Slot           string
	Offset         int
	Flat, OmitNone bool
	Bounds         map[string]string
}

type Report

type Report func(message string, path ...any)

type Variant

type Variant struct {
	Name                 string
	Tag                  uint16
	Objects, ScalarBytes int
	Trivial              bool
	Positional           bool
	Fields               []Field
}

func (Variant) Build

func (v Variant) Build(fields []rt.V) rt.V

func (Variant) Get

func (v Variant) Get(value rt.V, i int) rt.V

Jump to

Keyboard shortcuts

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