index

package
v0.33.6 Latest Latest
Warning

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

Go to latest
Published: Nov 4, 2026 License: Apache-2.0 Imports: 14 Imported by: 1 module, 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

func Register added in v0.29.0

func Register()

Register metrics.

Types

type Index

type Index interface {
	Lookup(path logicalcluster.Path) (Result, bool)
	LookupURL(logicalCluster logicalcluster.Path) (Result, bool)
}

Index implements a mapping from logical cluster to (shard) URL.

type PathRewriter

type PathRewriter func(segments []string) []string

PathRewriter can rewrite a logical cluster path before the actual mapping through the index data.

type Result added in v0.22.0

type Result struct {
	URL   string
	Shard string
	// Cluster canonical path
	Cluster logicalcluster.Name
	// Type is not set for mounted workspaces. For all others this value is the
	// fully-qualified name of the type, e.g. "root:universal".
	Type logicalcluster.Path

	// ErrorCode is the HTTP error code to return for the request.
	// If this is set, the URL and Shard fields are ignored.
	ErrorCode int
}

Result is the result of a lookup.

type State

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

State is a runtime graph of shards, workspaces, logicalclusters and mounts. It usually gets fed by a controller that watches these resources on each shard. The state then organizes the graph and offers a workspace path lookup that resolves a workspace path to its physical location on a shard and logical cluster.

func New

func New(rewriters []PathRewriter) *State

func (*State) ClusterContext added in v0.33.0

func (c *State) ClusterContext(parent context.Context, cluster logicalcluster.Name) (context.Context, context.CancelFunc)

ClusterContext returns a context derived from the parent that will be cancelled when the cluster is deleted or migrated.

func (*State) DeleteLogicalCluster

func (c *State) DeleteLogicalCluster(shard string, logicalCluster *corev1alpha1.LogicalCluster)

func (*State) DeleteShard

func (c *State) DeleteShard(shardName string)

func (*State) DeleteWorkspace

func (c *State) DeleteWorkspace(shard string, ws *tenancyv1alpha1.Workspace)

func (*State) Lookup

func (c *State) Lookup(path logicalcluster.Path) (Result, bool)

func (*State) LookupURL

func (c *State) LookupURL(path logicalcluster.Path) (Result, bool)

func (*State) RecentlyMigrated added in v0.33.0

func (c *State) RecentlyMigrated(cluster logicalcluster.Name) bool

RecentlyMigrated returns true if the given cluster was recently migrated.

func (*State) UpsertLogicalCluster

func (c *State) UpsertLogicalCluster(shard string, logicalCluster *corev1alpha1.LogicalCluster)

func (*State) UpsertShard

func (c *State) UpsertShard(shardName, baseURL string)

func (*State) UpsertWorkspace

func (c *State) UpsertWorkspace(shard string, ws *tenancyv1alpha1.Workspace)

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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