index

package
v0.26.1 Latest Latest
Warning

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

Go to latest
Published: Dec 11, 2024 License: Apache-2.0 Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

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
}

Result is the result of a lookup.

type State

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

State watches Shards on the root shard, and then starts informers for every Shard, watching the Workspaces on them. It then updates the workspace index, which maps logical clusters to shard URLs.

func New

func New(rewriters []PathRewriter) *State

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) 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