structs

package
v0.4.7 Latest Latest
Warning

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

Go to latest
Published: Jan 24, 2022 License: MIT Imports: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ParseReflectTags

func ParseReflectTags(v reflect.Value) error

func ParseTagValue

func ParseTagValue(str string) maputil.SMap

ParseTagValue string.

func ParseTagValueINI

func ParseTagValueINI(field, str string) (mp maputil.SMap, err error)

ParseTagValueINI tag value string. is like INI format data eg: "name=int0;shorts=i;required=true;desc=int option message"

func ParseTags

func ParseTags(v interface{}) error

ParseTags TODO for parse struct tags.

Types

type Aliases

type Aliases struct {

	// Checker custom add alias name checker func
	Checker func(alias string) // should return bool OR error ??
	// contains filtered or unexported fields
}

Aliases implemented an simple string alias map.

func NewAliases

func NewAliases(checker func(alias string)) *Aliases

NewAliases create

func (*Aliases) AddAlias

func (as *Aliases) AddAlias(real, alias string)

AddAlias to the Aliases

func (*Aliases) AddAliasMap

func (as *Aliases) AddAliasMap(alias2real map[string]string)

AddAliasMap to the Aliases

func (*Aliases) AddAliases

func (as *Aliases) AddAliases(real string, aliases []string)

AddAliases to the Aliases

func (*Aliases) HasAlias

func (as *Aliases) HasAlias(alias string) bool

HasAlias in the Aliases

func (*Aliases) Mapping

func (as *Aliases) Mapping() map[string]string

Mapping get all aliases mapping

func (*Aliases) ResolveAlias

func (as *Aliases) ResolveAlias(alias string) string

ResolveAlias by given name.

type MapDataStore

type MapDataStore struct {
	sync.RWMutex
	// contains filtered or unexported fields
}

MapDataStore struct

func NewMapData

func NewMapData() *MapDataStore

NewMapData create

func (*MapDataStore) ClearData

func (md *MapDataStore) ClearData()

ClearData all data

func (*MapDataStore) Data

func (md *MapDataStore) Data() map[string]interface{}

Data get all

func (*MapDataStore) EnableLock

func (md *MapDataStore) EnableLock()

EnableLock for the operate data

func (*MapDataStore) SetData

func (md *MapDataStore) SetData(data map[string]interface{})

SetData set all data

func (*MapDataStore) SetValue

func (md *MapDataStore) SetValue(key string, val interface{})

SetValue to data

func (*MapDataStore) Value

func (md *MapDataStore) Value(key string) interface{}

Value get from data

type TagParser

type TagParser struct {
	TagName string

	Func func(tagVal string) map[string]string
}

TagParser struct

Jump to

Keyboard shortcuts

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