cache

package
v1.0.0-rc3 Latest Latest
Warning

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

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

Documentation

Index

Constants

View Source
const DefaultTTL = 10 * time.Minute

Variables

This section is empty.

Functions

This section is empty.

Types

type Membership

type Membership interface {
	Get(key string) (bool, bool)
	Set(key string, value bool)
}

type MembershipTTL

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

func NewMembershipTTL

func NewMembershipTTL(ttl time.Duration) *MembershipTTL

func (*MembershipTTL) Get

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

func (*MembershipTTL) Set

func (c *MembershipTTL) Set(key string, value bool)

func (*MembershipTTL) Start

func (c *MembershipTTL) Start(ctx context.Context)

Start starts the cache background cleanup and blocks until context is cancelled

func (*MembershipTTL) Stop

func (c *MembershipTTL) Stop()

type OrganizationCache

type OrganizationCache interface {
	Get(id uuid.UUID) *model.Organization
	Set(id uuid.UUID, org *model.Organization)
}

type OrganizationTTLCache

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

func NewOrganizationTTL

func NewOrganizationTTL(ttl time.Duration) *OrganizationTTLCache

func (*OrganizationTTLCache) Get

func (*OrganizationTTLCache) Set

func (c *OrganizationTTLCache) Set(id uuid.UUID, org *model.Organization)

func (*OrganizationTTLCache) Start

func (c *OrganizationTTLCache) Start(ctx context.Context)

Start starts the cache background cleanup and blocks until context is cancelled

func (*OrganizationTTLCache) Stop

func (c *OrganizationTTLCache) Stop()

Jump to

Keyboard shortcuts

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