jsonkit

package module
v1.0.3 Latest Latest
Warning

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

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

README

jsonkit - A json process tool for json cutting, json comment and so on.

Visit At GitRepo

QuickStart

Install to Go

$ go get github.com/runingriver/jsonkit

How to use?

Function

Config

Example

please read example_test.go

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func GlobalConfig

func GlobalConfig() *jconf.GlobalConfig

func JsonAnnotate

func JsonAnnotate(ctx context.Context, jsonMap map[string]interface{}, cfg *jconf.AnnotateConfig) (map[string]interface{}, error)

JsonAnnotate Json注释,给JsonVal上加注释

func JsonMapCutter

func JsonMapCutter(ctx context.Context, jsonMap map[string]interface{}, cfg *jconf.CutterConfig) (map[string]interface{}, error)

JsonMapCutter 剪裁map

func JsonProcess

func JsonProcess(ctx context.Context, jsonMap map[string]interface{}, opts ...JsonProcessOption) (m map[string]interface{}, err error)

JsonProcess 传入tcc或byte conf配置进行json的cut和annotate

func JsonStrAnnotate

func JsonStrAnnotate(ctx context.Context, jsonStr string, cfg *jconf.AnnotateConfig) (string, error)

JsonStrAnnotate Json注释,给JsonVal上加注释

func JsonStrCutter

func JsonStrCutter(ctx context.Context, jsonStr string, cfg *jconf.CutterConfig) (string, error)

JsonStrCutter 对json str进行剪裁

Types

type JsonProcessOpt

type JsonProcessOpt struct {
	Config string
}

type JsonProcessOption

type JsonProcessOption func(*JsonProcessOpt)

func WithConfig

func WithConfig(config string) JsonProcessOption

Directories

Path Synopsis
internal
pkg

Jump to

Keyboard shortcuts

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