repository

package
v0.5.0 Latest Latest
Warning

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

Go to latest
Published: Aug 31, 2026 License: Apache-2.0 Imports: 17 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type MemoryCompatibilityRepository

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

MemoryCompatibilityRepository is an in-memory implementation of port.CompatibilityRepository with three pre-loaded compatibility matrices.

func NewMemoryCompatibilityRepository

func NewMemoryCompatibilityRepository() *MemoryCompatibilityRepository

NewMemoryCompatibilityRepository constructs a MemoryCompatibilityRepository with three canonical compatibility matrices pre-loaded.

func (*MemoryCompatibilityRepository) Create

Create persists a new matrix. Returns ErrCompatibilityMatrixExists when the id collides with an existing row. F8-Phase5 admin CRUD endpoint backing.

func (*MemoryCompatibilityRepository) Delete

Delete is idempotent — missing row returns nil. Handlers that want strict 404 semantics should GetByID beforehand.

func (*MemoryCompatibilityRepository) GetAll

GetAll returns all compatibility matrices.

func (*MemoryCompatibilityRepository) GetByID

GetByID returns the compatibility matrix with the given ID.

func (*MemoryCompatibilityRepository) Update

Update replaces every mutable field on the matrix identified by m.ID.

func (*MemoryCompatibilityRepository) Validate

Validate finds the best matching matrix for the given tool map (tool category -> tool name). Returns the first matrix whose tools all match. Returns an error if no match is found.

type MemoryHelmStepMetadataRepository

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

MemoryHelmStepMetadataRepository is an in-memory implementation of the Helm step metadata repository.

func NewMemoryHelmStepMetadataRepository

func NewMemoryHelmStepMetadataRepository() *MemoryHelmStepMetadataRepository

NewMemoryHelmStepMetadataRepository constructs an empty in-memory repository.

func (*MemoryHelmStepMetadataRepository) Create

func (*MemoryHelmStepMetadataRepository) Delete

func (*MemoryHelmStepMetadataRepository) GetByStep

func (*MemoryHelmStepMetadataRepository) List

func (*MemoryHelmStepMetadataRepository) Seed

func (*MemoryHelmStepMetadataRepository) Update

type MemoryHistoryRepository

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

MemoryHistoryRepository is an in-memory implementation of port.HistoryRepository.

func NewMemoryHistoryRepository

func NewMemoryHistoryRepository() *MemoryHistoryRepository

NewMemoryHistoryRepository constructs an empty MemoryHistoryRepository.

func (*MemoryHistoryRepository) GetDiff

func (r *MemoryHistoryRepository) GetDiff(_ context.Context, stackID, versionID string) ([]domain.ConfigDiff, error)

GetDiff computes the diff between the given version and the one immediately preceding it. If there is no previous version, all fields are reported as new (OldValue = "").

func (*MemoryHistoryRepository) GetVersion

func (r *MemoryHistoryRepository) GetVersion(_ context.Context, stackID, versionID string) (*domain.StackVersion, error)

GetVersion returns a specific version by its ID, scoped to a stack.

func (*MemoryHistoryRepository) ListVersions

func (r *MemoryHistoryRepository) ListVersions(_ context.Context, stackID string) ([]*domain.StackVersion, error)

ListVersions returns all versions for a stack, sorted by version number ascending.

func (*MemoryHistoryRepository) SaveVersion

func (r *MemoryHistoryRepository) SaveVersion(_ context.Context, version *domain.StackVersion) error

SaveVersion persists a new stack version snapshot.

type MemoryResourceDefaultRepository

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

func NewMemoryResourceDefaultRepository

func NewMemoryResourceDefaultRepository() *MemoryResourceDefaultRepository

func (*MemoryResourceDefaultRepository) List

func (*MemoryResourceDefaultRepository) Upsert

type MemoryStackRepository

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

MemoryStackRepository is an in-memory implementation of port.StackRepository. It is intended for development and testing; it is not safe to use across process restarts.

func NewMemoryStackRepository

func NewMemoryStackRepository() *MemoryStackRepository

NewMemoryStackRepository constructs an empty MemoryStackRepository.

func (*MemoryStackRepository) Create

func (r *MemoryStackRepository) Create(_ context.Context, stack *domain.Stack) error

Create stores a new stack. Returns an error if the ID already exists.

func (*MemoryStackRepository) Delete

Delete removes a stack by ID.

func (*MemoryStackRepository) FindByID

func (r *MemoryStackRepository) FindByID(ctx context.Context, id string) (*domain.Stack, error)

func (*MemoryStackRepository) GetByID

GetByID retrieves a stack by its ID.

func (*MemoryStackRepository) List

func (r *MemoryStackRepository) List(_ context.Context, orgID string, includeDeleted bool) ([]*domain.Stack, error)

List returns all stacks belonging to the given organization.

func (*MemoryStackRepository) ListInFlight

func (r *MemoryStackRepository) ListInFlight(_ context.Context) ([]*domain.Stack, error)

ListInFlight 는 설치가 진행 중인 상태로 남아 있는 스택을 조직과 무관하게 돌려준다.

func (*MemoryStackRepository) TouchUpdatedAt

func (r *MemoryStackRepository) TouchUpdatedAt(_ context.Context, stackID string) error

Update replaces a stored stack with the given value. TouchUpdatedAt 은 갱신 시각만 찍는다. 설치가 살아 있음을 알리는 데 쓴다.

func (*MemoryStackRepository) Update

func (r *MemoryStackRepository) Update(_ context.Context, stack *domain.Stack) error

func (*MemoryStackRepository) UpdateTools

func (r *MemoryStackRepository) UpdateTools(ctx context.Context, stack *domain.Stack) error

type MemoryTemplateRepository

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

MemoryTemplateRepository is an in-memory implementation of port.TemplateRepository with canonical Golden Path templates.

func NewMemoryTemplateRepository

func NewMemoryTemplateRepository() *MemoryTemplateRepository

NewMemoryTemplateRepository constructs a MemoryTemplateRepository with canonical Golden Path templates pre-loaded.

func (*MemoryTemplateRepository) Create

func (r *MemoryTemplateRepository) Create(_ context.Context, template *domain.Template) error

func (*MemoryTemplateRepository) Delete

func (*MemoryTemplateRepository) GetByID

GetByID returns the template with the given ID.

func (*MemoryTemplateRepository) List

List returns all available templates.

func (*MemoryTemplateRepository) Update

func (r *MemoryTemplateRepository) Update(_ context.Context, template *domain.Template) error

type PostgresClusterReader

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

PostgresClusterReader implements port.ClusterReader by querying the clusters table the admin module owns. This is safe inside the modular monolith because both modules share one database; a future microservice split would replace this with a gRPC/HTTP client.

func NewPostgresClusterReader

func NewPostgresClusterReader(pool *pgxpool.Pool) *PostgresClusterReader

NewPostgresClusterReader constructs a PostgresClusterReader.

func (*PostgresClusterReader) GetClusterSummary

func (r *PostgresClusterReader) GetClusterSummary(ctx context.Context, clusterID string) (*port.ClusterSummary, error)

GetClusterSummary returns the subset of cluster fields the Pre-Deploy Gate needs. Returns nil, nil when the cluster row is missing.

type PostgresCompatibilityRepository

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

func NewPostgresCompatibilityRepository

func NewPostgresCompatibilityRepository(pool *pgxpool.Pool) *PostgresCompatibilityRepository

func (*PostgresCompatibilityRepository) Create

Create inserts a new matrix. Returns port.ErrCompatibilityMatrixExists when the id is already present (ON CONFLICT DO NOTHING + rows-affected check).

func (*PostgresCompatibilityRepository) Delete

Delete removes a matrix. Idempotent — missing id is not an error.

func (*PostgresCompatibilityRepository) GetAll

func (*PostgresCompatibilityRepository) GetByID

func (*PostgresCompatibilityRepository) Update

Update replaces every mutable column. Returns port.ErrCompatibilityMatrixNotFound when no row matched.

func (*PostgresCompatibilityRepository) Validate

type PostgresDeployLogStore

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

PostgresDeployLogStore 는 설치 로그를 stack_deploy_logs 에 남긴다.

로그가 프로세스 메모리에만 있으면 파드가 재시작되는 순간 사라진다. 설치는 20~30분짜리라 그 사이 재시작이 겹칠 확률이 낮지 않고, 그러면 무엇이 왜 멈췄는지 사후에 알 방법이 없다.

func NewPostgresDeployLogStore

func NewPostgresDeployLogStore(pool *pgxpool.Pool) *PostgresDeployLogStore

func (*PostgresDeployLogStore) Append

func (r *PostgresDeployLogStore) Append(ctx context.Context, deploymentID string, entry port.LogEntry) error

Append 는 항목 하나를 남긴다.

func (*PostgresDeployLogStore) Delete

func (r *PostgresDeployLogStore) Delete(ctx context.Context, deploymentID string) error

Delete 는 이 배포의 로그를 지운다.

func (*PostgresDeployLogStore) List

func (r *PostgresDeployLogStore) List(ctx context.Context, deploymentID string, limit int) ([]port.LogEntry, error)

List 는 최근 limit 줄을 기록 순서로 돌려준다.

상한을 넘으면 오래된 쪽을 버린다 — 화면이 필요로 하는 것은 최근이고, 진행률은 마지막 항목에서 복원되기 때문이다. 그래서 안쪽 질의는 seq 역순으로 자르고 바깥에서 다시 오름차순으로 세운다.

type PostgresHelmStepMetadataRepository

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

PostgresHelmStepMetadataRepository stores DB-backed Helm chart metadata for stack steps.

func NewPostgresHelmStepMetadataRepository

func NewPostgresHelmStepMetadataRepository(pool *pgxpool.Pool) *PostgresHelmStepMetadataRepository

func (*PostgresHelmStepMetadataRepository) Create

func (*PostgresHelmStepMetadataRepository) Delete

func (*PostgresHelmStepMetadataRepository) GetByStep

func (*PostgresHelmStepMetadataRepository) List

func (*PostgresHelmStepMetadataRepository) Update

type PostgresHistoryRepository

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

func NewPostgresHistoryRepository

func NewPostgresHistoryRepository(pool *pgxpool.Pool) *PostgresHistoryRepository

func (*PostgresHistoryRepository) GetDiff

func (r *PostgresHistoryRepository) GetDiff(ctx context.Context, stackID, versionID string) ([]domain.ConfigDiff, error)

func (*PostgresHistoryRepository) GetVersion

func (r *PostgresHistoryRepository) GetVersion(ctx context.Context, stackID, versionID string) (*domain.StackVersion, error)

func (*PostgresHistoryRepository) ListVersions

func (r *PostgresHistoryRepository) ListVersions(ctx context.Context, stackID string) ([]*domain.StackVersion, error)

func (*PostgresHistoryRepository) SaveVersion

func (r *PostgresHistoryRepository) SaveVersion(ctx context.Context, version *domain.StackVersion) error

type PostgresKubeconfigProvider

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

func NewPostgresKubeconfigProvider

func NewPostgresKubeconfigProvider(pool *pgxpool.Pool, encryptionKey []byte) *PostgresKubeconfigProvider

func (*PostgresKubeconfigProvider) GetKubeconfig

func (p *PostgresKubeconfigProvider) GetKubeconfig(ctx context.Context, clusterID string) ([]byte, error)

type PostgresResourceDefaultRepository

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

func NewPostgresResourceDefaultRepository

func NewPostgresResourceDefaultRepository(pool *pgxpool.Pool) *PostgresResourceDefaultRepository

func (*PostgresResourceDefaultRepository) List

func (*PostgresResourceDefaultRepository) Upsert

type PostgresStackRepository

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

func NewPostgresStackRepository

func NewPostgresStackRepository(pool *pgxpool.Pool) *PostgresStackRepository

func (*PostgresStackRepository) Create

func (r *PostgresStackRepository) Create(ctx context.Context, stack *domain.Stack) error

func (*PostgresStackRepository) Delete

func (r *PostgresStackRepository) Delete(ctx context.Context, id string) error

func (*PostgresStackRepository) FindByID

func (r *PostgresStackRepository) FindByID(ctx context.Context, id string) (*domain.Stack, error)

func (*PostgresStackRepository) GetByID

func (*PostgresStackRepository) List

func (r *PostgresStackRepository) List(ctx context.Context, orgID string, includeDeleted bool) ([]*domain.Stack, error)

func (*PostgresStackRepository) ListInFlight

func (r *PostgresStackRepository) ListInFlight(ctx context.Context) ([]*domain.Stack, error)

ListInFlight 는 설치가 진행 중인 상태로 남아 있는 스택을 조직과 무관하게 돌려준다.

조직으로 거르지 않는다. 끊긴 설치를 찾는 일은 조직 경계와 무관하고, 거르면 조직 수만큼 조회를 반복해야 한다.

func (*PostgresStackRepository) TouchUpdatedAt

func (r *PostgresStackRepository) TouchUpdatedAt(ctx context.Context, stackID string) error

TouchUpdatedAt 은 갱신 시각만 찍는다.

끊긴 설치를 찾는 리퍼는 갱신 시각만 본다. 그런데 그 시각은 단계가 시작·완료될 때만 움직여서, 한 단계가 임계값보다 오래 걸리면 멀쩡히 도는 설치가 끊긴 것으로 표시된다 — 2026-08-21 운영에서 그렇게 됐다. 설치가 도는 동안 이것을 주기적으로 찍으면 "시각이 멈췄다" 가 "돌리던 것이 사라졌다" 를 뜻하게 된다.

func (*PostgresStackRepository) Update

func (r *PostgresStackRepository) Update(ctx context.Context, stack *domain.Stack) error

func (*PostgresStackRepository) UpdateTools

func (r *PostgresStackRepository) UpdateTools(ctx context.Context, stack *domain.Stack) error

type PostgresTemplateRepository

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

func NewPostgresTemplateRepository

func NewPostgresTemplateRepository(pool *pgxpool.Pool) *PostgresTemplateRepository

func (*PostgresTemplateRepository) Create

func (r *PostgresTemplateRepository) Create(ctx context.Context, template *domain.Template) error

func (*PostgresTemplateRepository) Delete

func (*PostgresTemplateRepository) GetByID

func (*PostgresTemplateRepository) List

func (*PostgresTemplateRepository) Update

func (r *PostgresTemplateRepository) Update(ctx context.Context, template *domain.Template) error

type PostgresTokenSourceRegistry

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

func NewPostgresTokenSourceRegistry

func NewPostgresTokenSourceRegistry(pool *pgxpool.Pool, secret *secrets.Router) *PostgresTokenSourceRegistry

func (*PostgresTokenSourceRegistry) Upsert

Jump to

Keyboard shortcuts

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