negative

package
v1.1.0-beta7.0...-3ae970a Latest Latest
Warning

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

Go to latest
Published: Apr 22, 2021 License: Apache-2.0 Imports: 3 Imported by: 0

Documentation

Overview

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

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Config

type Config map[string]int

Config is a collection of response codes and their TTLs in milliseconds

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) Validate

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

Validate verifies the Negative Cache 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