Documentation
¶
Index ¶
- Constants
- func AllPhaseNames() []string
- type Build
- type BuildLogs
- type BuildPhase
- type BuildPhaseType
- type CodeBuildService
- func (s *CodeBuildService) Actions() []service.Action
- func (s *CodeBuildService) HandleRequest(ctx *service.RequestContext) (*service.Response, error)
- func (s *CodeBuildService) HealthCheck() error
- func (s *CodeBuildService) Name() string
- func (s *CodeBuildService) SetLocator(locator ServiceLocator)
- type EnvironmentVariable
- type Project
- type ProjectArtifacts
- type ProjectEnvironment
- type ProjectSource
- type ReportExportConfig
- type ReportGroup
- type S3ReportExportConfig
- type ServiceLocator
- type Store
- func (s *Store) BatchGetBuilds(ids []string) ([]*Build, []string)
- func (s *Store) BatchGetProjects(names []string) ([]*Project, []string)
- func (s *Store) BatchGetReportGroups(names []string) ([]*ReportGroup, []string)
- func (s *Store) CreateProject(p *Project) (*Project, *service.AWSError)
- func (s *Store) CreateReportGroup(name, reportType string, exportConfig ReportExportConfig, ...) (*ReportGroup, *service.AWSError)
- func (s *Store) DeleteProject(name string) *service.AWSError
- func (s *Store) DeleteReportGroup(name string) *service.AWSError
- func (s *Store) GetBuild(buildID string) (*Build, *service.AWSError)
- func (s *Store) GetProject(name string) (*Project, *service.AWSError)
- func (s *Store) ListBuilds() []string
- func (s *Store) ListBuildsForProject(projectName string) []string
- func (s *Store) ListProjects() []string
- func (s *Store) ListReportGroups() []string
- func (s *Store) ListTagsForResource(arn string) map[string]string
- func (s *Store) StartBuild(projectName string, envOverrides *ProjectEnvironment) (*Build, *service.AWSError)
- func (s *Store) StopBuild(buildID string) (*Build, *service.AWSError)
- func (s *Store) TagResource(arn string, tags map[string]string) *service.AWSError
- func (s *Store) UntagResource(arn string, keys []string) *service.AWSError
- func (s *Store) UpdateProject(name string, updates map[string]any) (*Project, *service.AWSError)
Constants ¶
const ( BuildStatusSubmitted = "SUBMITTED" BuildStatusInProgress = "IN_PROGRESS" BuildStatusSucceeded = "SUCCEEDED" BuildStatusFailed = "FAILED" BuildStatusStopped = "STOPPED" )
Build status constants.
Variables ¶
This section is empty.
Functions ¶
func AllPhaseNames ¶
func AllPhaseNames() []string
AllPhaseNames returns phase names as strings (for log generation).
Types ¶
type Build ¶
type Build struct {
ID string
ARN string
ProjectName string
BuildNumber int64
BuildStatus string
CurrentPhase string
Phases []BuildPhase
StartTime time.Time
EndTime *time.Time
Source ProjectSource
Artifacts ProjectArtifacts
Environment ProjectEnvironment
ServiceRole string
TimeoutInMins int
Logs BuildLogs
// contains filtered or unexported fields
}
Build represents a single build execution.
type BuildPhase ¶
type BuildPhase struct {
PhaseType BuildPhaseType
PhaseStatus string // SUCCEEDED, FAILED, TIMED_OUT, IN_PROGRESS
StartTime time.Time
EndTime *time.Time
DurationInSec int64
}
BuildPhase represents the state of a single build phase.
func GenerateCompletedPhases ¶
func GenerateCompletedPhases(baseTime time.Time) []BuildPhase
GenerateCompletedPhases creates a set of build phases as if the build completed successfully. Each phase gets a start/end time offset from baseTime.
func GenerateFailedPhases ¶
func GenerateFailedPhases(baseTime time.Time) []BuildPhase
GenerateFailedPhases creates phases where the BUILD phase fails.
type BuildPhaseType ¶
type BuildPhaseType string
BuildPhaseType represents a CodeBuild build phase.
const ( PhaseSubmitted BuildPhaseType = "SUBMITTED" PhaseQueued BuildPhaseType = "QUEUED" PhaseProvisioning BuildPhaseType = "PROVISIONING" PhaseDownloadSource BuildPhaseType = "DOWNLOAD_SOURCE" PhaseInstall BuildPhaseType = "INSTALL" PhasePreBuild BuildPhaseType = "PRE_BUILD" PhaseBuild BuildPhaseType = "BUILD" PhasePostBuild BuildPhaseType = "POST_BUILD" PhaseUploadArtifacts BuildPhaseType = "UPLOAD_ARTIFACTS" PhaseFinalizing BuildPhaseType = "FINALIZING" PhaseCompleted BuildPhaseType = "COMPLETED" )
func AllPhases ¶
func AllPhases() []BuildPhaseType
AllPhases returns the ordered list of build phases that a build progresses through.
type CodeBuildService ¶
type CodeBuildService struct {
// contains filtered or unexported fields
}
CodeBuildService is the cloudmock implementation of the AWS CodeBuild API.
func New ¶
func New(accountID, region string) *CodeBuildService
New returns a new CodeBuildService for the given AWS account ID and region.
func NewWithLocator ¶
func NewWithLocator(accountID, region string, locator ServiceLocator) *CodeBuildService
NewWithLocator returns a new CodeBuildService with a ServiceLocator for cross-service integration.
func (*CodeBuildService) Actions ¶
func (s *CodeBuildService) Actions() []service.Action
Actions returns the list of CodeBuild API actions supported.
func (*CodeBuildService) HandleRequest ¶
func (s *CodeBuildService) HandleRequest(ctx *service.RequestContext) (*service.Response, error)
HandleRequest routes an incoming CodeBuild request to the appropriate handler.
func (*CodeBuildService) HealthCheck ¶
func (s *CodeBuildService) HealthCheck() error
HealthCheck always returns nil.
func (*CodeBuildService) Name ¶
func (s *CodeBuildService) Name() string
Name returns the AWS service name used for routing.
func (*CodeBuildService) SetLocator ¶
func (s *CodeBuildService) SetLocator(locator ServiceLocator)
SetLocator sets the service locator for cross-service calls.
type EnvironmentVariable ¶
EnvironmentVariable is a name/value pair for build environments.
type Project ¶
type Project struct {
Name string
ARN string
Description string
Source ProjectSource
Artifacts ProjectArtifacts
Environment ProjectEnvironment
ServiceRole string
TimeoutInMins int
Tags map[string]string
CreatedAt time.Time
LastModified time.Time
}
Project represents a CodeBuild project.
type ProjectArtifacts ¶
ProjectArtifacts describes the build output.
type ProjectEnvironment ¶
type ProjectEnvironment struct {
Type string
Image string
ComputeType string
EnvironmentVars []EnvironmentVariable
}
ProjectEnvironment describes the build environment.
type ProjectSource ¶
ProjectSource describes the build source.
type ReportExportConfig ¶
type ReportExportConfig struct {
ExportConfigType string
S3Destination *S3ReportExportConfig
}
ReportExportConfig describes where reports are exported.
type ReportGroup ¶
type ReportGroup struct {
ARN string
Name string
Type string
ExportConfig ReportExportConfig
CreatedAt time.Time
Tags map[string]string
}
ReportGroup represents a CodeBuild report group.
type S3ReportExportConfig ¶
S3ReportExportConfig describes S3 export configuration.
type ServiceLocator ¶
ServiceLocator resolves other services for cross-service integration.
type Store ¶
type Store struct {
// contains filtered or unexported fields
}
Store is the in-memory store for all CodeBuild resources.
func (*Store) BatchGetProjects ¶
func (*Store) BatchGetReportGroups ¶
func (s *Store) BatchGetReportGroups(names []string) ([]*ReportGroup, []string)
func (*Store) CreateProject ¶
func (*Store) CreateReportGroup ¶
func (s *Store) CreateReportGroup(name, reportType string, exportConfig ReportExportConfig, tags map[string]string) (*ReportGroup, *service.AWSError)