cache

package
v1.0.0 Latest Latest
Warning

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

Go to latest
Published: Nov 18, 2025 License: GPL-3.0 Imports: 1 Imported by: 0

Documentation

Overview

Package cache is used for completion to not overflow the gateway with redundant search requests.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Cache

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

func NewCache

func NewCache() *Cache

func (*Cache) Create

func (c *Cache) Create(query string, value uint)

func (*Cache) Exists

func (c *Cache) Exists(query string) (ok bool)

func (*Cache) Get

func (c *Cache) Get(query string) uint

func (*Cache) Invalidate

func (c *Cache) Invalidate(name string, limit uint)

Invalidate is only needed when a member leaves and the search query reaches the search limit. "aa", "ab", "ac", ..., "ay" // where length is longer than the limit if "ay" leaves, then "az" would not be loaded becaue it would not be returned by the search results because of the search limit

Jump to

Keyboard shortcuts

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