cache

package
v0.6.1 Latest Latest
Warning

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

Go to latest
Published: Nov 11, 2022 License: MIT Imports: 4 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Get

func Get(t Type, key string) (interface{}, bool)

Get returns the cached value for a given key

func GetIPParseResult

func GetIPParseResult(ipStr string) (net.IP, *net.IPNet, bool)

GetIPParseResult returns the caches result of an ip parsing

func Set

func Set(t Type, key string, value interface{}, expiration ...time.Duration)

Set sets a value in a cache

func SetIPParseResult

func SetIPParseResult(ipStr string, ip net.IP, ipNet *net.IPNet)

SetIPParseResult caches the result of an ip parsing

Types

type Type

type Type int

Type defines the type of cache

const (
	IPHostCache Type = iota
	IPAddrCache
	IPNetCache
)

Different cache types

Jump to

Keyboard shortcuts

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