cachecontrol

package
v1.26.7 Latest Latest
Warning

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

Go to latest
Published: Apr 20, 2026 License: MPL-2.0 Imports: 2 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type ETag

type ETag struct {
	Value string
	Time  time.Time
}

func NewETag

func NewETag(t time.Time) *ETag

func ParseETag

func ParseETag(t string) ETag

func (ETag) String

func (t ETag) String() string

type Query

type Query struct {
	ETag          opt.Optional[ETag]
	ModifiedSince opt.Optional[time.Time]
}

Query represents a HTTP conditional request query.

func NewQuery

func NewQuery(ifNoneMatch opt.Optional[string], ifModifiedSince opt.Optional[time.Time]) Query

NewQuery must be constructed from a HTTP request's conditional headers.

func (Query) Check

func (q Query) Check(fn func() *time.Time) (*ETag, bool)

NotModified takes the current updated date of a resource and returns true if the cache control query includes a Is-Modified-Since header and the resource updated date is not after the header value. True means a 304 response header.

Jump to

Keyboard shortcuts

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