Help us shape the future of Go! Take the 2026 Go Developer Survey

namespaces

package
v0.4.2 Latest Latest
Warning

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

Go to latest
Published: Oct 30, 2026 License: Apache-2.0 Imports: 23 Imported by: 0

Documentation

Overview

Package namespaces manages project credentials and enrolled project relays. Relay ownership uses a recorded service identity or a non-sensitive marker; enrollment certificates and keys remain sensitive variables.

Index

Constants

This section is empty.

Variables

View Source
var ErrConflict = store.ErrConflict
View Source
var ErrInvalid = errors.New("invalid namespace")
View Source
var ErrNotFound = store.ErrNotFound

Functions

func RelayHostname

func RelayHostname(hostname string) string

RelayHostname preserves the usual name while bounding long control-plane names.

func RelayRuntime added in v0.2.0

func RelayRuntime(publicURL, namespace string) infra.RuntimeSpec

RelayRuntime contains public configuration only; enrollment uses env secrets.

Types

type Backend

type Backend = infra.Backend

type EventRecorder

type EventRecorder interface {
	Record(context.Context, domain.Event) error
}

type Options

type Options struct {
	Store                                  *store.Store
	DefaultBackend                         Backend
	Backends                               *infra.Registry
	DefaultTarget                          infra.Target
	PublicURL, AdvertiseURL, RelayHostname string
	Events                                 EventRecorder
	Logger                                 *slog.Logger
	Artifact                               engine.ArtifactSource
	ExecutableHash                         string
	RelayTargets                           func(*domain.Cluster) []string
}

type PlatformUnavailableError

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

PlatformUnavailableError exposes a safe validation diagnostic without misclassifying a platform failure as invalid namespace credentials.

func (*PlatformUnavailableError) Error

func (e *PlatformUnavailableError) Error() string

type Registry

type Registry struct {
	Hub *relay.Hub
	// contains filtered or unexported fields
}

func New

func New(ctx context.Context, o Options) (*Registry, error)

func (*Registry) AgentURL

func (r *Registry) AgentURL(ns string) string

func (*Registry) Authorize

func (r *Registry) Authorize(ctx context.Context, ns string, cert *x509.Certificate) error

func (*Registry) Backend

func (r *Registry) Backend(ns string) (infra.Backend, error)

func (*Registry) Close

func (r *Registry) Close() error

func (*Registry) ClusterCount

func (r *Registry) ClusterCount(ctx context.Context, namespace string) (int, error)

func (*Registry) Create

func (r *Registry) Create(ctx context.Context, name, projectID, token, description, kind string, config map[string]string) (*domain.Namespace, error)

func (*Registry) Delete

func (r *Registry) Delete(ctx context.Context, name string) error

func (*Registry) Dialer

func (r *Registry) Dialer(ns string) engine.ContextDialer

func (*Registry) Get

func (r *Registry) Get(ctx context.Context, name string) (*domain.Namespace, error)

func (*Registry) List

func (r *Registry) List(ctx context.Context) ([]domain.Namespace, error)

func (*Registry) RotateToken

func (r *Registry) RotateToken(ctx context.Context, name, token string) (*domain.Namespace, error)

func (*Registry) Run

func (r *Registry) Run(ctx context.Context) error

Run reconciles projects independently. One unavailable project cannot stall another.

func (*Registry) Update

func (r *Registry) Update(ctx context.Context, name, description string) (*domain.Namespace, error)

func (*Registry) Validate

func (r *Registry) Validate(ctx context.Context, name string) (*domain.Namespace, error)

Jump to

Keyboard shortcuts

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