disk

package
v0.0.0-...-7b5afef Latest Latest
Warning

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

Go to latest
Published: Mar 28, 2019 License: MIT Imports: 3 Imported by: 0

Documentation

Overview

Package disk provides an implementation of httpcache.Cache that uses the filesystem to store http responses.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Cache

type Cache struct {
	Dir      string
	PathPerm os.FileMode
	FilePerm os.FileMode
}

Cache is an implementation of httpcache.Cache.

func (Cache) Get

func (c Cache) Get(key string) ([]byte, bool)

Get returns a dumped response if the file corresponding to key exists.

func (Cache) Set

func (c Cache) Set(key string, response []byte)

Set stores a dumped response to disk with filename key.

Jump to

Keyboard shortcuts

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