cache

package
v0.9.1 Latest Latest
Warning

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

Go to latest
Published: Mar 8, 2024 License: AGPL-3.0 Imports: 8 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var MissErr = fmt.Errorf("not cached")

Functions

func DefaultDir

func DefaultDir(suffix string) string

Types

type Cache

type Cache struct {
	Dir string
}

func (*Cache) Create

func (c *Cache) Create(digest string) *Writer

func (*Cache) Expire

func (c *Cache) Expire(timeout time.Duration) error

func (*Cache) Open

func (c *Cache) Open(digest string) (io.ReadCloser, error)

func (*Cache) Read

func (c *Cache) Read(digest string) ([]byte, error)

func (*Cache) Write

func (c *Cache) Write(digest string, data []byte) error

type Writer

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

func (*Writer) Close

func (cw *Writer) Close() error

func (*Writer) Digest

func (cw *Writer) Digest() string

func (*Writer) Write

func (cw *Writer) Write(data []byte) (n int, err error)

Jump to

Keyboard shortcuts

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