Documentation
¶
Overview ¶
Package namespace provides the NamespaceManageService for managing namespaces.
Index ¶
- Variables
- type Service
- func (s *Service) CreateNamespace(ctx context.Context, apiModel *v1.Namespace) (*v1.Namespace, error)
- func (s *Service) DeleteNamespace(ctx context.Context, name string) error
- func (s *Service) GetNamespace(ctx context.Context, name string) (*v1.Namespace, error)
- func (s *Service) ListNamespaces(ctx context.Context, options *model.ListOptions) (*v1.ListResponse[v1.Namespace], error)
- func (s *Service) UpdateNamespace(ctx context.Context, name string, apiModel *v1.Namespace) (*v1.Namespace, error)
Constants ¶
This section is empty.
Variables ¶
var ErrDefaultNamespaceUndeletable = errors.New(
"default namespace cannot be deleted",
)
ErrDefaultNamespaceUndeletable is returned when trying to delete the default namespace.
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 ¶
DeleteNamespace implements port.NamespaceManageUsecase. Cascade deletes all agent groups, certificates, and agent packages in the namespace.
func (*Service) GetNamespace ¶
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.