jsonutil

package
v2.6.0 Latest Latest
Warning

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

Go to latest
Published: Jan 30, 2024 License: Apache-2.0 Imports: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func DropElement

func DropElement(extension []byte, elementNames ...string) ([]byte, error)

Drops element from json byte array - Doesn't support drop element from json list - Keys in the path can skip levels - First found element will be removed

func FindElement

func FindElement(extension []byte, elementNames ...string) (bool, int64, int64, error)

Finds element in json byte array with any level of nesting

func Marshal

func Marshal(v interface{}) ([]byte, error)

Marshal marshals a data structure into a byte slice without performing any validation on the data. A marshal error is returned if a non-validation error occurs.

func Unmarshal

func Unmarshal(data []byte, v interface{}) error

Unmarshal unmarshals a byte slice into the specified data structure without performing any validation on the data. An unmarshal error is returned if a non-validation error occurs.

func UnmarshalValid

func UnmarshalValid(data []byte, v interface{}) error

UnmarshalValid validates and unmarshals a byte slice into the specified data structure returning an error if validation fails

Types

type StringInt

type StringInt int

func (*StringInt) UnmarshalJSON

func (st *StringInt) UnmarshalJSON(b []byte) error

Jump to

Keyboard shortcuts

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