app

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: 22 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 app assembles the object graph every entry point shares.

Construction is explicit rather than reflective: every repository and service is built here, so the dependency graph the Java service expressed through component scanning is readable in one place. What this package adds over doing it inside the HTTP handler is a second caller — the workflow worker needs the same services the controllers do, and neither should be reaching for a package-level singleton to find them. The graph is built once per database and handed to whoever needs it.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Services

type Services struct {
	// Config and DB are carried so a caller that needs to open a transaction of its
	// own — or read what it was configured with — does not have to be handed them
	// separately alongside this struct.
	Config config.Config
	DB     *gorm.DB

	// Permissions resolves roles to the permissions they grant. The HTTP middleware
	// resolves each caller through it, and whatever changes role_permissions calls
	// Invalidate on it so the change takes effect at once.
	Permissions *iamrepo.PermissionResolver

	// Audit log.
	Audit *auditsvc.EventService

	// IAM.
	User        *iamsvc.UserService
	Group       *iamsvc.GroupService
	GroupMember *iamsvc.GroupMemberService
	// ServiceAccount administers non-human users and their expiring tokens.
	ServiceAccount *iamsvc.ServiceAccountService
	// Permission lists the permissions that exist.
	Permission *iamsvc.PermissionService

	// Credentials.
	SSHCredential   *credentialssvc.SSHCredentialService
	InteractiveAuth *credentialssvc.InteractiveAuthService

	// Compute.
	SlurmCluster              *computesvc.SlurmClusterService
	ClusterPartition          *computesvc.ClusterPartitionService
	SlurmClusterConfig        *computesvc.SlurmClusterConfigService
	SlurmClusterConfigSharing *sharingsvc.Service
	ClusterDiscovery          *computesvc.ClusterDiscoveryService

	// Application catalogue.
	Template        *applicationsvc.TemplateService
	BatchDeployment *applicationsvc.BatchDeploymentService

	// Data.
	SCPDataStorage              *datasvc.SCPDataStorageService
	SCPDataStorageSharing       *sharingsvc.Service
	DataProduct                 *datasvc.DataProductService
	DataProductSharing          *sharingsvc.Service
	DataTransfer                *datasvc.DataTransferService
	VirtualDataDirectory        *datasvc.VirtualDataDirectoryService
	VirtualDataFile             *datasvc.VirtualDataFileService
	VirtualDataDirectorySharing *sharingsvc.Service

	// Processes. There is no batch process service: a batch process is a section of
	// the process that owns it, written and read through ProcessService.
	Process                *processsvc.ProcessService
	ProcessStatus          *processsvc.StatusService
	TaskStatus             *processsvc.TaskStatusService
	ProcessWorkflow        *processsvc.WorkflowService
	DataStagingTask        *processsvc.DataStagingTaskService
	JobSubmissionTask      *processsvc.JobSubmissionTaskService
	JobMonitoringTask      *processsvc.JobMonitoringTaskService
	InteractiveCommandTask *processsvc.InteractiveCommandTaskService

	// Launch is a higher-level service that orchestrates the other services to submit
	// a process and its tasks, and to monitor the job until it completes.
	Launch *processsvc.LaunchService
	Link   *processsvc.LinkService

	ExecutionEngine *orchestration.ExecutionEngine
}

Services is every service the application exposes, built over one database.

The fields are exported and named after what they manage rather than after their types, so a caller reads Svcs.Process, not a type assertion out of a container.

func NewServices

func NewServices(cfg config.Config, db *gorm.DB, repos *Repositories, workflowBackend backend.Backend) *Services

New builds every service over db.

The repositories stay local: they are an implementation detail of the services above them, and nothing outside this function has ever wanted one directly.

Jump to

Keyboard shortcuts

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