cache

package
v1.8.0 Latest Latest
Warning

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

Go to latest
Published: Mar 12, 2021 License: Apache-2.0 Imports: 19 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 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