jsonfieldnames

package
v0.10.0 Latest Latest
Warning

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

Go to latest
Published: May 28, 2024 License: MIT Imports: 3 Imported by: 0

Documentation

Overview

Package jsonfieldnames contains a function to extract JSON field names from a value.

In addition to their fixed, hardcoded members, business objects for energy marshal additional values into Geschaeftsobjekt.ExtensionData. As Go's standard library JSON package has no option for a kitchen sink field accepting all remaining JSON fields, there are two passes of unmarshaling: Once into the struct, once into a generic map. To avoid duplicates in the struct and the map, fields that can be found in the struct are removed from the map. This package provides a mechanism to extract the names of these fields in a generic way.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Extract

func Extract(value interface{}) ([]string, error)

Extract extracts JSON field names from a struct value or a pointer to a struct value. If the value passed to Extract is either nil or is not a struct value or a pointer to a struct value, an error is returned instead.

Types

This section is empty.

Jump to

Keyboard shortcuts

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