Help us shape the future of Go! Take the 2026 Go Developer Survey

annotate

package
v1.0.2 Latest Latest
Warning

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

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

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	ArrayAnnotateIns = &ArrayAnnotate{}
)
View Source
var (
	EnumAnnotateIns = &EnumAnnotate{}
)
View Source
var (
	NormalAnnotateIns = &NormalAnnotate{}
)
View Source
var (
	UnmarshalStrIns = &UnmarshalStr{}
)

Functions

func NotateVal

func NotateVal(val interface{}, annotate *jconf.AnnotateFmt) (string, bool)

NotateVal 给val加注释

func UnitToStr

func UnitToStr(val interface{}, unitCvt *jconf.UnitCvt) string

Types

type ArrayAnnotate

type ArrayAnnotate struct {
}

func (*ArrayAnnotate) DoArrayAnnotate

func (e *ArrayAnnotate) DoArrayAnnotate(ctx context.Context, jsonMap map[string]interface{}, cfg map[string]*jconf.AnnotateFmt) (map[string]interface{}, error)

func (*ArrayAnnotate) DoOnePath

func (e *ArrayAnnotate) DoOnePath(ctx context.Context, jsonMap map[string]interface{}, path string, fmt *jconf.AnnotateFmt) (m map[string]interface{}, err error)

DoOnePath x.y.z z对应的val一定是个list,z不能是index.

type EnumAnnotate

type EnumAnnotate struct {
}

func (*EnumAnnotate) DoEnumAnnotate

func (e *EnumAnnotate) DoEnumAnnotate(ctx context.Context, jsonMap map[string]interface{}, cfg map[string]*jconf.AnnotateFmt) (map[string]interface{}, error)

func (*EnumAnnotate) DoOnePath

func (e *EnumAnnotate) DoOnePath(ctx context.Context, jsonMap map[string]interface{}, path string, fmt *jconf.AnnotateFmt) (m map[string]interface{}, err error)

type JsonAnnotateImpl

type JsonAnnotateImpl struct {
}

func GetJsonAnnotate

func GetJsonAnnotate() *JsonAnnotateImpl

func (*JsonAnnotateImpl) DoForArrayAnnotate

func (j *JsonAnnotateImpl) DoForArrayAnnotate(ctx context.Context, jsonMap map[string]interface{}, cfg map[string]*jconf.AnnotateFmt) (map[string]interface{}, error)

func (*JsonAnnotateImpl) DoForEnumAnnotate

func (j *JsonAnnotateImpl) DoForEnumAnnotate(ctx context.Context, jsonMap map[string]interface{}, cfg map[string]*jconf.AnnotateFmt) (map[string]interface{}, error)

func (*JsonAnnotateImpl) DoForNormalAnnotate

func (j *JsonAnnotateImpl) DoForNormalAnnotate(ctx context.Context, jsonMap map[string]interface{}, cfg map[string]*jconf.AnnotateFmt) (map[string]interface{}, error)

func (*JsonAnnotateImpl) DoForUnmarshalStr

func (j *JsonAnnotateImpl) DoForUnmarshalStr(ctx context.Context, jsonMap map[string]interface{}, cfg *jconf.JsonStrAction) (map[string]interface{}, error)

func (*JsonAnnotateImpl) JsonAnnotate

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

type NormalAnnotate

type NormalAnnotate struct {
}

func (*NormalAnnotate) DoNormalAnnotate

func (e *NormalAnnotate) DoNormalAnnotate(ctx context.Context, jsonMap map[string]interface{}, cfg map[string]*jconf.AnnotateFmt) (map[string]interface{}, error)

func (*NormalAnnotate) DoOnePath

func (e *NormalAnnotate) DoOnePath(ctx context.Context, jsonMap map[string]interface{}, path string, fmt *jconf.AnnotateFmt) (map[string]interface{}, error)

type UnmarshalStr

type UnmarshalStr struct {
}

func (*UnmarshalStr) UnmarshalStr

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

Jump to

Keyboard shortcuts

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