repository

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: 3 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 repository reads and writes application templates and batch deployments.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type BatchDeploymentRepository

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

BatchDeploymentRepository reads and writes deployments.

func NewBatchDeploymentRepository

func NewBatchDeploymentRepository(db *gorm.DB) *BatchDeploymentRepository

NewBatchDeploymentRepository returns a repository backed by db.

func (*BatchDeploymentRepository) Delete

Delete removes a deployment; the AfterDelete hook removes its owned config.

func (*BatchDeploymentRepository) ExistsByTemplateID

func (r *BatchDeploymentRepository) ExistsByTemplateID(ctx context.Context, templateID string) (bool, error)

ExistsByTemplateID reports whether a template still has deployments. This is what blocks template deletion with a conflict.

func (*BatchDeploymentRepository) FindAll

FindAll returns every deployment with its owned batch job config.

func (*BatchDeploymentRepository) FindByID

FindByID returns one deployment, or gorm.ErrRecordNotFound.

func (*BatchDeploymentRepository) FindByTemplateID

func (r *BatchDeploymentRepository) FindByTemplateID(ctx context.Context, templateID string) ([]model.BatchDeployment, error)

FindByTemplateID returns every deployment of one template.

func (*BatchDeploymentRepository) Save

Save writes the deployment row. The owned config is written separately by SaveConfig, so that an update mutates the existing config row rather than replacing it and leaving an orphan.

func (*BatchDeploymentRepository) SaveConfig

SaveConfig inserts or updates an owned batch job config.

func (*BatchDeploymentRepository) WithTx

WithTx returns a repository bound to tx.

type TemplateRepository

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

TemplateRepository reads and writes application templates and their owned input/output declarations.

func NewTemplateRepository

func NewTemplateRepository(db *gorm.DB) *TemplateRepository

NewTemplateRepository returns a repository backed by db.

func (*TemplateRepository) Delete

Delete removes a template; its declarations go with it via the cascade.

func (*TemplateRepository) ExistsByName

func (r *TemplateRepository) ExistsByName(ctx context.Context, name string) (bool, error)

ExistsByName reports whether a template of that name exists. Declared but never called in the Java service.

func (*TemplateRepository) FindAll

func (r *TemplateRepository) FindAll(ctx context.Context) ([]model.Template, error)

FindAll returns every template with its declarations.

func (*TemplateRepository) FindByID

func (r *TemplateRepository) FindByID(ctx context.Context, id string) (*model.Template, error)

FindByID returns one template with its declarations, or gorm.ErrRecordNotFound.

func (*TemplateRepository) ReplaceChildren

func (r *TemplateRepository) ReplaceChildren(ctx context.Context, templateID string, inputs []model.TemplateInput, outputs []model.TemplateOutput) error

ReplaceChildren swaps a template's declarations for the given ones.

The Java service replaced the collections wholesale on every update, so child ids are regenerated and any id supplied on the request is ignored. That is preserved here: an update declares what the inputs and outputs now are, not a patch of them.

func (*TemplateRepository) SaveTemplate

func (r *TemplateRepository) SaveTemplate(ctx context.Context, t *model.Template) error

SaveTemplate writes the template row only, leaving its declarations alone. Children are replaced explicitly by ReplaceChildren rather than cascaded from here, so an update cannot quietly drop declarations the caller did not mention.

func (*TemplateRepository) WithTx

func (r *TemplateRepository) WithTx(tx *gorm.DB) *TemplateRepository

WithTx returns a repository bound to tx.

Jump to

Keyboard shortcuts

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