managed

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: 13 Imported by: 0 modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Overview

Package managed adds owner-scoped invalidation to native SQLX caches.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type AerospikeStore

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

func NewAerospikeStore

func NewAerospikeStore(client *as.Client, namespace, set, owner string) (*AerospikeStore, error)

func (*AerospikeStore) Read

func (s *AerospikeStore) Read(ctx context.Context) (Generation, error)

func (*AerospikeStore) Rotate

func (s *AerospikeStore) Rotate(ctx context.Context, scope Scope) (string, error)

type Cache

type Cache struct {
	cache.Cache
	// contains filtered or unexported fields
}

func New

func New(native cache.Cache, store Store, owner string, observers ...func(string, int)) *Cache

New optionally observes successful lazy entry publication (not cache misses).

func (*Cache) Close

func (c *Cache) Close(ctx context.Context, entry *cache.Entry) error

Close reports an entry only after its native publication succeeds.

func (*Cache) Delete

func (c *Cache) Delete(ctx context.Context, entry *cache.Entry) error

func (*Cache) Get

func (c *Cache) Get(ctx context.Context, sql string, args []interface{}, options ...interface{}) (*cache.Entry, error)

func (*Cache) IndexBy

func (c *Cache) IndexBy(ctx context.Context, db *sql.DB, column, sql string, args []interface{}, options ...interface{}) (int, error)

func (*Cache) IndexByWithResult

func (c *Cache) IndexByWithResult(ctx context.Context, db *sql.DB, column, sql string, args []interface{}, options ...interface{}) (*cache.IndexByResult, error)

func (*Cache) Invalidate

func (c *Cache) Invalidate(ctx context.Context, scope Scope) (string, error)

func (*Cache) InvalidateCache added in v1.1.0

func (c *Cache) InvalidateCache(ctx context.Context, scope string) (string, error)

InvalidateCache is the string-based capability exposed to host applications.

func (*Cache) Lookup

func (c *Cache) Lookup(ctx context.Context, sql string, args []interface{}, options ...interface{}) (*cache.Entry, error)

func (*Cache) Rollback

func (c *Cache) Rollback(ctx context.Context, entry *cache.Entry) error

func (*Cache) UpdateType

func (c *Cache) UpdateType(ctx context.Context, entry *cache.Entry, values []interface{}) (bool, error)

type FileStore

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

func NewFileStore

func NewFileStore(location string) *FileStore

func (*FileStore) Read

func (s *FileStore) Read(ctx context.Context) (Generation, error)

func (*FileStore) Rotate

func (s *FileStore) Rotate(ctx context.Context, scope Scope) (string, error)

type Generation

type Generation struct{ All, Lazy, Warmup string }

type Scope

type Scope string
const (
	All    Scope = "all"
	Lazy   Scope = "lazy"
	Warmup Scope = "warmup"
)

func (Scope) Validate

func (s Scope) Validate() error

type Store

type Store interface {
	Read(context.Context) (Generation, error)
	Rotate(context.Context, Scope) (string, error)
}

Jump to

Keyboard shortcuts

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