jsonlib

package
v0.6.10-0...-926069d Latest Latest
Warning

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

Go to latest
Published: Aug 25, 2023 License: GPL-3.0 Imports: 2 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func MapToStruct

func MapToStruct[T any](m map[string]any) (T, error)

func StructToMap

func StructToMap(s any) (map[string]any, error)

Types

type Flatten

type Flatten[T any] struct {
	Defined T
	Extra   map[string]any
}

T should be a struct or map[string]

func (*Flatten[T]) FromMap

func (f *Flatten[T]) FromMap(m map[string]any) error

func (Flatten[T]) MarshalJSON

func (f Flatten[T]) MarshalJSON() ([]byte, error)

func (Flatten[T]) ToMap

func (f Flatten[T]) ToMap() (map[string]any, error)

func (*Flatten[T]) UnmarshalJSON

func (f *Flatten[T]) UnmarshalJSON(b []byte) error

Jump to

Keyboard shortcuts

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