cache

package
v0.1.31 Latest Latest
Warning

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

Go to latest
Published: Mar 4, 2026 License: MIT Imports: 8 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 struct {
	// contains filtered or unexported fields
}

func New

func New(opts ...Option) (*Cache, error)

func (*Cache) FetchWithCache

func (c *Cache) FetchWithCache(url string) ([]byte, error)

func (*Cache) GetAPI

func (c *Cache) GetAPI(url string) ([]byte, error)

func (*Cache) GetFile

func (c *Cache) GetFile(url string) (string, error)

func (*Cache) SetAPI

func (c *Cache) SetAPI(url string, data []byte) error

func (*Cache) SetFile

func (c *Cache) SetFile(url string, data []byte) (string, error)

type Option

type Option func(*Cache)

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