cache

package
v1.19.1 Latest Latest
Warning

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

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

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type C

type C struct {
	ID       string
	Name     string
	TenantID string
}

C represents a cluster.

type K

type K struct {
	KeyID string

	UserID         string
	InternalUserID string
	OrganizationID string
	ProjectID      string
	TenantID       string

	OrganizationRole uv1.OrganizationRole
	ProjectRole      uv1.ProjectRole

	// ExcludedFromRateLimiting indicates whether this API key is excluded from rate limiting
	ExcludedFromRateLimiting bool
}

K represents an API key.

type O

type O struct {
	ID        string
	Title     string
	TenantID  string
	IsDefault bool
}

O represents an organization.

type OU

type OU struct {
	Role           uv1.OrganizationRole
	OrganizationID string
}

OU represents a role associated with a organization user.

type P

type P struct {
	ID                  string
	Title               string
	OrganizationID      string
	KubernetesNamespace string
	Assignments         []*uv1.ProjectAssignment
	IsDefault           bool
}

P represents a project.

type PU

type PU struct {
	Role           uv1.ProjectRole
	Project        *P
	OrganizationID string
}

PU represents a role associated with a project user.

type Store

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

Store is a cache for API keys and organization users.

func NewStore

func NewStore(
	userInfoLister userInfoLister,
	clusterInfoLister clusterInfoLister,
) *Store

NewStore creates a new cache store.

func (*Store) GetAPIKeyBySecret

func (c *Store) GetAPIKeyBySecret(secret string) (*K, bool)

GetAPIKeyBySecret returns an API key by its secret.

func (*Store) GetClusterByRegistrationKey

func (c *Store) GetClusterByRegistrationKey(key string) (*C, bool)

GetClusterByRegistrationKey returns a cluster by its registration key.

func (*Store) GetClustersByTenantID

func (c *Store) GetClustersByTenantID(tenantID string) []C

GetClustersByTenantID returns clusters by its tenant ID.

func (*Store) GetLastSuccessfulSyncTime added in v1.10.0

func (c *Store) GetLastSuccessfulSyncTime() time.Time

GetLastSuccessfulSyncTime returns the last successful sync time.

func (*Store) GetOrganizationByID

func (c *Store) GetOrganizationByID(organizationID string) (*O, bool)

GetOrganizationByID returns an organization by its ID.

func (*Store) GetOrganizationsByUserID

func (c *Store) GetOrganizationsByUserID(userID string) []OU

GetOrganizationsByUserID returns organization users by its user ID.

func (*Store) GetProjectByID

func (c *Store) GetProjectByID(projectID string) (*P, bool)

GetProjectByID returns a project by its ID.

func (*Store) GetProjectsByOrganizationID

func (c *Store) GetProjectsByOrganizationID(organizationID string) []P

GetProjectsByOrganizationID returns projects by its organization ID.

func (*Store) GetProjectsByUserID

func (c *Store) GetProjectsByUserID(userID string) []PU

GetProjectsByUserID returns project users by its user ID.

func (*Store) GetUserByID

func (c *Store) GetUserByID(userID string) (*U, bool)

GetUserByID returns a user by its ID.

func (*Store) Sync

func (c *Store) Sync(ctx context.Context, interval time.Duration) error

Sync synchronizes the cache.

func (*Store) WaitForSync added in v1.15.1

func (c *Store) WaitForSync(ctx context.Context) error

WaitForSync waits for the cache to be synchronized.

type U

type U struct {
	ID         string
	InternalID string
	TenantID   string
}

U represents a user.

Jump to

Keyboard shortcuts

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