environment

package
v1.6.3 Latest Latest
Warning

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

Go to latest
Published: Jul 23, 2026 License: AGPL-3.0 Imports: 5 Imported by: 0

Documentation

Overview

Package environment manages promotion stages (dev → staging → prod) within a workspace. An Environment carries an ordering rank and an approval policy that the release-promotion flow enforces.

Index

Constants

This section is empty.

Variables

View Source
var (
	ErrNotFound     = errors.New("environment not found")
	ErrNameTaken    = errors.New("an environment with this name already exists")
	ErrNameRequired = errors.New("name is required")
)

Functions

This section is empty.

Types

type Input

type Input struct {
	Name              string
	DisplayName       string
	Description       string
	Rank              int
	RequiredApprovals int
	GitSourceID       *uint
}

Input is the create/update payload for an environment. Name is the desired unique slug handle; DisplayName is the free-text label (falls back to Name).

type Service

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

Service manages environments.

func NewService

func NewService(repo *repositories.EnvironmentRepository) *Service

NewService wires the environment service.

func (*Service) Create

func (s *Service) Create(workspaceID uint, in Input) (*models.Environment, error)

func (*Service) Delete

func (s *Service) Delete(workspaceID, id uint) error

func (*Service) Get

func (s *Service) Get(workspaceID, id uint) (*models.Environment, error)

func (*Service) List

func (s *Service) List(workspaceID uint) ([]models.Environment, error)

func (*Service) Update

func (s *Service) Update(workspaceID, id uint, in Input) (*models.Environment, error)

Jump to

Keyboard shortcuts

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