json

package
v0.0.9 Latest Latest
Warning

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

Go to latest
Published: Mar 13, 2023 License: Apache-2.0 Imports: 11 Imported by: 2

Documentation

Overview

antlabs, guonaihong 2023 apache 2.0

antlabs, guonaihong 2023 apache 2.0

Index

Constants

This section is empty.

Variables

View Source
var ErrValid = errors.New("valid json")

Functions

func Marshal

func Marshal[T Type](t T, opt ...option.OptionFunc) (b []byte, err error)

func Valid

func Valid[T string | []byte](t T) bool

func ValidAndUnmarshal added in v0.0.8

func ValidAndUnmarshal(b []byte) (o map[string]any, a []any, err error)

Types

type JSON

type JSON struct {
	option.Option // 内嵌配置信息

	Indent int // 控制输出缩进
	// contains filtered or unexported fields
}

type Type

type Type interface {
	[]byte | map[string]any | []any
}

Jump to

Keyboard shortcuts

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