project

package
v1.2.0 Latest Latest
Warning

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

Go to latest
Published: Sep 17, 2026 License: Apache-2.0 Imports: 5 Imported by: 0 modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Info

type Info struct {
	Name     string
	DomainID string
}

Info holds resolved project name and domain ID.

type Resolver

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

Resolver resolves project IDs to names and domain IDs via keystone DB. It caches the mapping and refreshes it periodically based on a TTL.

func NewResolver

func NewResolver(logger *slog.Logger, keystoneDB *keystonedb.Queries, ttl time.Duration) *Resolver

NewResolver creates a resolver that fetches projects from keystone and caches them for the given TTL. If keystoneDB is nil, the resolver returns project IDs as-is. A zero TTL uses the default (5 minutes).

func (*Resolver) AllProjects

func (r *Resolver) AllProjects() map[string]Info

AllProjects returns a snapshot of all cached project IDs and their info.

func (*Resolver) Resolve

func (r *Resolver) Resolve(projectID string) (name, domainID string)

Resolve returns the project name and domain_id for a given project ID. Falls back to the project ID itself if not found.

Jump to

Keyboard shortcuts

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