Documentation
¶
Overview ¶
Package contractplansvc persists portable compilation templates.
Index ¶
- Variables
- type ContractPin
- type ContractResolver
- type DataSourceRefResolver
- type OperationIdentity
- type OperationScope
- type ProjectionIdentity
- type Request
- type Service
- func (s *Service) Compile(ctx context.Context, org, project slug.Slug, request Request) (*compiledplans.Snapshot, error)
- func (s *Service) CompileVersion(ctx context.Context, org, project, pipeline slug.Slug, specHash string, ...) (*Summary, error)
- func (s *Service) Get(ctx context.Context, org, project, pipeline slug.Slug, digest string) (*Summary, error)
- func (s *Service) Reload(ctx context.Context, org, project, pipeline slug.Slug, digest string) (*contractplan.Plan, error)
- type Summary
Constants ¶
This section is empty.
Variables ¶
View Source
var ( ErrOperationSource = xerror.New(xerror.KindInvalidInput, "PIPELINE_OPERATION_SOURCE_REQUIRED", "select an environment with bindings for saved-operation compilation") )
Functions ¶
This section is empty.
Types ¶
type ContractPin ¶
type ContractResolver ¶
type ContractResolver interface {
ResolvePipelineContracts(context.Context, slug.Slug, slug.Slug, *pipelinespec.Pipeline) (*pipelinespec.Pipeline, []model.PinnedODCSPort, error)
}
type DataSourceRefResolver ¶
type DataSourceRefResolver interface {
ResolvePipelineDataSourceRefs(context.Context, slug.Slug, slug.Slug, slug.Slug, *pipelinespec.Pipeline) (*datasourcerefssvc.ResolvedPipeline, error)
}
type OperationIdentity ¶
type OperationIdentity struct {
Step, Operation slug.Slug
Role, Revision, Digest string
ResourceScope *resourcescope.Identity
}
type OperationScope ¶
type OperationScope struct {
Step slug.Slug
Role string
Scope resourcescope.Scope
}
type ProjectionIdentity ¶
type Request ¶
type Request struct {
Pipeline *pipelinespec.Pipeline
Source contractplan.Source
Projection *odcs.ProjectionRequest
ResourceScopes []OperationScope
OperationSources map[slug.Slug]slug.Slug
}
type Service ¶
type Service struct {
// contains filtered or unexported fields
}
func New ¶
func New(versions pipelines.Repository, txm postgres.TransactionManager, plans *compiledplans.Repository, operations queries.Repository, contracts odcscontracts.Repository, resolver ContractResolver, dataSourceRefs DataSourceRefResolver) (*Service, error)
func (*Service) Compile ¶
func (s *Service) Compile(ctx context.Context, org, project slug.Slug, request Request) (*compiledplans.Snapshot, error)
Compile explicitly snapshots current authoring inputs once. Recompilation can create another plan for identical authored content without changing old pins.
func (*Service) CompileVersion ¶
func (s *Service) CompileVersion(ctx context.Context, org, project, pipeline slug.Slug, specHash string, environment slug.Slug, projection *odcs.ProjectionRequest, scopes []OperationScope) (*Summary, error)
CompileVersion accepts only a complete retained version identity. Provenance comes from that row, never the mutable current pipeline or a caller's source.
type Summary ¶
type Summary struct {
PipelineSlug slug.Slug
Digest, SpecHash, Status, CompilerID, StructuralPolicyID string
AdmissionEnabled bool
Source contractplan.Source
Pins []ContractPin
Operations []OperationIdentity
Projections []ProjectionIdentity
}
Summary contains identity metadata only, never authored or resolved values.
Click to show internal directories.
Click to hide internal directories.