namespace

package
v0.5.1 Latest Latest
Warning

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

Go to latest
Published: Apr 5, 2024 License: Apache-2.0 Imports: 12 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ValidateNamespace

func ValidateNamespace(code string) error

ValidateNamespace validates namespace code

Types

type Service

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

Service provides service layer to work with `namespace` business logic.

func NewService

func NewService(
	config *config.ServiceConfig,
	namespaceRepository repositories.NamespaceRepositoryProvider,
	experimentRepository repositories.ExperimentRepositoryProvider,
) *Service

NewService creates new Service instance.

func (Service) CreateNamespace

func (s Service) CreateNamespace(ctx context.Context, code, description string) (*models.Namespace, error)

CreateNamespace creates a new namespace and default experiment.

func (Service) DeleteNamespace

func (s Service) DeleteNamespace(ctx context.Context, id uint) error

DeleteNamespace deletes the namespace.

func (Service) GetNamespace

func (s Service) GetNamespace(ctx context.Context, id uint) (*models.Namespace, error)

GetNamespace returns one namespace by ID.

func (Service) ListNamespaces

func (s Service) ListNamespaces(ctx context.Context) ([]models.Namespace, error)

ListNamespaces returns all namespaces.

func (Service) UpdateNamespace

func (s Service) UpdateNamespace(ctx context.Context, id uint, code, description string) (*models.Namespace, error)

UpdateNamespace updates the code and description fields.

Jump to

Keyboard shortcuts

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