negative

package
v2.0.4 Latest Latest
Warning

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

Go to latest
Published: Jul 3, 2026 License: Apache-2.0 Imports: 4 Imported by: 3

Documentation

Overview

Package negative defines the Negative Cache which is a simple lookup map of httpStatus to TTL

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func NewErrInvalidConfig

func NewErrInvalidConfig(negativeCacheName, code string) error

NewErrInvalidConfig returns a new invalid config error

Types

type Config

type Config map[string]time.Duration

Config is a collection of response codes and their TTLs While the status code is numeric, it's deserialized here as a string for maximum compatibility with templating in Helm

func New

func New() Config

New returns an empty Config

func (Config) Clone

func (nc Config) Clone() Config

Clone returns an exact copy of a Config

type ConfigLookup

type ConfigLookup map[string]Config

ConfigLookup defines a Lookup map for a collection of Named Negative Cache Configs

func (ConfigLookup) ValidateAndCompile

func (l ConfigLookup) ValidateAndCompile() (Lookups, error)

Validate verifies the Negative Cache Config

type ErrInvalidConfig

type ErrInvalidConfig struct {
	// contains filtered or unexported fields
}

ErrInvalidConfig is an error type for invalid config

type Lookup

type Lookup map[int]time.Duration

Lookup is a collection of response codes and their TTLs as Durations

type Lookups

type Lookups map[string]Lookup

Lookups is a collection of Lookup maps

func (Lookups) Get

func (l Lookups) Get(name string) Lookup

Get returns the named Lookup from the Lookups collection if it exists

Jump to

Keyboard shortcuts

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