recache

package
v0.0.0-...-fb49ba0 Latest Latest
Warning

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

Go to latest
Published: Apr 7, 2024 License: MIT Imports: 3 Imported by: 0

Documentation

Overview

Package recache provides a regex compilation cache.

Index

Constants

View Source
const (
	DefaultExpiration      = 5 * time.Minute
	DefaultCleanupInterval = 10 * time.Minute
)

Expiration intervals.

Variables

This section is empty.

Functions

This section is empty.

Types

type RegexpCache

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

RegexpCache caches compiled regular expressions.

func New

func New() *RegexpCache

New creates a new RegexpCache.

func (*RegexpCache) Compile

func (r *RegexpCache) Compile(pattern string) (*regexp.Regexp, error)

Compile compiles a pattern, forcing case-insensitive matching. If this pattern is cached, the existing Regexp/error will be returned.

Jump to

Keyboard shortcuts

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