nextcache

package
v8.0.1 Latest Latest
Warning

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

Go to latest
Published: Mar 21, 2024 License: Apache-2.0, BSD-2-Clause, BSD-3-Clause, + 1 more Imports: 3 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type NextCacher

type NextCacher interface {
	NextCache(tc.DeliveryServiceName) (uint64, bool)
}

NextCacher is the interface that wraps the NextCache method.

NextCache returns the next cache to use for the given delivery service. This is neither pure nor idempotent, and successive calls will return different numbers. The underlying mechanism may not be aware of the number of caches, and the returned number MAY exceed the number of caches. Typically, callers should mod the returned number by the size of their cache list, to determine the cache to use. Returns false if the given delivery service is not found.

func New

func New(dses []tc.DeliveryServiceName) NextCacher

New creates and returns a new NextCacher. The returned NextCacher is safe for use by multiple goroutines.

type Ths

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

Ths provides threadsafe access to a ThsT pointer. Note the object itself is not safe for multiple access, and must not be mutated, either by the original owner after calling Set, or by future users who call Get. If you need to mutate, perform a deep copy.

func NewThs

func NewThs() Ths

func (Ths) Get

func (t Ths) Get() ThsT

func (Ths) Set

func (t Ths) Set(v ThsT)

type ThsT

type ThsT NextCacher

Jump to

Keyboard shortcuts

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