structinfo

package
v0.0.0-...-88236ff Latest Latest
Warning

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

Go to latest
Published: May 25, 2020 License: Apache-2.0 Imports: 5 Imported by: 0

README

structinfo

struct info, modified from encoding/json

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	SupportedTags = []string{"prop", "yaml", "json"}
)

Functions

This section is empty.

Types

type FieldInfo

type FieldInfo struct {
	Key       string
	Num       int
	OmitEmpty bool
	Flow      bool
	// Id holds the unique field identifier, so we can cheaply
	// check for field duplicates without maintaining an extra map.
	Id int
	// Inline holds the field index if the field is part of an inlined struct.
	Inline []int
}

type StructInfo

type StructInfo struct {
	FieldsMap      map[string]FieldInfo
	FieldsList     []FieldInfo
	InlineMapIndex int // 如果结构体包含inline map, 这是index。
}

从encoding/json拷贝 StructInfo 结构体的信息

func Get

func Get(st reflect.Type, useTag string) (*StructInfo, error)

type TagOptions

type TagOptions string

TagOptions is the string following a comma in a struct field's "json" tag, or the empty string. It does not include the leading comma.

func (TagOptions) Contains

func (o TagOptions) Contains(optionName string) bool

Jump to

Keyboard shortcuts

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