Documentation
¶
Overview ¶
Package codepipeline provides an in-memory implementation of the AWS CodePipeline service.
Index ¶
- Constants
- Variables
- type Action
- type ActionConfigurationProperty
- type ActionExecution
- type ActionTypeID
- type ActionTypeSettings
- type ArtifactDetails
- type ArtifactRef
- type ArtifactStore
- type Condition
- type CustomActionType
- type EncryptionKey
- type GitBranchFilterCriteria
- type GitConfiguration
- type GitFilePathsFilterCriteria
- type GitPullRequestFilter
- type GitPushFilter
- type GitTagFilterCriteria
- type Handler
- func (h *Handler) ChaosOperations() []string
- func (h *Handler) ChaosRegions() []string
- func (h *Handler) ChaosServiceName() string
- func (h *Handler) ExtractOperation(c *echo.Context) string
- func (h *Handler) ExtractResource(_ *echo.Context) string
- func (h *Handler) GetSupportedOperations() []string
- func (h *Handler) Handler() echo.HandlerFunc
- func (h *Handler) MatchPriority() int
- func (h *Handler) Name() string
- func (h *Handler) Reset()
- func (h *Handler) Restore(ctx context.Context, data []byte) error
- func (h *Handler) RouteMatcher() service.Matcher
- func (h *Handler) Snapshot(ctx context.Context) []byte
- type InMemoryBackend
- func (b *InMemoryBackend) AcknowledgeJob(ctx context.Context, jobID, nonce string) (string, error)
- func (b *InMemoryBackend) AcknowledgeThirdPartyJob(ctx context.Context, jobID, nonce, clientToken string) (string, error)
- func (b *InMemoryBackend) AddCustomActionTypeInternal(cat *CustomActionType)
- func (b *InMemoryBackend) AddJobInternal(job *Job)
- func (b *InMemoryBackend) AddPipelineInternal(decl PipelineDeclaration, tags map[string]string) *Pipeline
- func (b *InMemoryBackend) AddWebhookInternal(wh *Webhook)
- func (b *InMemoryBackend) CreateCustomActionType(ctx context.Context, cat *CustomActionType) (*CustomActionType, error)
- func (b *InMemoryBackend) CreatePipeline(ctx context.Context, decl PipelineDeclaration, tags map[string]string) (*Pipeline, error)
- func (b *InMemoryBackend) DeleteCustomActionType(ctx context.Context, category, provider, version string) error
- func (b *InMemoryBackend) DeletePipeline(ctx context.Context, name string) error
- func (b *InMemoryBackend) DeleteWebhook(ctx context.Context, name string) error
- func (b *InMemoryBackend) DeregisterWebhookWithThirdParty(ctx context.Context, name string) error
- func (b *InMemoryBackend) DisableStageTransition(ctx context.Context, pipelineName, stageName, transitionType, reason string) error
- func (b *InMemoryBackend) EnableStageTransition(ctx context.Context, pipelineName, stageName, transitionType string) error
- func (b *InMemoryBackend) GetActionType(ctx context.Context, category, owner, provider, version string) (*CustomActionType, error)
- func (b *InMemoryBackend) GetJobDetails(ctx context.Context, jobID string) (*Job, error)
- func (b *InMemoryBackend) GetPipeline(ctx context.Context, name string) (*Pipeline, error)
- func (b *InMemoryBackend) GetPipelineExecution(ctx context.Context, pipelineName, executionID string) (*PipelineExecution, error)
- func (b *InMemoryBackend) GetPipelineState(ctx context.Context, pipelineName string) ([]StageState, error)
- func (b *InMemoryBackend) GetStageTransitionState(ctx context.Context, pipelineName, stageName, transitionType string) *StageTransitionState
- func (b *InMemoryBackend) GetThirdPartyJobDetails(ctx context.Context, jobID, clientToken string) (*Job, error)
- func (b *InMemoryBackend) ListActionExecutions(ctx context.Context, pipelineName, pipelineExecutionID string) ([]map[string]any, error)
- func (b *InMemoryBackend) ListActionTypes(ctx context.Context) []*CustomActionType
- func (b *InMemoryBackend) ListDeployActionExecutionTargets(ctx context.Context, pipelineName, executionID string) ([]map[string]any, error)
- func (b *InMemoryBackend) ListPipelineExecutions(ctx context.Context, pipelineName string) ([]PipelineExecution, error)
- func (b *InMemoryBackend) ListPipelines(ctx context.Context) []PipelineSummary
- func (b *InMemoryBackend) ListRuleExecutions(ctx context.Context, pipelineName string) ([]map[string]any, error)
- func (b *InMemoryBackend) ListRuleTypes() []map[string]any
- func (b *InMemoryBackend) ListTagsForResource(ctx context.Context, resourceARN string) ([]Tag, error)
- func (b *InMemoryBackend) ListWebhooks(ctx context.Context) []*Webhook
- func (b *InMemoryBackend) OverrideStageCondition(ctx context.Context, pipelineName, stageName, executionID string) error
- func (b *InMemoryBackend) PollForJobs(ctx context.Context, category, owner, provider, version string) ([]*Job, error)
- func (b *InMemoryBackend) PollForThirdPartyJobs(ctx context.Context, category, provider, version string) ([]*Job, error)
- func (b *InMemoryBackend) PutActionRevision(ctx context.Context, pipelineName, stageName, actionName string) error
- func (b *InMemoryBackend) PutApprovalResult(ctx context.Context, ...) error
- func (b *InMemoryBackend) PutJobFailureResult(ctx context.Context, jobID, message string) error
- func (b *InMemoryBackend) PutJobSuccessResult(ctx context.Context, jobID string) error
- func (b *InMemoryBackend) PutThirdPartyJobFailureResult(ctx context.Context, jobID, _, message string) error
- func (b *InMemoryBackend) PutThirdPartyJobSuccessResult(ctx context.Context, jobID, _ string) error
- func (b *InMemoryBackend) PutWebhook(ctx context.Context, wh *Webhook) (*Webhook, error)
- func (b *InMemoryBackend) Region() string
- func (b *InMemoryBackend) RegisterWebhookWithThirdParty(ctx context.Context, name string) error
- func (b *InMemoryBackend) Reset()
- func (b *InMemoryBackend) Restore(ctx context.Context, data []byte) error
- func (b *InMemoryBackend) RetryStageExecution(ctx context.Context, pipelineName, stageName, executionID string) (*PipelineExecution, error)
- func (b *InMemoryBackend) RollbackStage(ctx context.Context, pipelineName, stageName, targetExecutionID string) (*PipelineExecution, error)
- func (b *InMemoryBackend) Snapshot(ctx context.Context) []byte
- func (b *InMemoryBackend) StartPipelineExecution(ctx context.Context, pipelineName string) (*PipelineExecution, error)
- func (b *InMemoryBackend) StopPipelineExecution(ctx context.Context, pipelineName, executionID, reason string, abandon bool) (*PipelineExecution, error)
- func (b *InMemoryBackend) TagResource(ctx context.Context, resourceARN string, tags []Tag) error
- func (b *InMemoryBackend) UntagResource(ctx context.Context, resourceARN string, tagKeys []string) error
- func (b *InMemoryBackend) UpdateActionType(ctx context.Context, cat *CustomActionType) error
- func (b *InMemoryBackend) UpdatePipeline(ctx context.Context, decl PipelineDeclaration) (*Pipeline, error)
- type Job
- type Pipeline
- type PipelineDeclaration
- type PipelineExecution
- type PipelineMetadata
- type PipelineSummary
- type PipelineVariable
- type Provider
- type Rule
- type Stage
- type StageState
- type StageTransitionState
- type Tag
- type Trigger
- type Webhook
- type WebhookAuthConfig
- type WebhookFilter
Constants ¶
const ( // PipelineTypeV1 and PipelineTypeV2 are the valid PipelineType values. PipelineTypeV1 = "V1" PipelineTypeV2 = "V2" // ExecutionModeQueued is the QUEUED execution mode. ExecutionModeQueued = "QUEUED" // ExecutionModeSuperseded is the SUPERSEDED execution mode. ExecutionModeSuperseded = "SUPERSEDED" // ExecutionModeParallel is the PARALLEL execution mode. ExecutionModeParallel = "PARALLEL" // WebhookAuthGitHubHMAC is the GITHUB_HMAC authentication type for webhooks. WebhookAuthGitHubHMAC = "GITHUB_HMAC" // WebhookAuthIP is the IP authentication type for webhooks. WebhookAuthIP = "IP" // WebhookAuthUnauthenticated is the UNAUTHENTICATED authentication type for webhooks. WebhookAuthUnauthenticated = "UNAUTHENTICATED" )
Variables ¶
var ( // ErrNotFound is returned when a pipeline resource does not exist. ErrNotFound = awserr.New("PipelineNotFoundException", awserr.ErrNotFound) // ErrPipelineNameInUse is returned when a pipeline with the same name already exists. ErrPipelineNameInUse = awserr.New("PipelineNameInUseException", awserr.ErrAlreadyExists) // ErrAlreadyExists is returned when a non-pipeline resource with the same key already exists. ErrAlreadyExists = awserr.New("InvalidStructureException", awserr.ErrAlreadyExists) // ErrActionTypeNotFound is returned when a requested custom action type does not exist. ErrActionTypeNotFound = awserr.New("ActionTypeNotFoundException", awserr.ErrNotFound) // ErrJobNotFound is returned when a requested job does not exist. ErrJobNotFound = awserr.New("JobNotFoundException", awserr.ErrNotFound) // ErrWebhookNotFound is returned when a requested webhook does not exist. ErrWebhookNotFound = awserr.New("WebhookNotFoundException", awserr.ErrNotFound) // ErrValidation is returned when request input fails validation. ErrValidation = awserr.New("ValidationException", awserr.ErrInvalidParameter) // ErrConflict is returned on optimistic-concurrency version mismatch. ErrConflict = awserr.New("ConflictException", awserr.ErrConflict) // ErrResourceInUse is returned when a resource is referenced by another resource. ErrResourceInUse = awserr.New("ResourceInUseException", awserr.ErrAlreadyExists) // ErrResourceNotFound is returned for non-pipeline ARNs (e.g. webhook ARNs). ErrResourceNotFound = awserr.New("ResourceNotFoundException", awserr.ErrNotFound) // ErrStageNotFound is returned when a stage name does not exist in a pipeline. ErrStageNotFound = awserr.New("StageNotFoundException", awserr.ErrNotFound) // ErrInvalidStructure is returned for structural pipeline validation errors. ErrInvalidStructure = awserr.New("InvalidStructureException", awserr.ErrInvalidParameter) // ErrExecutionNotFound is returned when a requested pipeline execution ID does not exist. ErrExecutionNotFound = awserr.New("PipelineExecutionNotFoundException", awserr.ErrNotFound) // ErrVersionNotFound is returned when a requested pipeline version does not exist. ErrVersionNotFound = awserr.New("PipelineVersionNotFoundException", awserr.ErrNotFound) )
var ErrNilAppContext = errors.New("AppContext is required")
ErrNilAppContext is returned when Provider.Init is called with a nil AppContext.
Functions ¶
This section is empty.
Types ¶
type Action ¶
type Action struct {
Configuration map[string]string `json:"configuration,omitempty"`
ActionTypeID ActionTypeID `json:"actionTypeId"`
Name string `json:"name"`
RoleArn string `json:"roleArn,omitempty"`
Region string `json:"region,omitempty"`
Namespace string `json:"namespace,omitempty"`
InputArtifacts []ArtifactRef `json:"inputArtifacts,omitempty"`
OutputArtifacts []ArtifactRef `json:"outputArtifacts,omitempty"`
RunOrder int `json:"runOrder,omitempty"`
TimeoutInMinutes int `json:"timeoutInMinutes,omitempty"`
}
Action represents a single action within a pipeline stage.
type ActionConfigurationProperty ¶
type ActionConfigurationProperty struct {
Description string `json:"description,omitempty"`
Name string `json:"name"`
Type string `json:"type,omitempty"`
Key bool `json:"key"`
Queryable bool `json:"queryable,omitempty"`
Required bool `json:"required"`
Secret bool `json:"secret"`
}
ActionConfigurationProperty represents a property in a custom action type's configuration.
type ActionExecution ¶
type ActionExecution struct {
StartTime time.Time `json:"startTime"`
LastUpdateTime time.Time `json:"lastUpdateTime"`
PipelineExecutionID string `json:"pipelineExecutionId"`
ActionExecutionID string `json:"actionExecutionId"`
StageName string `json:"stageName"`
ActionName string `json:"actionName"`
Status string `json:"status"`
}
ActionExecution records a single action's execution within a pipeline run.
type ActionTypeID ¶
type ActionTypeID struct {
Category string `json:"category"`
Owner string `json:"owner"`
Provider string `json:"provider"`
Version string `json:"version"`
}
ActionTypeID represents the identifier for an action type.
type ActionTypeSettings ¶
type ActionTypeSettings struct {
EntityURLTemplate string `json:"entityUrlTemplate,omitempty"`
ExecutionURLTemplate string `json:"executionUrlTemplate,omitempty"`
RevisionURLTemplate string `json:"revisionUrlTemplate,omitempty"`
ThirdPartyConfigurationURL string `json:"thirdPartyConfigurationUrl,omitempty"`
}
ActionTypeSettings represents the URLs for a custom action type.
type ArtifactDetails ¶
type ArtifactDetails struct {
MinimumCount int `json:"minimumCount"`
MaximumCount int `json:"maximumCount"`
}
ArtifactDetails represents min/max artifact counts for a custom action type.
type ArtifactRef ¶
type ArtifactRef struct {
Name string `json:"name"`
}
ArtifactRef represents a reference to an artifact.
type ArtifactStore ¶
type ArtifactStore struct {
EncryptionKey *EncryptionKey `json:"encryptionKey,omitempty"`
Type string `json:"type"`
Location string `json:"location"`
}
ArtifactStore represents the artifact store for a pipeline stage.
type Condition ¶
type Condition struct {
Result string `json:"result,omitempty"`
Rules []Rule `json:"rules,omitempty"`
}
Condition represents a set of rules that control stage entry or exit.
type CustomActionType ¶
type CustomActionType struct {
Settings *ActionTypeSettings `json:"settings,omitempty"`
Tags map[string]string `json:"-"`
Category string `json:"category"`
Owner string `json:"owner"`
Provider string `json:"provider"`
Version string `json:"version"`
ConfigurationProperties []ActionConfigurationProperty `json:"configurationProperties,omitempty"`
InputArtifactDetails ArtifactDetails `json:"inputArtifactDetails"`
OutputArtifactDetails ArtifactDetails `json:"outputArtifactDetails"`
// contains filtered or unexported fields
}
CustomActionType represents an in-memory custom action type.
type EncryptionKey ¶
EncryptionKey represents a KMS or custom encryption key for an artifact store.
type GitBranchFilterCriteria ¶
type GitBranchFilterCriteria struct {
Includes []string `json:"includes,omitempty"`
Excludes []string `json:"excludes,omitempty"`
}
GitBranchFilterCriteria is the include/exclude filter for branch names.
type GitConfiguration ¶
type GitConfiguration struct {
SourceActionName string `json:"sourceActionName"`
Push []GitPushFilter `json:"push,omitempty"`
PullRequest []GitPullRequestFilter `json:"pullRequest,omitempty"`
}
GitConfiguration holds the source action name and push/PR trigger filters.
type GitFilePathsFilterCriteria ¶
type GitFilePathsFilterCriteria struct {
Includes []string `json:"includes,omitempty"`
Excludes []string `json:"excludes,omitempty"`
}
GitFilePathsFilterCriteria is the include/exclude filter for file paths.
type GitPullRequestFilter ¶
type GitPullRequestFilter struct {
Branches *GitBranchFilterCriteria `json:"branches,omitempty"`
FilePaths *GitFilePathsFilterCriteria `json:"filePaths,omitempty"`
Events []string `json:"events,omitempty"`
}
GitPullRequestFilter describes what pull request events trigger the pipeline.
type GitPushFilter ¶
type GitPushFilter struct {
Branches *GitBranchFilterCriteria `json:"branches,omitempty"`
Tags *GitTagFilterCriteria `json:"tags,omitempty"`
FilePaths *GitFilePathsFilterCriteria `json:"filePaths,omitempty"`
}
GitPushFilter describes what git push events trigger the pipeline.
type GitTagFilterCriteria ¶
type GitTagFilterCriteria struct {
Includes []string `json:"includes,omitempty"`
Excludes []string `json:"excludes,omitempty"`
}
GitTagFilterCriteria is the include/exclude filter for git tags.
type Handler ¶
type Handler struct {
Backend *InMemoryBackend
// contains filtered or unexported fields
}
Handler is the Echo HTTP handler for CodePipeline operations.
func NewHandler ¶
func NewHandler(backend *InMemoryBackend) *Handler
NewHandler creates a new CodePipeline handler backed by backend.
func (*Handler) ChaosOperations ¶
ChaosOperations returns all operations that can be fault-injected.
func (*Handler) ChaosRegions ¶
ChaosRegions returns all regions this handler instance handles.
func (*Handler) ChaosServiceName ¶
ChaosServiceName returns the lowercase AWS service name for fault rule matching.
func (*Handler) ExtractOperation ¶
ExtractOperation extracts the CodePipeline action from the X-Amz-Target header.
func (*Handler) ExtractResource ¶
ExtractResource extracts the resource identifier from the request (not used for CodePipeline).
func (*Handler) GetSupportedOperations ¶
GetSupportedOperations returns the list of supported operations.
func (*Handler) Handler ¶
func (h *Handler) Handler() echo.HandlerFunc
Handler returns the Echo handler function for CodePipeline requests.
func (*Handler) MatchPriority ¶
MatchPriority returns the routing priority.
func (*Handler) RouteMatcher ¶
RouteMatcher returns a function that matches CodePipeline requests.
type InMemoryBackend ¶
type InMemoryBackend struct {
// contains filtered or unexported fields
}
InMemoryBackend is a thread-safe in-memory store for CodePipeline resources.
pipelines, customActionTypes, jobs, webhooks, and stageTransitions are flat store.Table collections keyed by a composite "region|id" string (see regionKey below), replacing the old map[string]map[K]*V nesting (outer key = region) that isolated same-named resources across regions. Each table's companion *store.Index values replace the old per-region iteration/reverse-ARN-map lookups -- see store_setup.go. executions and actionExecutions remain plain region-nested maps: their values are bare []*T slices with no identity of their own, so they are not candidates for store.Table (see pkgs/store's package doc). Callers must hold b.mu while accessing any of these collections.
func NewInMemoryBackend ¶
func NewInMemoryBackend(accountID, region string) *InMemoryBackend
NewInMemoryBackend creates a new backend for the given account and region.
func (*InMemoryBackend) AcknowledgeJob ¶
AcknowledgeJob acknowledges that a job worker has received a job. Returns InProgress if Nonce matches; otherwise returns current status unchanged.
func (*InMemoryBackend) AcknowledgeThirdPartyJob ¶
func (b *InMemoryBackend) AcknowledgeThirdPartyJob( ctx context.Context, jobID, nonce, clientToken string, ) (string, error)
AcknowledgeThirdPartyJob acknowledges that a third-party job worker has received a job.
func (*InMemoryBackend) AddCustomActionTypeInternal ¶
func (b *InMemoryBackend) AddCustomActionTypeInternal(cat *CustomActionType)
AddCustomActionTypeInternal seeds a custom action type into the backend's default region (for testing).
func (*InMemoryBackend) AddJobInternal ¶
func (b *InMemoryBackend) AddJobInternal(job *Job)
AddJobInternal seeds a job into the backend's default region (for testing).
func (*InMemoryBackend) AddPipelineInternal ¶
func (b *InMemoryBackend) AddPipelineInternal(decl PipelineDeclaration, tags map[string]string) *Pipeline
AddPipelineInternal seeds a pipeline directly into the backend's default region (for testing).
func (*InMemoryBackend) AddWebhookInternal ¶
func (b *InMemoryBackend) AddWebhookInternal(wh *Webhook)
AddWebhookInternal seeds a webhook into the backend's default region (for testing).
func (*InMemoryBackend) CreateCustomActionType ¶
func (b *InMemoryBackend) CreateCustomActionType( ctx context.Context, cat *CustomActionType, ) (*CustomActionType, error)
CreateCustomActionType stores a new custom action type.
func (*InMemoryBackend) CreatePipeline ¶
func (b *InMemoryBackend) CreatePipeline( ctx context.Context, decl PipelineDeclaration, tags map[string]string, ) (*Pipeline, error)
CreatePipeline creates a new CodePipeline pipeline.
func (*InMemoryBackend) DeleteCustomActionType ¶
func (b *InMemoryBackend) DeleteCustomActionType(ctx context.Context, category, provider, version string) error
DeleteCustomActionType removes a custom action type. Returns ResourceInUseException if any pipeline references the type.
func (*InMemoryBackend) DeletePipeline ¶
func (b *InMemoryBackend) DeletePipeline(ctx context.Context, name string) error
DeletePipeline removes the pipeline with the given name and cleans up associated state.
func (*InMemoryBackend) DeleteWebhook ¶
func (b *InMemoryBackend) DeleteWebhook(ctx context.Context, name string) error
DeleteWebhook removes a webhook by name (idempotent).
func (*InMemoryBackend) DeregisterWebhookWithThirdParty ¶
func (b *InMemoryBackend) DeregisterWebhookWithThirdParty(ctx context.Context, name string) error
DeregisterWebhookWithThirdParty clears the third-party registration flag on a webhook.
func (*InMemoryBackend) DisableStageTransition ¶
func (b *InMemoryBackend) DisableStageTransition( ctx context.Context, pipelineName, stageName, transitionType, reason string, ) error
DisableStageTransition disables a stage transition and records the reason. Returns StageNotFoundException if stageName does not exist in the pipeline.
func (*InMemoryBackend) EnableStageTransition ¶
func (b *InMemoryBackend) EnableStageTransition( ctx context.Context, pipelineName, stageName, transitionType string, ) error
EnableStageTransition re-enables a stage transition.
func (*InMemoryBackend) GetActionType ¶
func (b *InMemoryBackend) GetActionType( ctx context.Context, category, owner, provider, version string, ) (*CustomActionType, error)
GetActionType retrieves a custom action type.
func (*InMemoryBackend) GetJobDetails ¶
GetJobDetails returns details for a job by ID.
func (*InMemoryBackend) GetPipeline ¶
GetPipeline returns the pipeline with the given name.
func (*InMemoryBackend) GetPipelineExecution ¶
func (b *InMemoryBackend) GetPipelineExecution( ctx context.Context, pipelineName, executionID string, ) (*PipelineExecution, error)
GetPipelineExecution returns the stored execution by pipeline name and execution ID.
func (*InMemoryBackend) GetPipelineState ¶
func (b *InMemoryBackend) GetPipelineState(ctx context.Context, pipelineName string) ([]StageState, error)
GetPipelineState returns the current state of each stage in a pipeline.
func (*InMemoryBackend) GetStageTransitionState ¶
func (b *InMemoryBackend) GetStageTransitionState( ctx context.Context, pipelineName, stageName, transitionType string, ) *StageTransitionState
GetStageTransitionState returns the disabled state for a stage transition, or nil if enabled.
func (*InMemoryBackend) GetThirdPartyJobDetails ¶
func (b *InMemoryBackend) GetThirdPartyJobDetails(ctx context.Context, jobID, clientToken string) (*Job, error)
GetThirdPartyJobDetails returns details for a third-party job.
func (*InMemoryBackend) ListActionExecutions ¶
func (b *InMemoryBackend) ListActionExecutions( ctx context.Context, pipelineName, pipelineExecutionID string, ) ([]map[string]any, error)
ListActionExecutions returns the recorded action executions for a pipeline, most recent first. An optional pipelineExecutionId filters to a single run.
func (*InMemoryBackend) ListActionTypes ¶
func (b *InMemoryBackend) ListActionTypes(ctx context.Context) []*CustomActionType
ListActionTypes returns all registered action types in the request region.
func (*InMemoryBackend) ListDeployActionExecutionTargets ¶
func (b *InMemoryBackend) ListDeployActionExecutionTargets( ctx context.Context, pipelineName, executionID string, ) ([]map[string]any, error)
ListDeployActionExecutionTargets returns the deploy targets for an action execution. The emulator does not model deployment targets, so it returns an empty (but valid) list for a known pipeline and ErrNotFound otherwise.
func (*InMemoryBackend) ListPipelineExecutions ¶
func (b *InMemoryBackend) ListPipelineExecutions( ctx context.Context, pipelineName string, ) ([]PipelineExecution, error)
ListPipelineExecutions returns stored executions for a pipeline, most recent first.
func (*InMemoryBackend) ListPipelines ¶
func (b *InMemoryBackend) ListPipelines(ctx context.Context) []PipelineSummary
ListPipelines returns a sorted summary of all pipelines in the request region.
func (*InMemoryBackend) ListRuleExecutions ¶
func (b *InMemoryBackend) ListRuleExecutions(ctx context.Context, pipelineName string) ([]map[string]any, error)
ListRuleExecutions returns rule executions for a pipeline. The emulator does not run condition rules, so this returns an empty (but valid) list for a known pipeline and ErrNotFound otherwise.
func (*InMemoryBackend) ListRuleTypes ¶
func (b *InMemoryBackend) ListRuleTypes() []map[string]any
ListRuleTypes returns the AWS-managed CodePipeline rule types. These mirror the built-in condition rule providers AWS exposes.
func (*InMemoryBackend) ListTagsForResource ¶
func (b *InMemoryBackend) ListTagsForResource(ctx context.Context, resourceARN string) ([]Tag, error)
ListTagsForResource returns the sorted tags for a pipeline by ARN. Returns ResourceNotFoundException when the ARN refers to a non-pipeline resource.
func (*InMemoryBackend) ListWebhooks ¶
func (b *InMemoryBackend) ListWebhooks(ctx context.Context) []*Webhook
ListWebhooks returns all webhooks in the request region, sorted by name.
func (*InMemoryBackend) OverrideStageCondition ¶
func (b *InMemoryBackend) OverrideStageCondition( ctx context.Context, pipelineName, stageName, executionID string, ) error
OverrideStageCondition overrides a stage condition.
func (*InMemoryBackend) PollForJobs ¶
func (b *InMemoryBackend) PollForJobs(ctx context.Context, category, owner, provider, version string) ([]*Job, error)
PollForJobs returns available queued jobs matching the given ActionTypeID.
func (*InMemoryBackend) PollForThirdPartyJobs ¶
func (b *InMemoryBackend) PollForThirdPartyJobs( ctx context.Context, category, provider, version string, ) ([]*Job, error)
PollForThirdPartyJobs returns available third-party jobs.
func (*InMemoryBackend) PutActionRevision ¶
func (b *InMemoryBackend) PutActionRevision(ctx context.Context, pipelineName, stageName, actionName string) error
PutActionRevision puts an action revision for a pipeline source action.
func (*InMemoryBackend) PutApprovalResult ¶
func (b *InMemoryBackend) PutApprovalResult( ctx context.Context, pipelineName, stageName, actionName, status, summary string, ) error
PutApprovalResult submits a manual approval for a pipeline action.
func (*InMemoryBackend) PutJobFailureResult ¶
func (b *InMemoryBackend) PutJobFailureResult(ctx context.Context, jobID, message string) error
PutJobFailureResult acknowledges job failure.
func (*InMemoryBackend) PutJobSuccessResult ¶
func (b *InMemoryBackend) PutJobSuccessResult(ctx context.Context, jobID string) error
PutJobSuccessResult acknowledges job success.
func (*InMemoryBackend) PutThirdPartyJobFailureResult ¶
func (b *InMemoryBackend) PutThirdPartyJobFailureResult(ctx context.Context, jobID, _, message string) error
PutThirdPartyJobFailureResult acknowledges third-party job failure.
func (*InMemoryBackend) PutThirdPartyJobSuccessResult ¶
func (b *InMemoryBackend) PutThirdPartyJobSuccessResult(ctx context.Context, jobID, _ string) error
PutThirdPartyJobSuccessResult acknowledges third-party job success.
func (*InMemoryBackend) PutWebhook ¶
PutWebhook creates or updates a webhook with full definition fields.
func (*InMemoryBackend) Region ¶
func (b *InMemoryBackend) Region() string
Region returns the default region for this backend instance.
func (*InMemoryBackend) RegisterWebhookWithThirdParty ¶
func (b *InMemoryBackend) RegisterWebhookWithThirdParty(ctx context.Context, name string) error
RegisterWebhookWithThirdParty registers a webhook with a third-party provider.
func (*InMemoryBackend) Reset ¶
func (b *InMemoryBackend) Reset()
Reset clears all state in the backend, resetting it to a pristine empty state.
func (*InMemoryBackend) Restore ¶
func (b *InMemoryBackend) Restore(ctx context.Context, data []byte) error
Restore loads backend state from a JSON snapshot produced by Snapshot.
func (*InMemoryBackend) RetryStageExecution ¶
func (b *InMemoryBackend) RetryStageExecution( ctx context.Context, pipelineName, stageName, executionID string, ) (*PipelineExecution, error)
RetryStageExecution retries a failed stage in a pipeline.
func (*InMemoryBackend) RollbackStage ¶
func (b *InMemoryBackend) RollbackStage( ctx context.Context, pipelineName, stageName, targetExecutionID string, ) (*PipelineExecution, error)
RollbackStage rolls back a stage to a previous successful execution.
func (*InMemoryBackend) Snapshot ¶
func (b *InMemoryBackend) Snapshot(ctx context.Context) []byte
Snapshot serialises the backend state to JSON. Returns nil on marshal failure.
func (*InMemoryBackend) StartPipelineExecution ¶
func (b *InMemoryBackend) StartPipelineExecution(ctx context.Context, pipelineName string) (*PipelineExecution, error)
StartPipelineExecution starts and stores a new execution of a pipeline.
func (*InMemoryBackend) StopPipelineExecution ¶
func (b *InMemoryBackend) StopPipelineExecution( ctx context.Context, pipelineName, executionID, reason string, abandon bool, ) (*PipelineExecution, error)
StopPipelineExecution stops a pipeline execution. Real AWS transitions through a transient "Stopping" state while in-progress actions finish (or are abandoned, if abandon is true) before reaching the terminal "Stopped" state. gopherstack runs every action synchronously and instantaneously (see StartPipelineExecution), so there is never an in-progress action left to wait for by the time a client can call this -- the execution goes straight to "Stopped" regardless of abandon. Leaving it at "Stopping" left every stopped execution stuck there forever, indistinguishable (to a polling client) from a stop request that never completed.
func (*InMemoryBackend) TagResource ¶
TagResource adds or updates tags on a pipeline by ARN.
func (*InMemoryBackend) UntagResource ¶
func (b *InMemoryBackend) UntagResource(ctx context.Context, resourceARN string, tagKeys []string) error
UntagResource removes tags from a pipeline by ARN.
func (*InMemoryBackend) UpdateActionType ¶
func (b *InMemoryBackend) UpdateActionType(ctx context.Context, cat *CustomActionType) error
UpdateActionType updates an action type definition with full fields.
func (*InMemoryBackend) UpdatePipeline ¶
func (b *InMemoryBackend) UpdatePipeline(ctx context.Context, decl PipelineDeclaration) (*Pipeline, error)
UpdatePipeline replaces the pipeline declaration. If decl.Version is non-zero it must match the current version (optimistic concurrency).
type Job ¶
type Job struct {
ActionTypeID ActionTypeID `json:"actionTypeId,omitzero"`
ID string `json:"id"`
PipelineName string `json:"pipelineName,omitempty"`
Nonce string `json:"nonce"`
Status string `json:"status"`
// contains filtered or unexported fields
}
Job represents a CodePipeline job queued for a custom action.
type Pipeline ¶
type Pipeline struct {
Tags map[string]string `json:"tags"`
Declaration PipelineDeclaration `json:"declaration"`
Metadata PipelineMetadata `json:"metadata"`
// contains filtered or unexported fields
}
Pipeline wraps the declaration and metadata.
type PipelineDeclaration ¶
type PipelineDeclaration struct {
ArtifactStores map[string]ArtifactStore `json:"artifactStores,omitempty"`
ArtifactStore ArtifactStore `json:"artifactStore"`
Name string `json:"name"`
RoleArn string `json:"roleArn"`
PipelineType string `json:"pipelineType,omitempty"`
ExecutionMode string `json:"executionMode,omitempty"`
Stages []Stage `json:"stages"`
Variables []PipelineVariable `json:"variables,omitempty"`
Triggers []Trigger `json:"triggers,omitempty"`
Version int `json:"version"`
}
PipelineDeclaration represents the full pipeline structure.
type PipelineExecution ¶
type PipelineExecution struct {
PipelineName string `json:"pipelineName"`
PipelineExecutionID string `json:"pipelineExecutionId"`
Status string `json:"status"`
Trigger string `json:"trigger,omitempty"`
PipelineVersion int `json:"pipelineVersion"`
}
PipelineExecution represents a stored pipeline execution.
type PipelineMetadata ¶
type PipelineMetadata struct {
PipelineArn string `json:"pipelineArn"`
Created float64 `json:"created"`
Updated float64 `json:"updated"`
}
PipelineMetadata holds pipeline metadata.
type PipelineSummary ¶
type PipelineSummary struct {
PipelineArn string `json:"pipelineArn,omitempty"`
Name string `json:"name"`
PipelineType string `json:"pipelineType,omitempty"`
ExecutionMode string `json:"executionMode,omitempty"`
Version int `json:"version"`
Created float64 `json:"created"`
Updated float64 `json:"updated"`
}
PipelineSummary is a condensed view of a pipeline for listing.
type PipelineVariable ¶
type PipelineVariable struct {
Name string `json:"name"`
DefaultValue string `json:"defaultValue,omitempty"`
Description string `json:"description,omitempty"`
}
PipelineVariable represents a pipeline-level variable declaration.
type Provider ¶
type Provider struct{}
Provider implements service.Provider for AWS CodePipeline.
func (*Provider) Init ¶
func (p *Provider) Init(ctx *service.AppContext) (service.Registerable, error)
Init initializes the CodePipeline service backend and handler.
type Rule ¶
type Rule struct {
Configuration map[string]string `json:"configuration,omitempty"`
RuleTypeID ActionTypeID `json:"ruleTypeId"`
Name string `json:"name"`
RoleArn string `json:"roleArn,omitempty"`
Region string `json:"region,omitempty"`
InputArtifacts []ArtifactRef `json:"inputArtifacts,omitempty"`
}
Rule represents a condition rule within a stage condition.
type Stage ¶
type Stage struct {
BeforeEntry *Condition `json:"beforeEntry,omitempty"`
OnFailure *Condition `json:"onFailure,omitempty"`
OnSuccess *Condition `json:"onSuccess,omitempty"`
Name string `json:"name"`
Type string `json:"type,omitempty"`
Actions []Action `json:"actions"`
}
Stage represents a pipeline stage.
type StageState ¶
type StageState struct {
InboundTransitionState *StageTransitionState
OutboundTransitionState *StageTransitionState
StageName string
ActionStates []map[string]any
}
StageState represents the state of a pipeline stage.
type StageTransitionState ¶
type StageTransitionState struct {
PipelineName string `json:"pipelineName"`
StageName string `json:"stageName"`
TransitionType string `json:"transitionType"`
Reason string `json:"reason"`
Disabled bool `json:"disabled"`
// contains filtered or unexported fields
}
StageTransitionState holds the disabled state and reason for a pipeline stage transition.
type Trigger ¶
type Trigger struct {
GitConfiguration *GitConfiguration `json:"gitConfiguration,omitempty"`
ProviderType string `json:"providerType"`
}
Trigger represents a pipeline trigger definition.
type Webhook ¶
type Webhook struct {
Tags map[string]string `json:"-"`
AuthenticationConfiguration WebhookAuthConfig `json:"authenticationConfiguration,omitzero"`
Name string `json:"name"`
TargetPipeline string `json:"targetPipeline"`
TargetAction string `json:"targetAction"`
Authentication string `json:"authentication,omitempty"`
URL string `json:"url,omitempty"`
ARN string `json:"arn,omitempty"`
LastTriggered string `json:"lastTriggered,omitempty"`
Filters []WebhookFilter `json:"filters,omitempty"`
RegisteredWithThirdParty bool `json:"registeredWithThirdParty"`
// contains filtered or unexported fields
}
Webhook represents a CodePipeline webhook with full AWS-parity fields.
type WebhookAuthConfig ¶
type WebhookAuthConfig struct {
SecretToken string `json:"secretToken,omitempty"`
AllowedIPRange string `json:"allowedIPRange,omitempty"`
}
WebhookAuthConfig holds the authentication configuration for a webhook.
type WebhookFilter ¶
type WebhookFilter struct {
JSONPath string `json:"jsonPath"`
MatchEquals string `json:"matchEquals,omitempty"`
}
WebhookFilter represents a filter applied to incoming webhook payloads.
Source Files
¶
- approvals.go
- custom_action_types.go
- errors.go
- handler.go
- handler_approvals.go
- handler_custom_action_types.go
- handler_jobs.go
- handler_pipeline_executions.go
- handler_pipeline_state.go
- handler_pipelines.go
- handler_rules.go
- handler_tags.go
- handler_third_party_jobs.go
- handler_webhooks.go
- jobs.go
- models.go
- persistence.go
- pipeline_executions.go
- pipeline_state.go
- pipelines.go
- provider.go
- rules.go
- store.go
- store_setup.go
- tags.go
- third_party_jobs.go
- webhooks.go