File: httprc.go

package info (click to toggle)
golang-github-lestrrat-go-httprc 1.0.6-2
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid, trixie
  • size: 168 kB
  • sloc: perl: 56; sh: 6; makefile: 2
file content (22 lines) | stat: -rw-r--r-- 706 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
//go:generate tools/genoptions.sh

// Package httprc implements a cache for resources available
// over http(s). Its aim is not only to cache these resources so
// that it saves on HTTP roundtrips, but it also periodically
// attempts to auto-refresh these resources once they are cached
// based on the user-specified intervals and HTTP `Expires` and
// `Cache-Control` headers, thus keeping the entries _relatively_ fresh.
package httprc

import "fmt"

// RefreshError is the underlying error type that is sent to
// the `httprc.ErrSink` objects
type RefreshError struct {
	URL string
	Err error
}

func (re *RefreshError) Error() string {
	return fmt.Sprintf(`refresh error (%q): %s`, re.URL, re.Err)
}