snapshotcache

package
v0.0.0-...-56ac610 Latest Latest
Warning

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

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

Documentation

Index

Constants

This section is empty.

Variables

View Source
var ErrSnapshotNotFound = errors.New("snapshot not found")

Functions

This section is empty.

Types

type SnapshotCache

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

func NewSnapshotCache

func NewSnapshotCache(db *sqlcdb.Client, redisClient redis.UniversalClient) *SnapshotCache

func (*SnapshotCache) Close

func (c *SnapshotCache) Close(ctx context.Context) error

func (*SnapshotCache) Get

func (c *SnapshotCache) Get(ctx context.Context, sandboxID string) (*SnapshotInfo, error)

Get returns the last snapshot for a sandbox, using cache with DB fallback.

func (*SnapshotCache) Invalidate

func (c *SnapshotCache) Invalidate(ctx context.Context, sandboxID string)

Invalidate removes the cached snapshot for a sandbox.

type SnapshotInfo

type SnapshotInfo struct {
	Aliases  []string         `json:"aliases"`
	Names    []string         `json:"names"`
	Snapshot queries.Snapshot `json:"snapshot"`
	EnvBuild queries.EnvBuild `json:"env_build"`
	NotFound bool             `json:"not_found,omitempty"`
}

SnapshotInfo holds cached snapshot with build and alias information.

Jump to

Keyboard shortcuts

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