ocbinds

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

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

Go to latest
Published: Apr 24, 2024 License: Apache-2.0 Imports: 16 Imported by: 1

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func EmitJSON

func EmitJSON(s ygot.ValidatedGoStruct, opts *EmitJSONOptions) ([]byte, error)

EmitJSON serializes a GoStruct s into RFC7951 json.

func GetSchema

func GetSchema() (*ytypes.Schema, error)

GetSchema is equivalent of the Schema function, but avoids UnzipSchema call. Reuses the SchemaTree loaded during init.

Types

type EmitJSONOptions

type EmitJSONOptions struct {
	NoPrefix bool // Render node & enum names without module prefix
	SortList bool // Sort lists by keys
}

type Values

type Values interface {
	sort.Interface
	At(i int) reflect.Value
}

Values represents a sequence of reflect.Value objects.

func SortedMap

func SortedMap(v *reflect.Value) Values

SortedMap returns map values sorted by its key. Integer keys (both signed and unsigned) are sorted by numerical order. String keys are sorted by natural order. Other keys are converted to string using fmt.Sprintf("%v", k) and sorted.

Jump to

Keyboard shortcuts

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