repository

package
v0.6.0 Latest Latest
Warning

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

Go to latest
Published: Oct 30, 2026 License: Apache-2.0 Imports: 16 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type MemoryCICDTemplateRepository

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

MemoryCICDTemplateRepository is an in-memory implementation of port.PipelineTemplateRepository with hard-coded CI/CD pipeline templates.

func NewMemoryCICDTemplateRepository

func NewMemoryCICDTemplateRepository() *MemoryCICDTemplateRepository

NewMemoryCICDTemplateRepository constructs a MemoryCICDTemplateRepository with canonical CI/CD pipeline templates pre-loaded.

func (*MemoryCICDTemplateRepository) Create

Create stores a new pipeline template. Postgres 저장소와 같이 같은 ID 는 거부한다.

func (*MemoryCICDTemplateRepository) Delete

Delete removes a pipeline template by ID.

func (*MemoryCICDTemplateRepository) GetByID

GetByID returns the template with the given ID.

func (*MemoryCICDTemplateRepository) List

List returns all available CI/CD pipeline templates.

func (*MemoryCICDTemplateRepository) Update

Update replaces an existing pipeline template.

type MemoryDependencyScanResultRepository added in v0.6.0

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

MemoryDependencyScanResultRepository 는 port.DependencyScanResultRepository 의 메모리 구현이다.

func NewMemoryDependencyScanResultRepository added in v0.6.0

func NewMemoryDependencyScanResultRepository() *MemoryDependencyScanResultRepository

NewMemoryDependencyScanResultRepository 는 빈 저장소를 만든다.

func (*MemoryDependencyScanResultRepository) Delete added in v0.6.0

Delete 는 기록을 지운다. 없으면 아무 일도 하지 않는다.

func (*MemoryDependencyScanResultRepository) ListByPipelineID added in v0.6.0

ListByPipelineID 는 최신 결과부터 돌려준다.

func (*MemoryDependencyScanResultRepository) Upsert added in v0.6.0

Upsert 는 같은 ID 면 덮어쓴다.

type MemoryDeploymentRepository

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

MemoryDeploymentRepository is an in-memory implementation of port.DeploymentRepository.

func NewMemoryDeploymentRepository

func NewMemoryDeploymentRepository() *MemoryDeploymentRepository

NewMemoryDeploymentRepository constructs an empty MemoryDeploymentRepository.

func (*MemoryDeploymentRepository) Create

Create stores a new deployment.

func (*MemoryDeploymentRepository) Delete added in v0.6.0

Delete 는 기록 하나를 지운다. 없으면 오류가 아니다.

func (*MemoryDeploymentRepository) GetByID

GetByID retrieves a deployment by its ID.

func (*MemoryDeploymentRepository) ListByPipelineID

func (r *MemoryDeploymentRepository) ListByPipelineID(_ context.Context, pipelineID string) ([]*domain.Deployment, error)

ListByPipelineID returns all deployments for a given pipeline.

func (*MemoryDeploymentRepository) Update

Update persists changes to an existing deployment.

type MemoryImageScanResultRepository added in v0.6.0

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

MemoryImageScanResultRepository 는 port.ImageScanResultRepository 의 메모리 구현이다.

func NewMemoryImageScanResultRepository added in v0.6.0

func NewMemoryImageScanResultRepository() *MemoryImageScanResultRepository

NewMemoryImageScanResultRepository 는 빈 저장소를 만든다.

func (*MemoryImageScanResultRepository) Delete added in v0.6.0

Delete 는 기록을 지운다. 없으면 아무 일도 하지 않는다.

func (*MemoryImageScanResultRepository) GetByID added in v0.6.0

GetByID 는 결과 하나다. 없으면 nil, nil 이다.

func (*MemoryImageScanResultRepository) ListByPipelineID added in v0.6.0

func (r *MemoryImageScanResultRepository) ListByPipelineID(_ context.Context, pipelineID string) ([]*domain.ImageScanResult, error)

ListByPipelineID 는 최신 결과부터 돌려준다.

func (*MemoryImageScanResultRepository) Upsert added in v0.6.0

Upsert 는 같은 ID 면 덮어쓴다.

type MemoryPipelineRepository

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

MemoryPipelineRepository is an in-memory implementation of port.PipelineRepository.

func NewMemoryPipelineRepository

func NewMemoryPipelineRepository() *MemoryPipelineRepository

NewMemoryPipelineRepository constructs an empty MemoryPipelineRepository.

func (*MemoryPipelineRepository) Create

Create stores a new pipeline.

func (*MemoryPipelineRepository) Delete

Delete removes a pipeline by ID. No-op when the pipeline does not exist so callers can idempotently clean up.

func (*MemoryPipelineRepository) GetByID

GetByID retrieves a pipeline by its ID.

func (*MemoryPipelineRepository) List

func (*MemoryPipelineRepository) ListByStackID

func (r *MemoryPipelineRepository) ListByStackID(_ context.Context, stackID string) ([]*domain.Pipeline, error)

ListByStackID returns all pipelines linked to a specific stack.

func (*MemoryPipelineRepository) ListWithStack added in v0.6.0

func (r *MemoryPipelineRepository) ListWithStack(_ context.Context) ([]*domain.Pipeline, error)

List returns all pipelines for an organization. ListWithStack 은 스택에 묶인 파이프라인을 조직과 무관하게 돌려준다(주기 동기화용).

func (*MemoryPipelineRepository) OtherPipelinesNamed added in v0.6.0

func (r *MemoryPipelineRepository) OtherPipelinesNamed(_ context.Context, stackID, name, excludeID string) ([]string, error)

OtherPipelinesNamed 는 같은 스택에서 같은 이름을 쓰는 다른 파이프라인의 ID 를 돌려준다.

func (*MemoryPipelineRepository) Update

Update persists changes to an existing pipeline.

type MemorySASTResultRepository added in v0.6.0

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

MemorySASTResultRepository 는 port.SASTResultRepository 의 메모리 구현이다.

func NewMemorySASTResultRepository added in v0.6.0

func NewMemorySASTResultRepository() *MemorySASTResultRepository

NewMemorySASTResultRepository 는 빈 저장소를 만든다.

func (*MemorySASTResultRepository) ListByPipelineID added in v0.6.0

func (r *MemorySASTResultRepository) ListByPipelineID(_ context.Context, pipelineID string) ([]*domain.SASTResult, error)

ListByPipelineID 는 최신 분석부터 돌려준다.

func (*MemorySASTResultRepository) Upsert added in v0.6.0

Upsert 는 같은 ID 면 덮어쓴다.

type MemoryScanPolicyRepository added in v0.6.0

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

MemoryScanPolicyRepository 는 port.ScanPolicyRepository 의 메모리 구현이다.

func NewMemoryScanPolicyRepository added in v0.6.0

func NewMemoryScanPolicyRepository() *MemoryScanPolicyRepository

NewMemoryScanPolicyRepository 는 빈 저장소를 만든다.

func (*MemoryScanPolicyRepository) Get added in v0.6.0

Get 은 저장된 정책이다. 저장한 적 없으면 found=false 다.

func (*MemoryScanPolicyRepository) Upsert added in v0.6.0

func (r *MemoryScanPolicyRepository) Upsert(_ context.Context, stackID string, policy domain.ScanPolicy, _ string) error

Upsert 는 스택의 정책을 저장하거나 덮어쓴다.

type MemorySecretScanResultRepository added in v0.6.0

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

MemorySecretScanResultRepository 는 port.SecretScanResultRepository 의 메모리 구현이다.

func NewMemorySecretScanResultRepository added in v0.6.0

func NewMemorySecretScanResultRepository() *MemorySecretScanResultRepository

NewMemorySecretScanResultRepository 는 빈 저장소를 만든다.

func (*MemorySecretScanResultRepository) Delete added in v0.6.0

Delete 는 기록을 지운다. 없으면 아무 일도 하지 않는다.

func (*MemorySecretScanResultRepository) ListByPipelineID added in v0.6.0

func (r *MemorySecretScanResultRepository) ListByPipelineID(_ context.Context, pipelineID string) ([]*domain.SecretScanResult, error)

ListByPipelineID 는 최신 결과부터 돌려준다.

func (*MemorySecretScanResultRepository) Upsert added in v0.6.0

Upsert 는 같은 ID 면 덮어쓴다.

type PostgresCICDGoldenPathRepository added in v0.6.0

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

PostgresCICDGoldenPathRepository 는 cicd_golden_paths 표를 읽고 쓴다. 종전 구현(MemoryCICDGoldenPathRepository)은 프로세스 메모리에 세 건을 박아 두어 화면의 생성·수정·삭제가 재시작과 함께 사라졌다.

func NewPostgresCICDGoldenPathRepository added in v0.6.0

func NewPostgresCICDGoldenPathRepository(pool *pgxpool.Pool) *PostgresCICDGoldenPathRepository

func (*PostgresCICDGoldenPathRepository) Create added in v0.6.0

Create 는 새 골든패스를 넣는다. 같은 ID 가 있으면 덮어쓰지 않고 domain.ErrGoldenPathAlreadyExists 를 돌려준다. 순서는 맨 뒤에 붙인다 — 기본 세 건 사이에 끼어들면 설치 안내 순서가 흐트러진다.

func (*PostgresCICDGoldenPathRepository) Delete added in v0.6.0

func (*PostgresCICDGoldenPathRepository) GetByID added in v0.6.0

func (*PostgresCICDGoldenPathRepository) List added in v0.6.0

List 는 카드가 놓이는 순서(sort_order)대로 돌려준다. 맵을 돌던 종전 구현은 요청마다 순서가 바뀌어 고른 카드를 다시 찾기 어려웠다.

func (*PostgresCICDGoldenPathRepository) Update added in v0.6.0

Update 는 기존 골든패스를 덮어쓴다. 없으면 만들지 않고 domain.ErrGoldenPathNotFound 를 돌려준다. sort_order 는 건드리지 않는다 — 내용을 고쳤다고 카드 위치가 바뀌면 안 된다.

type PostgresCICDTemplateRepository

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

func NewPostgresCICDTemplateRepository

func NewPostgresCICDTemplateRepository(pool *pgxpool.Pool) *PostgresCICDTemplateRepository

func (*PostgresCICDTemplateRepository) Create

Create 는 새 템플릿을 넣는다. 같은 ID 가 있으면 덮어쓰지 않고 domain.ErrTemplateAlreadyExists 를 돌려준다.

func (*PostgresCICDTemplateRepository) Delete

Delete 는 템플릿을 지운다. 없으면 domain.ErrTemplateNotFound 다.

func (*PostgresCICDTemplateRepository) GetByID

func (*PostgresCICDTemplateRepository) List

func (*PostgresCICDTemplateRepository) Update

Update 는 ID 가 같은 템플릿의 모든 열을 바꾼다. 없으면 domain.ErrTemplateNotFound 다.

type PostgresClusterTargetProvider

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

func NewPostgresClusterTargetProvider

func NewPostgresClusterTargetProvider(pool *pgxpool.Pool, encryptionKey []byte) *PostgresClusterTargetProvider

func (*PostgresClusterTargetProvider) GetTarget

func (p *PostgresClusterTargetProvider) GetTarget(ctx context.Context, clusterID string) (*port.ClusterTarget, error)

type PostgresDependencyScanResultRepository added in v0.6.0

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

PostgresDependencyScanResultRepository 는 port.DependencyScanResultRepository 의 pgx 구현이다.

func NewPostgresDependencyScanResultRepository added in v0.6.0

func NewPostgresDependencyScanResultRepository(pool *pgxpool.Pool) *PostgresDependencyScanResultRepository

NewPostgresDependencyScanResultRepository 는 저장소를 만든다.

func (*PostgresDependencyScanResultRepository) Delete added in v0.6.0

Delete 는 기록을 지운다. 없으면 아무 일도 하지 않는다.

func (*PostgresDependencyScanResultRepository) ListByPipelineID added in v0.6.0

ListByPipelineID 는 최신 결과부터 돌려준다.

func (*PostgresDependencyScanResultRepository) Upsert added in v0.6.0

Upsert 는 같은 ID 면 덮어쓴다. 건수·검사 대상 수는 모르면 NULL 이다 — 0 은 "취약점 0건"·"대상 없음" 으로 읽힌다.

type PostgresDeploymentRepository

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

func NewPostgresDeploymentRepository

func NewPostgresDeploymentRepository(pool *pgxpool.Pool) *PostgresDeploymentRepository

func (*PostgresDeploymentRepository) Create

func (*PostgresDeploymentRepository) Delete added in v0.6.0

Delete 는 기록 하나를 지운다. 없으면 오류가 아니다 — 동기화가 실행이 아닌 것(SKIPPED 파이프라인)을 예전에 실패로 남긴 기록을 거둘 때 쓴다.

func (*PostgresDeploymentRepository) GetByID

func (*PostgresDeploymentRepository) ListByPipelineID

func (r *PostgresDeploymentRepository) ListByPipelineID(ctx context.Context, pipelineID string) ([]*domain.Deployment, error)

func (*PostgresDeploymentRepository) Update

type PostgresImageScanResultRepository added in v0.6.0

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

PostgresImageScanResultRepository 는 port.ImageScanResultRepository 의 pgx 구현이다.

func NewPostgresImageScanResultRepository added in v0.6.0

func NewPostgresImageScanResultRepository(pool *pgxpool.Pool) *PostgresImageScanResultRepository

NewPostgresImageScanResultRepository 는 저장소를 만든다.

func (*PostgresImageScanResultRepository) Delete added in v0.6.0

Delete 는 기록을 지운다. 없으면 아무 일도 하지 않는다.

func (*PostgresImageScanResultRepository) GetByID added in v0.6.0

GetByID 는 결과 하나다. 없으면 nil, nil 이다.

func (*PostgresImageScanResultRepository) ListByPipelineID added in v0.6.0

func (r *PostgresImageScanResultRepository) ListByPipelineID(ctx context.Context, pipelineID string) ([]*domain.ImageScanResult, error)

ListByPipelineID 는 최신 결과부터 돌려준다.

func (*PostgresImageScanResultRepository) Upsert added in v0.6.0

Upsert 는 같은 ID 면 덮어쓴다. 같은 실행을 여러 번 동기화해도 기록이 늘지 않는다.

건수는 Counts 가 nil 이면 NULL 로 둔다 — 0 은 "취약점 0건" 으로 읽힌다.

type PostgresPipelineRepository

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

PostgresPipelineRepository implements port.PipelineRepository using pgx.

func NewPostgresPipelineRepository

func NewPostgresPipelineRepository(pool *pgxpool.Pool) *PostgresPipelineRepository

NewPostgresPipelineRepository constructs a PostgresPipelineRepository.

func (*PostgresPipelineRepository) Create

Create inserts a new pipeline record.

func (*PostgresPipelineRepository) Delete

Delete removes a pipeline by ID. Cascades to pipeline_deployments via FK.

func (*PostgresPipelineRepository) GetByID

GetByID retrieves a pipeline by its ID.

func (*PostgresPipelineRepository) List

List returns all pipelines belonging to an organization.

func (*PostgresPipelineRepository) ListByStackID

func (r *PostgresPipelineRepository) ListByStackID(ctx context.Context, stackID string) ([]*domain.Pipeline, error)

func (*PostgresPipelineRepository) ListWithStack added in v0.6.0

func (r *PostgresPipelineRepository) ListWithStack(ctx context.Context) ([]*domain.Pipeline, error)

ListWithStack 은 스택에 묶인 파이프라인을 조직과 무관하게 돌려준다(주기 동기화용).

func (*PostgresPipelineRepository) OtherPipelinesNamed added in v0.6.0

func (r *PostgresPipelineRepository) OtherPipelinesNamed(ctx context.Context, stackID, name, excludeID string) ([]string, error)

OtherPipelinesNamed 는 같은 스택에서 같은 이름을 쓰는 다른 파이프라인의 ID 를 모두 돌려준다. 개수를 자르지 않는다 — 하나라도 놓치면 그 파이프라인이 쓰는 자격증명을 지운다.

func (*PostgresPipelineRepository) Update

Update persists changes to an existing pipeline.

type PostgresPipelineSecurityReader added in v0.6.0

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

PostgresPipelineSecurityReader 는 port.PipelineSecurityReader 의 pgx 구현이다.

보안 대시보드(#65)가 조직의 앱 전체를 한 번에 본다. 파이프라인마다 네 결과를 따로 물으면 질의 수가 앱 수에 비례하므로, 결과 종류마다 한 번씩 "파이프라인별 최신 한 행"(DISTINCT ON)을 읽어 붙인다. 각 결과 테이블의 (pipeline_id, scanned_at DESC) 인덱스를 그대로 탄다. 대시보드용 테이블은 두지 않는다.

func NewPostgresPipelineSecurityReader added in v0.6.0

func NewPostgresPipelineSecurityReader(pool *pgxpool.Pool) *PostgresPipelineSecurityReader

NewPostgresPipelineSecurityReader 는 읽기 저장소를 만든다.

func (*PostgresPipelineSecurityReader) ListPipelineSecurity added in v0.6.0

func (r *PostgresPipelineSecurityReader) ListPipelineSecurity(ctx context.Context, orgID string, limit int) ([]*domain.PipelineSecuritySnapshot, error)

ListPipelineSecurity 는 조직의 파이프라인을 최근 만든 것부터 최대 limit 개, 단계별 최신 결과와 함께 돌려준다.

type PostgresSASTResultRepository added in v0.6.0

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

PostgresSASTResultRepository 는 port.SASTResultRepository 의 pgx 구현이다.

func NewPostgresSASTResultRepository added in v0.6.0

func NewPostgresSASTResultRepository(pool *pgxpool.Pool) *PostgresSASTResultRepository

NewPostgresSASTResultRepository 는 저장소를 만든다.

func (*PostgresSASTResultRepository) ListByPipelineID added in v0.6.0

func (r *PostgresSASTResultRepository) ListByPipelineID(ctx context.Context, pipelineID string) ([]*domain.SASTResult, error)

ListByPipelineID 는 최신 분석부터 돌려준다.

func (*PostgresSASTResultRepository) Upsert added in v0.6.0

Upsert 는 같은 ID 면 덮어쓴다. 지표는 Metrics 가 nil 이거나 그 지표가 없으면 NULL 이다.

type PostgresSCMConnectionReader

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

PostgresSCMConnectionReader 는 port.SCMConnectionReader 를 token_sources 테이블로 구현한다.

외부 SCM 은 토큰과 접속 정보가 한 벌로 묶여야 의미가 있다 — 토큰만 있고 organization 을 모르면 어디에 리포를 만들지 알 수 없다. 그래서 관리자가 토큰을 등록하는 곳(token_sources)의 metadata 에 함께 둔다.

admin 모듈이 소유한 테이블을 직접 읽는다. Modular Monolith 안에서는 허용되는 절충이며, 읽기 전용 포트로 좁혀 두었으므로 마이크로서비스로 쪼갤 때는 이 구현만 HTTP 클라이언트로 바꾸면 된다.

func NewPostgresSCMConnectionReader

func NewPostgresSCMConnectionReader(pool *pgxpool.Pool) *PostgresSCMConnectionReader

NewPostgresSCMConnectionReader 는 리더를 만든다.

func (*PostgresSCMConnectionReader) GetConnection

func (r *PostgresSCMConnectionReader) GetConnection(
	ctx context.Context,
	orgID string,
	platform port.SCMPlatform,
) (*port.SCMConnection, error)

GetConnection 은 조직에 등록된 SCM 연동 설정을 읽는다.

등록된 것이 없으면 nil, nil 이다 — 호출부가 "무엇을 등록해야 하는지" 안내를 띄울 수 있게 오류와 구분한다.

type PostgresScanPolicyRepository added in v0.6.0

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

PostgresScanPolicyRepository 는 port.ScanPolicyRepository 의 pgx 구현이다.

func NewPostgresScanPolicyRepository added in v0.6.0

func NewPostgresScanPolicyRepository(pool *pgxpool.Pool) *PostgresScanPolicyRepository

NewPostgresScanPolicyRepository 는 저장소를 만든다.

func (*PostgresScanPolicyRepository) Get added in v0.6.0

Get 은 저장된 정책이다. 저장한 적 없으면 found=false 다.

func (*PostgresScanPolicyRepository) Upsert added in v0.6.0

func (r *PostgresScanPolicyRepository) Upsert(
	ctx context.Context,
	stackID string,
	policy domain.ScanPolicy,
	updatedBy string,
) error

Upsert 는 스택의 정책을 저장하거나 덮어쓴다.

type PostgresSecretScanResultRepository added in v0.6.0

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

PostgresSecretScanResultRepository 는 port.SecretScanResultRepository 의 pgx 구현이다.

func NewPostgresSecretScanResultRepository added in v0.6.0

func NewPostgresSecretScanResultRepository(pool *pgxpool.Pool) *PostgresSecretScanResultRepository

NewPostgresSecretScanResultRepository 는 저장소를 만든다.

func (*PostgresSecretScanResultRepository) Delete added in v0.6.0

Delete 는 기록을 지운다. 없으면 아무 일도 하지 않는다.

func (*PostgresSecretScanResultRepository) ListByPipelineID added in v0.6.0

func (r *PostgresSecretScanResultRepository) ListByPipelineID(ctx context.Context, pipelineID string) ([]*domain.SecretScanResult, error)

ListByPipelineID 는 최신 결과부터 돌려준다.

func (*PostgresSecretScanResultRepository) Upsert added in v0.6.0

Upsert 는 같은 ID 면 덮어쓴다. 탐지 건수는 모르면 NULL 이다 — 0 은 "탐지 없음" 으로 읽힌다.

탐지 위치는 상한(domain.MaxStoredSecretFindings)까지만 둔다. 동기화가 이미 자르지만 저장소도 지킨다 — 다른 경로가 생겨도 행이 커지지 않는다.

type PostgresStackReader

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

PostgresStackReader implements port.StackReader by querying the stacks table directly. This is acceptable within a Modular Monolith since both modules share the same database. When splitting into microservices, replace this with an HTTP/gRPC client calling the Stack service.

func NewPostgresStackReader

func NewPostgresStackReader(pool *pgxpool.Pool) *PostgresStackReader

NewPostgresStackReader constructs a PostgresStackReader.

func (*PostgresStackReader) GetStackSummary

func (r *PostgresStackReader) GetStackSummary(ctx context.Context, stackID string) (*port.StackSummary, error)

GetStackSummary retrieves minimal stack information by ID. Returns nil and no error if the stack does not exist.

Jump to

Keyboard shortcuts

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