cache

package
v0.6.60 Latest Latest
Warning

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

Go to latest
Published: Aug 28, 2026 License: AGPL-3.0, Apache-2.0, MIT Imports: 8 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func InitComponentShaCache

func InitComponentShaCache(expireAfter time.Duration)

func InitComponentShaCacheWithExpiryFunc added in v0.6.58

func InitComponentShaCacheWithExpiryFunc(expiryFn func() time.Duration)

func InitGateCache

func InitGateCache(expireAfter time.Duration, consoleClient client.Client)

Types

type ExportedLine added in v0.6.59

type ExportedLine[T any] struct {
	Resource  T         `json:"resource"`
	ExpiresAt time.Time `json:"expiresAt"`
}

type IdentityLine added in v0.6.59

type IdentityLine struct {
	Value   string
	Created time.Time
}

type SimpleCache

type SimpleCache[T any] struct {
	sync.Mutex
	// contains filtered or unexported fields
}

func ComponentShaCache

func ComponentShaCache() *SimpleCache[string]

func NewSimpleCache

func NewSimpleCache[T any](expiry time.Duration) *SimpleCache[T]

func NewSimpleCacheWithExpiryFunc added in v0.6.58

func NewSimpleCacheWithExpiryFunc[T any](expiryFn func() time.Duration) *SimpleCache[T]

func (*SimpleCache[T]) Add

func (c *SimpleCache[T]) Add(id string, resource T)

func (*SimpleCache[T]) Expire

func (c *SimpleCache[T]) Expire(id string)

func (*SimpleCache[T]) ExpiryWithJitter added in v0.6.54

func (c *SimpleCache[T]) ExpiryWithJitter() time.Duration

func (*SimpleCache[T]) Export added in v0.6.59

func (c *SimpleCache[T]) Export() map[string]ExportedLine[T]

func (*SimpleCache[T]) Get

func (c *SimpleCache[T]) Get(id string) (T, bool)

func (*SimpleCache[T]) Import added in v0.6.59

func (c *SimpleCache[T]) Import(items map[string]ExportedLine[T])

func (*SimpleCache[T]) Wipe

func (c *SimpleCache[T]) Wipe()

type UserGroupCache

type UserGroupCache interface {
	GetGroupID(name string) (string, error)
	GetUserID(email string) (string, error)
	Export() (users, groups map[string]IdentityLine)
	Import(users, groups map[string]IdentityLine)
}

func NewUserGroupCache

func NewUserGroupCache(consoleClient console.Client) UserGroupCache

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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