core

package
v0.8.0 Latest Latest
Warning

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

Go to latest
Published: Jun 30, 2020 License: MPL-2.0 Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	Mutex = &sync.Mutex{}
)

Functions

func GetSubObjectFromCache

func GetSubObjectFromCache(cache *Cache, path string, collect bool, verboseLevel string) interface{}

obj is a cache item path format: a.b.c(name=fr*).value prefix will be used to get the obj, rest will be used as yq path

func GetSubObjectFromFile

func GetSubObjectFromFile(ymlfile string, path string, collect bool, verboseLevel string) interface{}

func GetSubObjectFromYml

func GetSubObjectFromYml(ymlstr string, path string, collect bool, verboseLevel string) interface{}

func GetSubYmlFromCache

func GetSubYmlFromCache(cache *Cache, path string, collect bool, verboseLevel string) string

func GetSubYmlFromFile

func GetSubYmlFromFile(ymlfile string, path string, collect bool, verboseLevel string) string

func GetSubYmlFromYml

func GetSubYmlFromYml(ymlstr string, path string, collect bool, verboseLevel string) string

func LoadObjectFromFile

func LoadObjectFromFile(filepath string) interface{}

func ObjToYaml

func ObjToYaml(obj interface{}) string

func YamlToObj

func YamlToObj(srcyml string) interface{}

Types

type Cache

type Cache map[string]interface{}

func GetCache

func GetCache() *Cache

func NewCache

func NewCache() *Cache

func (*Cache) Delete

func (c *Cache) Delete(key string)

func (*Cache) Get

func (c *Cache) Get(key string) interface{}

func (*Cache) GetPrefixMatched

func (c *Cache) GetPrefixMatched(prefix string) *Cache

func (*Cache) Len

func (c *Cache) Len() int

func (*Cache) List

func (c *Cache) List()

func (*Cache) Obsolete

func (c *Cache) Obsolete(key string)

mark the obj is a obsolete item due to failed get call to get latest value

func (*Cache) Put

func (c *Cache) Put(key string, obj interface{})

func (*Cache) SafeGet

func (c *Cache) SafeGet(key string) (interface{}, bool)

get a cached item, return a bool flag to indicate if it is an latest updated

func (*Cache) Update

func (c *Cache) Update(key string, obj interface{})

Jump to

Keyboard shortcuts

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