Help us shape the future of Go! Take the 2026 Go Developer Survey

ratecache

package
v0.0.81 Latest Latest
Warning

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

Go to latest
Published: Jan 7, 2025 License: Apache-2.0 Imports: 5 Imported by: 0

Documentation

Overview

Package ratecache provides a cache for the REST clients

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type NoopRestClientCache

type NoopRestClientCache struct{}

NoopRestClientCache is a no-op implementation of the interface used for testing

func (*NoopRestClientCache) Close

func (_ *NoopRestClientCache) Close()

Close does nothing

func (*NoopRestClientCache) Get

Get always returns nil, false

func (*NoopRestClientCache) Set

Set does nothing

type RestClientCache

type RestClientCache interface {
	Get(owner, token string, provider db.ProviderType) (provinfv1.REST, bool)
	Set(owner, token string, provider db.ProviderType, rest provinfv1.REST)

	// Close stops the eviction routine and disallows setting new entries
	// cache is not cleared, getting existing entries is still allowed
	Close()
}

RestClientCache is the interface for the REST client cache

func NewRestClientCache

func NewRestClientCache(ctx context.Context) RestClientCache

NewRestClientCache creates a new REST client cache

Directories

Path Synopsis
Package mock_ratecache is a generated GoMock package.
Package mock_ratecache is a generated GoMock package.

Jump to

Keyboard shortcuts

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