cache

package
v1.17.0 Latest Latest
Warning

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

Go to latest
Published: Mar 10, 2023 License: Apache-2.0 Imports: 20 Imported by: 3

Documentation

Overview

Package cache define cache afs.Service to cache read operation for specified URL

Index

Constants

View Source
const CacheFile = "_.cache"

CacheFile cache file

Variables

This section is empty.

Functions

func New

func New(baseURL string, fs afs.Service) afs.Service

New create a cache service for supplied base URL

func NewNamedCache added in v1.17.0

func NewNamedCache(baseURL string, fs afs.Service, name string) afs.Service

func Singleton

func Singleton(URL string) afs.Service

Singleton returns caching Service for specified URL

Types

type Cache

type Cache struct {
	Items []*Entry
}

Cache represent a cache

type Entry

type Entry struct {
	URL     string
	ModTime time.Time
	Size    int64
	Data    []byte
}

Entry represents cache entry

Jump to

Keyboard shortcuts

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