multitenant

package
v1.6.0-rc.5 Latest Latest
Warning

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

Go to latest
Published: Feb 22, 2023 License: AGPL-3.0 Imports: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Manager

type Manager struct {
	BackendConfig        backendconfig.BackendConfig
	DegradedWorkspaceIDs []string
	// contains filtered or unexported fields
}

func (*Manager) DegradedWorkspace

func (m *Manager) DegradedWorkspace(workspaceID string) bool

DegradedWorkspace returns true if the workspaceID is degraded.

func (*Manager) DegradedWorkspaces

func (m *Manager) DegradedWorkspaces() []string

DegradedWorkspaceIDs returns a list of degraded workspaceIDs.

func (*Manager) Run

func (m *Manager) Run(ctx context.Context)

Run is a blocking function that executes manager background logic.

func (*Manager) SourceToWorkspace

func (m *Manager) SourceToWorkspace(ctx context.Context, sourceID string) (string, error)

SourceToWorkspace returns the workspaceID for a given sourceID, even if workspaceID is degraded. An error is returned if the sourceID is not found, or context is canceled.

NOTE: This function blocks until the backend config is loaded.

func (*Manager) WatchConfig

func (m *Manager) WatchConfig(ctx context.Context) <-chan map[string]backendconfig.ConfigT

WatchConfig returns a backend config map that excludes degraded workspaces.

NOTE: WatchConfig is responsible for closing the channel when context gets cancel.

Jump to

Keyboard shortcuts

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