cache

package
v0.48.0 Latest Latest
Warning

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

Go to latest
Published: Jan 9, 2023 License: Apache-2.0 Imports: 4 Imported by: 14

Documentation

Overview

Package cache defines the inter-query cache interface that can cache data across queries

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Config

type Config struct {
	InterQueryBuiltinCache InterQueryBuiltinCacheConfig `json:"inter_query_builtin_cache"`
}

Config represents the configuration of the inter-query cache.

func ParseCachingConfig

func ParseCachingConfig(raw []byte) (*Config, error)

ParseCachingConfig returns the config for the inter-query cache.

type InterQueryBuiltinCacheConfig

type InterQueryBuiltinCacheConfig struct {
	MaxSizeBytes *int64 `json:"max_size_bytes,omitempty"`
}

InterQueryBuiltinCacheConfig represents the configuration of the inter-query cache that built-in functions can utilize.

type InterQueryCache

type InterQueryCache interface {
	Get(key ast.Value) (value InterQueryCacheValue, found bool)
	Insert(key ast.Value, value InterQueryCacheValue) int
	Delete(key ast.Value)
	UpdateConfig(config *Config)
}

InterQueryCache defines the interface for the inter-query cache.

func NewInterQueryCache

func NewInterQueryCache(config *Config) InterQueryCache

NewInterQueryCache returns a new inter-query cache.

type InterQueryCacheValue

type InterQueryCacheValue interface {
	SizeInBytes() int64
}

InterQueryCacheValue defines the interface for the data that the inter-query cache holds.

Jump to

Keyboard shortcuts

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