cache

package
v0.8.2 Latest Latest
Warning

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

Go to latest
Published: May 27, 2025 License: Apache-2.0 Imports: 8 Imported by: 0

Documentation

Index

Constants

View Source
const (
	DefaultTTL = time.Second * 30
)

Variables

This section is empty.

Functions

This section is empty.

Types

type Cache added in v0.8.0

type Cache interface {
	Get(key string) (string, bool)
}

type EndpointCache

type EndpointCache struct {
	sync.RWMutex
	// contains filtered or unexported fields
}

func New

func New(logger *slog.Logger, client linodeclient.Client, cacheTTL time.Duration) *EndpointCache

func (*EndpointCache) Get

func (c *EndpointCache) Get(key string) (string, bool)

func (*EndpointCache) Insert

func (c *EndpointCache) Insert(iter iter.Seq2[string, string])

func (*EndpointCache) Refresh

func (c *EndpointCache) Refresh(ctx context.Context) error

func (*EndpointCache) Set

func (c *EndpointCache) Set(key, val string)

func (*EndpointCache) Start

func (c *EndpointCache) Start(ctx context.Context) error

Jump to

Keyboard shortcuts

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