static

package
v0.32.0 Latest Latest
Warning

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

Go to latest
Published: May 14, 2026 License: MIT Imports: 4 Imported by: 0

Documentation

Overview

Package static provides a TenantLister that enumerates tenant IDs from a config-backed source (typically the YAML-driven multitenant.tenants block).

Index

Constants

This section is empty.

Variables

View Source
var ErrEmptyTenantID = errors.New("migration/source/static: tenant store contains empty tenant id")

ErrEmptyTenantID is returned when the underlying tenant store contains an empty-string tenant ID. Callers can branch on this with errors.Is.

View Source
var ErrNilStore = errors.New("migration/source/static: TenantStoreLister is nil")

ErrNilStore is returned when ListTenants is called on a TenantSource whose underlying TenantStoreLister is nil.

Functions

This section is empty.

Types

type TenantSource

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

TenantSource implements migration.TenantLister against a TenantStoreLister.

func FromConfigStore

func FromConfigStore(store TenantStoreLister) *TenantSource

FromConfigStore wraps a *config.TenantStore (or any type that exposes Tenants()) as a TenantLister.

func (*TenantSource) ListTenants

func (s *TenantSource) ListTenants(_ context.Context) ([]string, error)

ListTenants returns the tenant IDs known to the underlying store, sorted alphabetically for deterministic CI output. An empty-string tenant ID is rejected with an error rather than silently leaking downstream — the migration runner would otherwise compose a malformed secret name like "gobricks/migrate/" and fail with a confusing fetch error.

type TenantStoreLister

type TenantStoreLister interface {
	Tenants() map[string]config.TenantEntry
}

TenantStoreLister is the subset of *config.TenantStore that TenantSource requires. Defined as an interface so tests can substitute a fake without constructing a full store.

Jump to

Keyboard shortcuts

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