namespace

package
v0.1.39 Latest Latest
Warning

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

Go to latest
Published: May 9, 2026 License: MIT Imports: 13 Imported by: 0 modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Overview

Package namespace provides the NamespaceManageService for managing namespaces.

Index

Constants

This section is empty.

Variables

View Source
var ErrDefaultNamespaceUndeletable = errors.New(
	"default namespace cannot be deleted",
)

ErrDefaultNamespaceUndeletable is returned when trying to delete the default namespace.

View Source
var ErrNamespaceAlreadyExists = errors.New("namespace already exists")

ErrNamespaceAlreadyExists is returned when a namespace with the same name already exists.

Functions

This section is empty.

Types

type Service

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

Service is a service for managing namespaces.

func NewNamespaceService

func NewNamespaceService(
	namespaceUsecase agentport.NamespaceUsecase,
	agentGroupUsecase agentport.AgentGroupUsecase,
	certificateUsecase agentport.CertificateUsecase,
	agentPackageUsecase agentport.AgentPackageUsecase,
	agentRemoteConfigUsecase agentport.AgentRemoteConfigUsecase,
	logger *slog.Logger,
) *Service

NewNamespaceService creates a new namespace manage service.

func (*Service) CreateNamespace

func (s *Service) CreateNamespace(
	ctx context.Context,
	apiModel *v1.Namespace,
) (*v1.Namespace, error)

CreateNamespace implements port.NamespaceManageUsecase.

func (*Service) DeleteNamespace

func (s *Service) DeleteNamespace(
	ctx context.Context,
	name string,
) error

DeleteNamespace implements port.NamespaceManageUsecase. Cascade deletes all agent groups, certificates, and agent packages in the namespace.

func (*Service) GetNamespace

func (s *Service) GetNamespace(
	ctx context.Context,
	name string,
) (*v1.Namespace, error)

GetNamespace implements port.NamespaceManageUsecase.

func (*Service) ListNamespaces

func (s *Service) ListNamespaces(
	ctx context.Context,
	options *model.ListOptions,
) (*v1.ListResponse[v1.Namespace], error)

ListNamespaces implements port.NamespaceManageUsecase.

func (*Service) UpdateNamespace

func (s *Service) UpdateNamespace(
	ctx context.Context,
	name string,
	apiModel *v1.Namespace,
) (*v1.Namespace, error)

UpdateNamespace implements port.NamespaceManageUsecase.

Jump to

Keyboard shortcuts

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