cache

package
v0.4.0 Latest Latest
Warning

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

Go to latest
Published: May 18, 2026 License: MIT Imports: 11 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Cache

type Cache interface {
	Get(key string) ([]byte, error)
	Set(key string, entry []byte) error
	Delete(key string) error
}

func NewCache

func NewCache(ttl time.Duration) (Cache, error)

type ManifestCache added in v0.4.0

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

ManifestCache is an in-memory OID presence set backed by an S3 manifest object. OIDs in S3 are permanent so entries never expire.

func NewManifestCache added in v0.4.0

func NewManifestCache(ctx context.Context, store ManifestStore, saveInterval time.Duration) (*ManifestCache, error)

func (*ManifestCache) Add added in v0.4.0

func (m *ManifestCache) Add(oid string)

func (*ManifestCache) Contains added in v0.4.0

func (m *ManifestCache) Contains(oid string) bool

func (*ManifestCache) Flush added in v0.4.0

func (m *ManifestCache) Flush(ctx context.Context)

func (*ManifestCache) SnapshotBytes added in v0.4.0

func (m *ManifestCache) SnapshotBytes() ([]byte, string, error)

type ManifestStore added in v0.4.0

type ManifestStore interface {
	LoadManifest(ctx context.Context) (oids []string, bootstrapped bool, err error)
	SaveManifest(ctx context.Context, oids []string) error
}

ManifestStore is implemented by AWSService — avoids import cycle.

type PresignCache added in v0.4.0

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

func NewPresignCache added in v0.4.0

func NewPresignCache() (*PresignCache, error)

func (*PresignCache) Get added in v0.4.0

func (p *PresignCache) Get(oid string) (string, bool)

func (*PresignCache) Set added in v0.4.0

func (p *PresignCache) Set(oid, url string, expiresAt time.Time)

Jump to

Keyboard shortcuts

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