Documentation
¶
Overview ¶
Package release owns the local durable boundary for release idempotency, audit records, protected version snapshots, and rollback previews.
Index ¶
- Variables
- func NewID() string
- type AuditState
- type Release
- type RollbackPreview
- type Store
- func (s *Store) Get(id string) (Release, bool, error)
- func (s *Store) InvalidatePreview(id, reason string) error
- func (s *Store) List(environmentID string, limit int, cursor string) ([]Release, error)
- func (s *Store) Lookup(environmentID, key, digest string) (string, bool, error)
- func (s *Store) LookupAction(environmentID, action, key, digest string) (string, bool, error)
- func (s *Store) Preview(environmentID, targetID string) (RollbackPreview, error)
- func (s *Store) PreviewByID(id string) (RollbackPreview, error)
- func (s *Store) Reserve(environmentID, key, digest, operationID string) (string, error)
- func (s *Store) ReserveAction(environmentID, action, key, digest, operationID string) (string, error)
- func (s *Store) Save(value Release) error
- func (s *Store) SavePreview(value RollbackPreview) error
- func (s *Store) SaveWithTemplate(value Release, template []byte) error
- func (s *Store) Template(id string) ([]byte, error)
Constants ¶
This section is empty.
Variables ¶
View Source
var ErrCorrupt = errors.New("release audit store is corrupt")
View Source
var ErrIdempotencyConflict = errors.New("idempotency key conflicts with a different request")
View Source
var ErrNotFound = errors.New("release not found")
View Source
var ErrPreviewNotFound = errors.New("rollback preview not found")
Functions ¶
Types ¶
type AuditState ¶
type Release ¶
type Release struct {
ReleaseID string `json:"release_id"`
EnvironmentID string `json:"environment_id"`
Kind string `json:"kind"`
Outcome string `json:"outcome"`
CreatedAt time.Time `json:"created_at"`
CompletedAt time.Time `json:"completed_at"`
OperationID string `json:"operation_id"`
RemoteState string `json:"remote_state"`
SemanticSummary string `json:"semantic_summary"`
RiskSummary string `json:"risk_summary"`
PlanID string `json:"plan_id,omitempty"`
RollbackOfReleaseID string `json:"rollback_of_release_id,omitempty"`
SourceDigest string `json:"source_digest,omitempty"`
PlanDigest string `json:"plan_digest,omitempty"`
RemoteBefore AuditState `json:"remote_before"`
RemoteAfter *AuditState `json:"remote_after,omitempty"`
Failure *operation.Failure `json:"failure,omitempty"`
}
type RollbackPreview ¶
type RollbackPreview struct {
RollbackPreviewID string `json:"rollback_preview_id"`
EnvironmentID string `json:"environment_id"`
TargetReleaseID string `json:"target_release_id"`
TargetRemoteVersion string `json:"target_remote_version"`
Status string `json:"status"`
ExpectedRemoteETag string `json:"expected_remote_etag"`
CreatedAt time.Time `json:"created_at"`
ExpiresAt time.Time `json:"expires_at"`
InvalidationReason string `json:"invalidation_reason,omitempty"`
CurrentRemote AuditState `json:"current_remote"`
SemanticChanges json.RawMessage `json:"semantic_changes"`
RemoteParameterChanges json.RawMessage `json:"remote_parameter_changes"`
Severity string `json:"severity"`
RiskItems json.RawMessage `json:"risk_items"`
BlockingReasons json.RawMessage `json:"blocking_reasons"`
ConfirmationRequirements json.RawMessage `json:"confirmation_requirements"`
}
RollbackPreview is the durable immutable read model consumed by the rollback confirmation endpoint. Its target template is held separately in disk.PrivateTemplates and is never included here.
type Store ¶
type Store struct {
// contains filtered or unexported fields
}
func (*Store) InvalidatePreview ¶
func (*Store) LookupAction ¶
func (*Store) Preview ¶
func (s *Store) Preview(environmentID, targetID string) (RollbackPreview, error)
func (*Store) PreviewByID ¶
func (s *Store) PreviewByID(id string) (RollbackPreview, error)
func (*Store) Reserve ¶
Reserve maps one environment/action/key to one durable Operation. The caller serializes operation creation with this call, making the mapping atomic at the application boundary without exposing credentials or request bodies.
func (*Store) ReserveAction ¶
func (*Store) SavePreview ¶
func (s *Store) SavePreview(value RollbackPreview) error
func (*Store) SaveWithTemplate ¶
Click to show internal directories.
Click to hide internal directories.