cache

package
v0.0.32 Latest Latest
Warning

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

Go to latest
Published: May 6, 2021 License: PostgreSQL Imports: 8 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type IndexBucket

type IndexBucket struct {
	Items []*IndexItem
}

each index bucket contains index items for all cache results for a given table and qual set

func (*IndexBucket) Append

func (b *IndexBucket) Append(item *IndexItem)

func (*IndexBucket) Get

func (b *IndexBucket) Get(columns []string) *IndexItem

find an index item which satisfies all columns

type IndexItem

type IndexItem struct {
	Columns []string
	Key     string
}

each index item has the columns and cached index for a single cached query result note - this index item it tied to a specific table and set of quals

func (IndexItem) SatisfiesColumns

func (i IndexItem) SatisfiesColumns(columns []string) bool

type QueryCache

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

func NewQueryCache

func NewQueryCache() (*QueryCache, error)

func (QueryCache) BuildIndexKey

func (c QueryCache) BuildIndexKey(connectionName, table string, qualMap map[string]*proto.Quals) string

func (QueryCache) BuildResultKey

func (c QueryCache) BuildResultKey(connectionName, table string, qualMap map[string]*proto.Quals, columns []string) string

func (QueryCache) Get

func (c QueryCache) Get(connectionName, table string, qualMap map[string]*proto.Quals, columns []string) *QueryResult

func (QueryCache) Set

func (c QueryCache) Set(connectionName, table string, qualMap map[string]*proto.Quals, columns []string, result *QueryResult, ttl time.Duration)

type QueryResult

type QueryResult struct {
	Rows []map[string]interface{}
}

func (*QueryResult) Append

func (q *QueryResult) Append(row map[string]interface{})

Jump to

Keyboard shortcuts

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