service

package
v1.0.0-alpha1 Latest Latest
Warning

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

Go to latest
Published: Nov 13, 2026 License: Apache-2.0 Imports: 11 Imported by: 1 module, 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 service holds the application vertical's business rules: templates and the batch deployments that bind them to a cluster.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type BatchDeploymentService

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

BatchDeploymentService manages deployments: a template made runnable somewhere.

func NewBatchDeploymentService

func NewBatchDeploymentService(
	db *gorm.DB,
	deployments *repository.BatchDeploymentRepository,
	templates *repository.TemplateRepository,
	clusters *computerepo.SlurmClusterRepository,
) *BatchDeploymentService

NewBatchDeploymentService returns a deployment service.

func (*BatchDeploymentService) Create

Create registers a deployment and the resource request it owns.

func (*BatchDeploymentService) Delete

func (s *BatchDeploymentService) Delete(ctx context.Context, id string) error

Delete removes a deployment and its owned config.

func (*BatchDeploymentService) Get

Get returns one deployment.

func (*BatchDeploymentService) List

List returns every deployment, or only those of templateID when it is non-empty.

func (*BatchDeploymentService) Update

Update changes a deployment, mutating its owned config in place so the config row survives the edit rather than being replaced.

type TemplateService

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

TemplateService manages application templates and their owned declarations.

Reads are open; writes are administrative. A template describes an application's contract independently of where it runs, so its declarations are replaced wholesale on update rather than patched.

func NewTemplateService

func NewTemplateService(db *gorm.DB, templates *repository.TemplateRepository, deployments *repository.BatchDeploymentRepository) *TemplateService

NewTemplateService returns a template service.

func (*TemplateService) Create

Create registers a template together with its declarations.

func (*TemplateService) Delete

func (s *TemplateService) Delete(ctx context.Context, id string) error

Delete removes a template, refusing while it still has deployments.

Deployments outlive individual template edits and are managed through their own endpoints, so removing the template out from under them is rejected rather than cascaded.

func (*TemplateService) Get

Get returns one template.

func (*TemplateService) List

List returns every template.

func (*TemplateService) Update

Update replaces a template's fields and its declaration set.

Jump to

Keyboard shortcuts

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