Files
archie/internal/domain/storecontract/source.go
T
sam 443a7a501b refactor(storecontract): split the store contract into topical files (#1781)
Pure move: one 624-line storecontract.go becomes storecontract.go
(package doc + composed TaskStore), task.go, capture.go, binding.go,
mapping.go, source.go, status.go, resource.go, credentials.go and
errors.go. The package remains the single seam; no declaration changed
(verified line-identical against HEAD). task check green.
2026-11-03 02:27:57 +11:00

24 lines
946 B
Go

package storecontract
import (
"context"
"github.com/samcharles93/archie-core/internal/domain/source"
)
// SourceStore persists capture sources keyed by path. Secrets are encrypted
// at rest; signing transitions use an expected-from guard.
type SourceStore interface {
InsertSource(ctx context.Context, s source.Source) error
// GetSource returns (nil, nil) for an unknown path.
GetSource(ctx context.Context, path string) (*source.Source, error)
ListSources(ctx context.Context) ([]source.Source, error)
SetSourceSigning(ctx context.Context, path string, from, to source.Signing) error
SetSourceSecret(ctx context.Context, path, secret string) error
SetSourceName(ctx context.Context, path, name string) error
SetSourceDeliveryHeader(ctx context.Context, path, header string) error
// DeleteSource refuses with ErrSourceInUse while an armed binding fires
// on the source.
DeleteSource(ctx context.Context, path string) error
}