dbcache

package
v0.0.0-...-9bbdfad Latest Latest
Warning

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

Go to latest
Published: Jan 16, 2020 License: Apache-2.0 Imports: 5 Imported by: 6

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Cache

type Cache struct {
	ID string
	sync.RWMutex
	OVSDB   iOVSDB
	Schema  string
	Indexes map[string][]string
	Data    map[string]interface{} // Data[table][index_type][index_val][column]
}

func (*Cache) GetKeys

func (cache *Cache) GetKeys(args ...string) []string

func (*Cache) GetList

func (cache *Cache) GetList(args ...string) []interface{}

GetList is used to retrieve data from cache data structure and deep copy it. Cache structure: Data[table][index_type][index_val][column]

Arguments is used as keys in order as in structure: first - table name of interest second - index type of interest, for example "uuid", "name", ... third - index value, for example particular item name fourth - column name, for example "external_ids"

Any amount of arguments can be provided

func (*Cache) GetMap

func (cache *Cache) GetMap(args ...string) map[string]interface{}

GetMap is used to retrieve data from cache data structure and deep copy it. Cache structure: Data[table][index_type][index_val][column]

Arguments is used as keys in order as in structure: first - table name of interest second - index type of interest, for example "uuid", "name", ... third - index value, for example particular item name fourth - column name, for example "external_ids"

Any amount of arguments can be provided

func (*Cache) StartMonitor

func (cache *Cache) StartMonitor(schema string, tables map[string][]string) error

Jump to

Keyboard shortcuts

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