cache

package
v0.1.4 Latest Latest
Warning

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

Go to latest
Published: Jul 23, 2026 License: MIT Imports: 9 Imported by: 0

Documentation

Overview

Package cache provides a file-based JSON cache with TTL for Jira issues and Confluence page lookups.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Cache

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

func New

func New(root string, opts ...Option) *Cache

func (*Cache) Clear

func (c *Cache) Clear() error

func (*Cache) Enabled

func (c *Cache) Enabled() bool

func (*Cache) Flush

func (c *Cache) Flush() error

Flush persists deferred entries. It is the explicit cache mutation boundary.

func (*Cache) Get

func (c *Cache) Get(namespace, key string, dest any) (bool, error)

func (*Cache) Invalidate

func (c *Cache) Invalidate(namespace, key string) error

func (*Cache) InvalidateNamespace

func (c *Cache) InvalidateNamespace(namespace string) error

func (*Cache) Path

func (c *Cache) Path() string

func (*Cache) Set

func (c *Cache) Set(namespace, key string, value any) error

type Option

type Option func(*Cache)

func WithDeferredWrites

func WithDeferredWrites(deferWrites bool) Option

WithDeferredWrites keeps new entries in memory until Flush. Reads can see pending entries, allowing planning to remain filesystem-side-effect-free.

func WithEnabled

func WithEnabled(enabled bool) Option

func WithTTL

func WithTTL(ttl time.Duration) Option

Jump to

Keyboard shortcuts

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