cache

package
v0.21.1 Latest Latest
Warning

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

Go to latest
Published: Jun 4, 2021 License: Apache-2.0 Imports: 3 Imported by: 3

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Cache

type Cache struct {
	sync.Mutex
	// contains filtered or unexported fields
}

Cache is a store for target groups. It provides thread safe updates and a way for obtaining all addresses from the stored target groups.

func New

func New() *Cache

New returns a new empty Cache.

func (*Cache) Addresses

func (c *Cache) Addresses() []string

Addresses returns all the addresses from all target groups present in the Cache.

func (*Cache) Update

func (c *Cache) Update(tgs []*targetgroup.Group)

Update stores the targets for the given groups. Note: targets for a group are replaced entirely on update. If a group with no target is given this is equivalent to deleting all the targets for this group.

Jump to

Keyboard shortcuts

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