internal

package
v0.1.1 Latest Latest
Warning

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

Go to latest
Published: Aug 6, 2024 License: MIT Imports: 8 Imported by: 0

Documentation

Overview

Json util

Jsonpath util

Param util

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func AddParamInt

func AddParamInt(m map[string]any, key string, value int, targetType definition.ParamType) error

AddParamInt: Insert a int into map[string]any as targetType

func AddParamString

func AddParamString(m map[string]any, key string, value string, targetType definition.ParamType) error

AddParamString: Insert a string into map[string]any as targetType

func JsonMarshal

func JsonMarshal(v any) (*json.RawMessage, error)

JsonMarshal: Convert interface{} to *json.RawMessage

func JsonUnmarshal

func JsonUnmarshal(data []byte, v any) error

JsonUnmarshal: Unmarshal json string and treat number as json.Number

func ParseJsonPath

func ParseJsonPath(input *json.RawMessage, path string) (*json.RawMessage, error)

func ParseJsonPathList

func ParseJsonPathList(input *json.RawMessage, path string, bObjAsList bool) ([]*json.RawMessage, error)

ParseJsonPathList: Parse JsonPath and try to return the result as a list

func ParseJsonPathStr

func ParseJsonPathStr(input *json.RawMessage, path string) (string, error)

ParseJsonPathStr: Parse JsonPath and try to convert result to single string

Types

This section is empty.

Jump to

Keyboard shortcuts

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