cache

package
v0.1.2 Latest Latest
Warning

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

Go to latest
Published: Sep 15, 2022 License: Apache-2.0 Imports: 3 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type FieldMetadata

type FieldMetadata struct {
	Index                 []int
	Paths                 TagsPath
	Type                  reflect.Type
	ImplementUnmarshaller bool
	ArrayOrSlice          bool
	DefaultValue          string
	Exploder              string
}

FieldMetadata contains all the necessary field to decode

func (FieldMetadata) GetDefaultFieldName

func (f FieldMetadata) GetDefaultFieldName() string

type StructAnalyzer

type StructAnalyzer struct {
	// contains filtered or unexported fields
}

StructAnalyzer is the cache struct analyzer

func NewStructAnalyzer

func NewStructAnalyzer(stringsTags, valueTags []string, mainStructType reflect.Type) *StructAnalyzer

NewStructAnalyzer instantiate a new StructAnalyzer

func (StructAnalyzer) Cache

func (s StructAnalyzer) Cache() StructCache

Cache will take all fields which contain a tag to be lookup.

type StructCache

type StructCache struct {
	IsRoot     bool
	Index      []int
	Resolvable []FieldMetadata

	Child []StructCache
}

StructCache

func (StructCache) String

func (s StructCache) String() string

String is a way to debug StructCache

type TagsPath

type TagsPath map[string]string

TagsPath is a simple map that register from a tag the path of the field.

func (TagsPath) Add

func (t TagsPath) Add(tag string, key string)

Add will add or create the path for a given tag. If the tag exist it will add it with the dot notation.

Jump to

Keyboard shortcuts

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