cacheconfig

package
v1.1.0 Latest Latest
Warning

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

Go to latest
Published: Sep 28, 2026 License: Apache-2.0 Imports: 10 Imported by: 0

Documentation

Overview

Package cacheconfig creates native SQLX cache services from authored settings.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ExpandLocation added in v1.1.0

func ExpandLocation(location string, view *spec.View) string

ExpandLocation expands view metadata before application constants are resolved. Alias is the canonical SQL namespace; Table comes from the view source.

func Validate

func Validate(settings *spec.CacheSettings) error

Validate checks settings without constructing a service or opening a connection.

Types

type Case

type Case struct {
	Values     map[string]any
	FieldNames []string
}

type Cases

type Cases struct {
	Settings  *spec.CacheWarmupSettings
	Required  map[string]bool
	EntryCost int
}

Cases expands authored parameter alternatives without binding or converting values. Canonical Bindly source providers retain those responsibilities.

func (Cases) ForEach

func (c Cases) ForEach(visit func(Case) error) error

type Config

type Config struct {
	Settings *spec.CacheSettings
	Identity string
	// Aerospike is owned by the caller and closed after all readers and warmups drain.
	Aerospike *aerospike.Pool
}

Config identifies one prepared view's native cache namespace. Identity must include the component and the view path, so unrelated connectors and views cannot share entries solely because their SQL text happens to match.

func (Config) New

func (c Config) New() (cache.Cache, error)

func (Config) Validate

func (c Config) Validate() (*Validation, error)

Validate checks cache configuration without creating a provider, opening a pool, touching storage or performing network I/O.

type Validation

type Validation struct {
	Location string
	Provider string
	TTL      time.Duration
}

Jump to

Keyboard shortcuts

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