Help us shape the future of Go! Take the 2026 Go Developer Survey

cache

package
v1.1.0 Latest Latest
Warning

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

Go to latest
Published: Apr 17, 2026 License: Apache-2.0 Imports: 4 Imported by: 0

Documentation

Overview

Package cache provides cross-instance cache invalidation via Redis pub/sub.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Invalidator

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

Invalidator subscribes to Redis pub/sub and invalidates local caches.

func NewInvalidator

func NewInvalidator(
	redisClient *redis.Client,
	scip SCIPEvictor,
	symbols SymbolsInvalidator,
	logger *zap.Logger,
) *Invalidator

NewInvalidator creates a new cache invalidator.

func (*Invalidator) Start

func (inv *Invalidator) Start(ctx context.Context)

Start begins listening for reindex events and invalidating caches. Runs until ctx is canceled. Should be called in a goroutine.

type SCIPEvictor

type SCIPEvictor interface {
	EvictCache(repoID int64)
}

SCIPEvictor evicts cached SCIP data for a repo.

type SymbolsInvalidator

type SymbolsInvalidator interface {
	InvalidateRepo(ctx context.Context, repoID int64) error
}

SymbolsInvalidator invalidates cached symbols for a repo.

Jump to

Keyboard shortcuts

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