conditionalrequest

package
v2.9.0-nightly.20231206 Latest Latest
Warning

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

Go to latest
Published: Dec 5, 2023 License: Apache-2.0 Imports: 4 Imported by: 0

Documentation

Overview

Package conditionalrequest handles HTTP conditional requests based on modification time and etags.

Index

Constants

This section is empty.

Variables

View Source
var (
	ErrPreconditionFailed = errors.New("precondition failed")
	ErrNotModified        = errors.New("not modified")
)

Functions

func Evaluate

func Evaluate(req *http.Request, info *ResourceInfo) int

Evaluate evaluates an HTTP conditional request, returning 0 if the request should be handled normally, or a status code if it should be aborted.

Types

type ResourceInfo

type ResourceInfo struct {
	LastModified time.Time
	ETag         string // Includes the quotes.
}

ResourceInfo is information about a resource to be tested with conditionals.

Jump to

Keyboard shortcuts

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