ruleset

package
v0.0.2 Latest Latest
Warning

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

Go to latest
Published: Sep 3, 2020 License: BSD-3-Clause Imports: 0 Imported by: 128

Documentation

Overview

Package ruleset provides the basics rules which are being extended by rules.

Index

Constants

This section is empty.

Variables

View Source
var (
	AuthorizationRule = func(header GetHeader) bool {
		return header("Authorization") == "" &&
			header("Proxy-Authenticate") == ""
	}

	MustRevalidateRule = func(header GetHeader) bool {
		return header("Must-Revalidate") == ""
	}

	ZeroMaxAgeRule = func(header GetHeader) bool {
		return header("S-Maxage") != "0" &&
			header("Max-Age") != "0"
	}

	NoCacheRule = func(header GetHeader) bool {
		return header("No-Cache") != "true"
	}
)

The shared header-mostly rules for both nethttp and fasthttp

View Source
var EmptyHeaderPredicate = func(GetHeader) bool {
	return true
}

EmptyHeaderPredicate returns always true

Functions

This section is empty.

Types

type GetHeader

type GetHeader func(string) string

GetHeader is a type of func which receives a func of string which returns a string used to get headers values, both request's and response's.

type HeaderPredicate

type HeaderPredicate func(GetHeader) bool

HeaderPredicate is a type of func which receives a func of string which returns a string and a boolean, used to get headers values, both request's and response's.

Jump to

Keyboard shortcuts

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