mem_cache

package
v1.8.7 Latest Latest
Warning

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

Go to latest
Published: Sep 18, 2021 License: GPL-3.0 Imports: 7 Imported by: 1

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type MemCache

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

MemCache is a simple cache that stores msgs in memory.

func NewMemCache

func NewMemCache(shardNum, maxSizePerShard int, cleanerInterval time.Duration) *MemCache

NewMemCache returns a MemCache. If cleanerInterval <= 0, MemCache cleaner is disabled.

func (*MemCache) Close

func (c *MemCache) Close() error

Close closes the cleaner

func (*MemCache) Get

func (c *MemCache) Get(_ context.Context, key string) (*dns.Msg, error)

func (*MemCache) Store

func (c *MemCache) Store(_ context.Context, key string, v *dns.Msg, ttl time.Duration) (err error)

Jump to

Keyboard shortcuts

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