cache

package
v0.0.3 Latest Latest
Warning

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

Go to latest
Published: Jun 16, 2026 License: MIT Imports: 3 Imported by: 0

Documentation

Overview

Package cache provides a simple in-memory TTL cache for transcript segments.

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
}

Cache stores transcript segments keyed by video_id:lang with a TTL.

func New

func New(ttl time.Duration) *Cache

New returns a Cache with the given TTL.

func (*Cache) Get

func (c *Cache) Get(key string) ([]yt.Segment, bool)

Get returns the cached segments and true, or nil,false if missing or expired.

func (*Cache) Set

func (c *Cache) Set(key string, segs []yt.Segment)

Set stores segments under key with the cache's TTL.

Jump to

Keyboard shortcuts

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