cache

package
v0.48.0 Latest Latest
Warning

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

Go to latest
Published: May 22, 2024 License: Apache-2.0 Imports: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type K

type K struct {
	Role           string
	UserID         string
	OrganizationID string
	ProjectID      string
}

K represents a role associated with an API key.

type O

type O struct {
	ID string
}

O represents an organization.

type OU added in v0.40.0

type OU struct {
	Role           uv1.OrganizationRole
	OrganizationID string
}

OU represents a role associated with a organization user.

type P added in v0.40.0

type P struct {
	ID                  string
	OrganizationID      string
	KubernetesNamespace string
}

P represents a project.

type PU added in v0.40.0

type PU struct {
	Role           uv1.ProjectRole
	ProjectID      string
	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,
	debug *config.DebugConfig,
) *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) GetOrganizationByID added in v0.40.0

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 added in v0.40.0

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

GetProjectByID returns a project by its ID.

func (*Store) GetProjectsByOrganizationID added in v0.40.0

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

GetProjectsByOrganizationID returns projects by its organization ID.

func (*Store) GetProjectsByUserID added in v0.40.0

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

GetProjectsByUserID returns project users by its user ID.

func (*Store) Sync

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

Sync synchronizes the cache.

Jump to

Keyboard shortcuts

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