Help us shape the future of Go! Take the 2026 Go Developer Survey

json

package
v0.0.73 Latest Latest
Warning

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

Go to latest
Published: Sep 25, 2026 License: Apache-2.0 Imports: 6 Imported by: 2

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type JsonTreeImporter

type JsonTreeImporter struct {
	*JsonTreeImporterElement
	// contains filtered or unexported fields
}

func NewJsonTreeImporter

func NewJsonTreeImporter(d any, intentName string, priority int32, nonRevertive bool) *JsonTreeImporter

func (*JsonTreeImporter) GetName

func (j *JsonTreeImporter) GetName() string

func (*JsonTreeImporter) GetNonRevertive added in v0.0.67

func (j *JsonTreeImporter) GetNonRevertive() bool

func (*JsonTreeImporter) GetPriority added in v0.0.67

func (j *JsonTreeImporter) GetPriority() int32

type JsonTreeImporterElement added in v0.0.67

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

func (*JsonTreeImporterElement) GetDeletes added in v0.0.67

func (j *JsonTreeImporterElement) GetDeletes() *sdcpb.PathSet

func (*JsonTreeImporterElement) GetElement added in v0.0.67

GetElement returns a child element by key, or nil if not found. Tries exact match first, then falls back to local-name match (after ":") to handle RFC 7951 JSON_IETF module-prefixed keys (e.g. "openconfig-if:name" matched by "name").

func (*JsonTreeImporterElement) GetElements added in v0.0.67

GetElements returns all child elements at this level. Module prefixes in keys are stripped to local names so the processor can look them up in the schema tree by bare name. Plain JSON keys (no ":") are passed through unchanged.

func (*JsonTreeImporterElement) GetKeyValue added in v0.0.67

GetKeyValue returns the string form of the underlying key value, normalised to the bare identity name (no module prefix) for identityref types. This mirrors the XML and proto importers, which already call GetTVValue + tv.ToString(). Without normalisation, a JSON_IETF-encoded identityref value (e.g. "openconfig-policy-types:BGP") and a plain JSON value for the same identity ("BGP") would be treated as different tree keys, splitting one logical list entry into two.

slt is optional: when nil, the raw value is stringified directly instead of calling GetTVValue, whose underlying ConvertJsonValueToTv switches on slt.Type and would panic on a nil slt.

func (*JsonTreeImporterElement) GetName added in v0.0.67

func (j *JsonTreeImporterElement) GetName() string

func (*JsonTreeImporterElement) GetTVValue added in v0.0.67

Jump to

Keyboard shortcuts

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