namespace

package
v1.0.0-beta.17 Latest Latest
Warning

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

Go to latest
Published: Nov 7, 2023 License: Apache-2.0 Imports: 2 Imported by: 0

Documentation

Overview

Package namespace adds a concept of tenancy to OpenMeter allowing to segment clients.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Handler

type Handler interface {
	CreateNamespace(ctx context.Context, name string) error
}

Handler is responsible for creating a namespace in a given component.

An empty name means a default namespace is supposed to be created. The concept of a default namespace is implementation specific.

The behavior for trying to create a namespace that already exists is unspecified at the moment.

type Manager

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

Manager is responsible for managing namespaces in different components.

func NewManager

func NewManager(config ManagerConfig) (*Manager, error)

func (Manager) CreateDefaultNamespace

func (m Manager) CreateDefaultNamespace(ctx context.Context) error

CreateDefaultNamespace orchestrates the creation of a default namespace.

The concept of a default namespace is implementation specific.

func (Manager) CreateNamespace

func (m Manager) CreateNamespace(ctx context.Context, name string) error

CreateNamespace orchestrates namespace creation across different components.

func (Manager) GetDefaultNamespace

func (m Manager) GetDefaultNamespace() string

func (Manager) IsManagementDisabled

func (m Manager) IsManagementDisabled() bool

type ManagerConfig

type ManagerConfig struct {
	DefaultNamespace  string
	DisableManagement bool
	Handlers          []Handler
}

Jump to

Keyboard shortcuts

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