Documentation
¶
Index ¶
- Variables
- func ValidateRepositoryName(name string) error
- type ApprovalRuleTemplate
- type BatchAssociationError
- type BatchCommitError
- type BatchDescribeMergeConflictsResult
- type BlobInfo
- type Branch
- type Comment
- type CommentContext
- type CommentLocation
- type Commit
- type CommitChanges
- type ConflictError
- type ConflictMetadata
- type ConflictResolution
- type DeleteFileMetadata
- type DescribeMergeConflictsResult
- type File
- type FileBinaryStatus
- type FileDifference
- type FileHistoryEntry
- type FileModes
- type FileSizes
- type FileVersionEntry
- type Handler
- func (h *Handler) ChaosOperations() []string
- func (h *Handler) ChaosRegions() []string
- func (h *Handler) ChaosServiceName() string
- func (h *Handler) EnableRegions()
- func (h *Handler) ExtractOperation(c *echo.Context) string
- func (h *Handler) ExtractResource(c *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) RegionHandler(region string) *Handler
- 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) AddApprovalRuleTemplateInternal(t *ApprovalRuleTemplate)
- func (b *InMemoryBackend) AddBranchInternal(repositoryName string, br *Branch)
- func (b *InMemoryBackend) AddCommitInternal(repositoryName string, c *Commit)
- func (b *InMemoryBackend) AddPullRequestInternal(pr *PullRequest)
- func (b *InMemoryBackend) AddRepositoryInternal(r *Repository)
- func (b *InMemoryBackend) AssociateApprovalRuleTemplateWithRepository(templateName, repositoryName string) error
- func (b *InMemoryBackend) BatchAssociateApprovalRuleTemplateWithRepositories(templateName string, repositoryNames []string) ([]string, []BatchAssociationError)
- func (b *InMemoryBackend) BatchDescribeMergeConflicts(repoName, destSpec, sourceSpec, mergeOption string, filePaths []string, ...) (*BatchDescribeMergeConflictsResult, error)
- func (b *InMemoryBackend) BatchDisassociateApprovalRuleTemplateFromRepositories(templateName string, repositoryNames []string) ([]string, []BatchAssociationError)
- func (b *InMemoryBackend) BatchGetCommits(repositoryName string, commitIDs []string) ([]*Commit, []BatchCommitError, error)
- func (b *InMemoryBackend) BatchGetRepositories(names []string) ([]*Repository, []string, error)
- func (b *InMemoryBackend) CreateApprovalRuleTemplate(name, description, content string) (*ApprovalRuleTemplate, error)
- func (b *InMemoryBackend) CreateBranch(repositoryName, branchName, commitID string) error
- func (b *InMemoryBackend) CreateCommit(...) (*Commit, map[string]string, map[string]string, error)
- func (b *InMemoryBackend) CreateCommitDetailed(...) (*CommitChanges, error)
- func (b *InMemoryBackend) CreatePullRequest(title, description, clientRequestToken string, targets []PullRequestTarget) (*PullRequest, error)
- func (b *InMemoryBackend) CreatePullRequestApprovalRule(prID, ruleName, content string) (*PullRequestApprovalRule, error)
- func (b *InMemoryBackend) CreateRepository(name, description, kmsKeyID string, kv map[string]string) (*Repository, error)
- func (b *InMemoryBackend) CreateUnreferencedMergeCommit(...) (*Commit, error)
- func (b *InMemoryBackend) DeleteApprovalRuleTemplate(name string) (string, error)
- func (b *InMemoryBackend) DeleteBranch(repositoryName, branchName string) (*Branch, error)
- func (b *InMemoryBackend) DeleteCommentContent(commentID string) error
- func (b *InMemoryBackend) DeleteFile(repoName, branchName, filePath string, meta DeleteFileMetadata) (*Commit, string, error)
- func (b *InMemoryBackend) DeletePullRequestApprovalRule(prID, ruleName string) (string, error)
- func (b *InMemoryBackend) DeleteRepository(name string) (*Repository, error)
- func (b *InMemoryBackend) DescribeMergeConflicts(repoName, destSpec, sourceSpec, mergeOption, filePath string, q MergeQuery) (*DescribeMergeConflictsResult, error)
- func (b *InMemoryBackend) DescribePullRequestEvents(prID, eventType, actorARN string) ([]PullRequestEvent, error)
- func (b *InMemoryBackend) DisassociateApprovalRuleTemplateFromRepository(templateName, repositoryName string) error
- func (b *InMemoryBackend) EvaluatePullRequestApprovalRules(prID string) ([]RuleEvaluation, error)
- func (b *InMemoryBackend) GetApprovalRuleTemplate(name string) (*ApprovalRuleTemplate, error)
- func (b *InMemoryBackend) GetBlob(repoName, blobID string) ([]byte, error)
- func (b *InMemoryBackend) GetBranch(repositoryName, branchName string) (*Branch, error)
- func (b *InMemoryBackend) GetComment(commentID string) (*Comment, error)
- func (b *InMemoryBackend) GetCommentReactions(commentID string) ([]Reaction, error)
- func (b *InMemoryBackend) GetCommentsForComparedCommit(repoName, afterCommitID, beforeCommitID string) ([]*Comment, error)
- func (b *InMemoryBackend) GetCommentsForPullRequest(prID, repoName, beforeCommitID, afterCommitID string) ([]*Comment, error)
- func (b *InMemoryBackend) GetCommit(repositoryName, commitID string) (*Commit, error)
- func (b *InMemoryBackend) GetDifferences(repoName, afterCommitSpecifier, beforeCommitSpecifier, nextToken string, ...) (page.Page[FileDifference], error)
- func (b *InMemoryBackend) GetFile(repoName, commitSpecifier, filePath string) (*File, error)
- func (b *InMemoryBackend) GetFolder(repoName, commitSpecifier, folderPath string) ([]string, error)
- func (b *InMemoryBackend) GetFolderFiles(repoName, commitSpecifier, folderPath string) ([]*File, error)
- func (b *InMemoryBackend) GetMergeCommit(repoName, sourceSpec, destSpec string, s MergeSettings) (*MergeCommitResult, error)
- func (b *InMemoryBackend) GetMergeConflicts(repoName, sourceSpec, destSpec, mergeOption string, q MergeQuery) (*MergeConflictsResult, error)
- func (b *InMemoryBackend) GetMergeOptions(repoName, sourceSpec, destSpec string, s MergeSettings) (*MergeOptionsResult, error)
- func (b *InMemoryBackend) GetPullRequest(prID string) (*PullRequest, error)
- func (b *InMemoryBackend) GetPullRequestApprovalStates(prID string) ([]PullRequestApproval, error)
- func (b *InMemoryBackend) GetPullRequestOverrideState(prID string) (bool, string, error)
- func (b *InMemoryBackend) GetRepository(name string) (*Repository, error)
- func (b *InMemoryBackend) GetRepositoryTriggers(repoName string) ([]RepositoryTrigger, error)
- func (b *InMemoryBackend) ListApprovalRuleTemplates() []*ApprovalRuleTemplate
- func (b *InMemoryBackend) ListAssociatedApprovalRuleTemplatesForRepository(repoName string) ([]string, error)
- func (b *InMemoryBackend) ListBranches(repositoryName string) ([]string, error)
- func (b *InMemoryBackend) ListFileCommitHistory(repoName, filePath, nextToken string, maxResults int) (page.Page[FileVersionEntry], error)
- func (b *InMemoryBackend) ListPullRequests(repositoryName, pullRequestStatus, authorARN string) ([]string, error)
- func (b *InMemoryBackend) ListRepositories() []*Repository
- func (b *InMemoryBackend) ListRepositoriesForApprovalRuleTemplate(templateName string) ([]string, error)
- func (b *InMemoryBackend) ListTagsForResource(resourceARN string) (map[string]string, error)
- func (b *InMemoryBackend) MergeBase(repoName, sourceID, destID string) string
- func (b *InMemoryBackend) MergeBranchesByFastForward(repoName, sourceRef, destinationRef, targetBranch string) (*Commit, error)
- func (b *InMemoryBackend) MergeBranchesBySquash(repoName, sourceSpecifier, destSpecifier string, opts MergeBranchesOptions) (*Commit, error)
- func (b *InMemoryBackend) MergeBranchesByThreeWay(repoName, sourceSpecifier, destSpecifier string, opts MergeBranchesOptions) (*Commit, error)
- func (b *InMemoryBackend) MergePullRequestByFastForward(prID, repoName, sourceCommitID string, opts MergePullRequestOptions) (*PullRequest, error)
- func (b *InMemoryBackend) MergePullRequestBySquash(prID, repoName, sourceCommitID string, opts MergePullRequestOptions) (*PullRequest, error)
- func (b *InMemoryBackend) MergePullRequestByThreeWay(prID, repoName, sourceCommitID string, opts MergePullRequestOptions) (*PullRequest, error)
- func (b *InMemoryBackend) OverridePullRequestApprovalRules(prID, overrideStatus, overriderARN string) error
- func (b *InMemoryBackend) PostComment(cc CommentContext, content string) (*Comment, error)
- func (b *InMemoryBackend) PostCommentReply(inReplyTo, content, authorARN string) (*Comment, error)
- func (b *InMemoryBackend) PutCommentReaction(commentID, emoji, userARN string) error
- func (b *InMemoryBackend) PutFile(repoName, branchName, filePath string, content []byte, meta PutFileMetadata) (*Commit, string, error)
- func (b *InMemoryBackend) PutRepositoryTriggers(repoName string, triggers []RepositoryTrigger) error
- func (b *InMemoryBackend) Region() string
- func (b *InMemoryBackend) Reset()
- func (b *InMemoryBackend) ResolveCommitSpecifier(repoName, specifier string) (string, error)
- func (b *InMemoryBackend) Restore(ctx context.Context, data []byte) error
- func (b *InMemoryBackend) Snapshot(ctx context.Context) []byte
- func (b *InMemoryBackend) TagResource(resourceARN string, kv map[string]string) error
- func (b *InMemoryBackend) TaggedResources() []TaggedEntry
- func (b *InMemoryBackend) TestRepositoryTriggers(repoName string, triggers []RepositoryTrigger) ([]string, error)
- func (b *InMemoryBackend) UntagResource(resourceARN string, tagKeys []string) error
- func (b *InMemoryBackend) UpdateApprovalRuleTemplateContent(name, content, existingSha256 string) error
- func (b *InMemoryBackend) UpdateApprovalRuleTemplateDescription(name, desc string) error
- func (b *InMemoryBackend) UpdateApprovalRuleTemplateName(oldName, newName string) error
- func (b *InMemoryBackend) UpdateComment(commentID, content string) error
- func (b *InMemoryBackend) UpdateDefaultBranch(repoName, branchName string) error
- func (b *InMemoryBackend) UpdatePullRequestApprovalRuleContent(prID, ruleName, content, existingSha256 string) (*PullRequestApprovalRule, error)
- func (b *InMemoryBackend) UpdatePullRequestApprovalState(prID, userARN, approvalState string) error
- func (b *InMemoryBackend) UpdatePullRequestDescription(prID, desc string) error
- func (b *InMemoryBackend) UpdatePullRequestStatus(prID, status string) error
- func (b *InMemoryBackend) UpdatePullRequestTitle(prID, title string) error
- func (b *InMemoryBackend) UpdateRepositoryDescription(name, desc string) error
- func (b *InMemoryBackend) UpdateRepositoryEncryptionKey(name, kmsKeyID string) (string, string, error)
- func (b *InMemoryBackend) UpdateRepositoryName(oldName, newName string) error
- type MergeBranchesOptions
- type MergeCommitResult
- type MergeConflict
- type MergeConflictsResult
- type MergeHunk
- type MergeHunkDetail
- type MergeMetadata
- type MergeOperations
- type MergeOptionsResult
- type MergePullRequestOptions
- type MergeQuery
- type MergeSettings
- type ObjectTypes
- type Provider
- type PullRequest
- type PullRequestApproval
- type PullRequestApprovalRule
- type PullRequestEvent
- type PullRequestTarget
- type PutFileEntry
- type PutFileMetadata
- type Reaction
- type ReplaceContentEntry
- type Repository
- type RepositoryTrigger
- type RuleEvaluation
- type SetFileModeEntry
- type TaggedEntry
- type TreeEntry
Constants ¶
This section is empty.
Variables ¶
var ( // ErrNotFound is returned when a requested resource does not exist. ErrNotFound = awserr.New(errRepoDoesNotExist, awserr.ErrNotFound) // ErrAlreadyExists is returned when a resource already exists. ErrAlreadyExists = awserr.New("RepositoryNameExistsException", awserr.ErrConflict) // ErrCommitSpecifierRequired is returned when a merge op's commit // specifier is empty. CommitRequiredException is what GetMergeCommit and // the MergeBranchesBy* ops model for this case (codecommit@v1.36.4 // deserializers.go); "InvalidParameterException" names no type in this // module at all. ErrCommitSpecifierRequired = awserr.New("CommitRequiredException", awserr.ErrInvalidParameter) // ErrApprovalRuleTemplateNotFound is returned when an approval rule template is not found. ErrApprovalRuleTemplateNotFound = awserr.New(errApprovalRuleTemplateNotExist, awserr.ErrNotFound) // ErrApprovalRuleTemplateAlreadyExists is returned when an approval rule template already exists. ErrApprovalRuleTemplateAlreadyExists = awserr.New( "ApprovalRuleTemplateNameAlreadyExistsException", awserr.ErrConflict, ) // ErrIdempotencyMismatch is returned when a ClientRequestToken is reused with different parameters. ErrIdempotencyMismatch = awserr.New("IdempotencyParameterMismatchException", awserr.ErrInvalidParameter) // ErrInvalidRelativeFileVersion is returned for a comment location whose RelativeFileVersion is not BEFORE or AFTER. ErrInvalidRelativeFileVersion = awserr.New("InvalidRelativeFileVersionEnumException", awserr.ErrInvalidParameter) // ErrBranchNotFound is returned when a branch is not found. ErrBranchNotFound = awserr.New("BranchDoesNotExistException", awserr.ErrNotFound) // ErrBranchAlreadyExists is returned when a branch already exists. ErrBranchAlreadyExists = awserr.New("BranchNameExistsException", awserr.ErrConflict) // ErrCommitNotFound is returned when a commit specifier fails to resolve // (e.g. a branch/merge op looking up a commit by name or ID). ErrCommitNotFound = awserr.New("CommitDoesNotExistException", awserr.ErrNotFound) // ErrCommitIDNotFound is returned by GetCommit specifically: its real AWS // error for an unresolvable commitId is CommitIdDoesNotExistException, a // distinct exception from CommitDoesNotExistException (verified against // codecommit@v1.36.4's deserializeOpErrorGetCommit). ErrCommitIDNotFound = awserr.New("CommitIdDoesNotExistException", awserr.ErrNotFound) // ErrPullRequestNotFound is returned when a pull request is not found. ErrPullRequestNotFound = awserr.New("PullRequestDoesNotExistException", awserr.ErrNotFound) // ErrPullRequestAlreadyMerged is returned when a PR is already merged. ErrPullRequestAlreadyMerged = awserr.New("PullRequestAlreadyClosedException", awserr.ErrConflict) // ErrInvalidRepositoryName is returned when a repository name is invalid. ErrInvalidRepositoryName = awserr.New("InvalidRepositoryNameException", awserr.ErrInvalidParameter) // ErrMaxRepositoriesExceeded is returned when too many repositories are requested. ErrMaxRepositoriesExceeded = awserr.New("MaximumRepositoryNamesExceededException", awserr.ErrInvalidParameter) // ErrBranchNameRequired is returned when a branch name is missing. ErrBranchNameRequired = awserr.New("BranchNameRequiredException", awserr.ErrInvalidParameter) // ErrInvalidBranchName is returned when a branch name contains invalid characters. ErrInvalidBranchName = awserr.New("InvalidBranchNameException", awserr.ErrInvalidParameter) // ErrParentCommitIDRequired is returned when parentCommitId is missing for a branch with commits. ErrParentCommitIDRequired = awserr.New("ParentCommitIdRequiredException", awserr.ErrInvalidParameter) // ErrParentCommitIDOutdated is returned when parentCommitId doesn't match branch tip. ErrParentCommitIDOutdated = awserr.New("ParentCommitIdOutdatedException", awserr.ErrConflict) // ErrSameFileContent is returned by PutFile when the written content is // identical to what's already at that path. ErrSameFileContent = awserr.New("SameFileContentException", awserr.ErrConflict) // ErrNoChange is returned by CreateCommit when a putFiles entry's content // is identical to what's already at that path: CreateCommit's own // declared error set has no SameFileContentException (that's PutFile-only, // verified against codecommit@v1.36.4's deserializeOpErrorCreateCommit), // its closest declared equivalent is NoChangeException ("no changes will // be made to the repository as a result of this commit"). ErrNoChange = awserr.New("NoChangeException", awserr.ErrConflict) // ErrFilePathConflicts is returned when a file path conflicts with an existing path. ErrFilePathConflicts = awserr.New("FilePathConflictsWithSubmodulePathException", awserr.ErrConflict) // ErrFileNotFound is returned when a file path does not exist in the repository. ErrFileNotFound = awserr.New("FileDoesNotExistException", awserr.ErrNotFound) // ErrBlobNotFound is returned when a blob ID does not exist in the repository. ErrBlobNotFound = awserr.New("BlobIdDoesNotExistException", awserr.ErrNotFound) // ErrCommentNotFound is returned when a comment ID does not exist. ErrCommentNotFound = awserr.New("CommentDoesNotExistException", awserr.ErrNotFound) // ErrInvalidRuleContentSha256 is returned when existingRuleContentSha256 does not match the current content. ErrInvalidRuleContentSha256 = awserr.New("InvalidRuleContentSha256Exception", awserr.ErrInvalidParameter) // ErrApprovalRuleNotFound is returned when a pull request approval rule does not exist. ErrApprovalRuleNotFound = awserr.New("ApprovalRuleDoesNotExistException", awserr.ErrNotFound) // ErrInvalidPullRequestEventType is returned when pullRequestEventType is not a recognized enum value. ErrInvalidPullRequestEventType = awserr.New("InvalidPullRequestEventTypeException", awserr.ErrInvalidParameter) // ErrInvalidMergeOption is returned when mergeOption is not one of the three enum values. // Code is InvalidMergeOptionException -- BatchDescribeMergeConflicts, CreateUnreferencedMergeCommit, // DescribeMergeConflicts, and GetMergeConflicts all declare it (codecommit@v1.36.4 // deserializers.go); none of the four declares InvalidParameterException. ErrInvalidMergeOption = awserr.New("InvalidMergeOptionException", awserr.ErrInvalidParameter) // ErrInvalidPullRequestStatus is returned when pullRequestStatus is not OPEN or CLOSED. // Code is InvalidPullRequestStatusException -- ListPullRequests and UpdatePullRequestStatus // both declare it (codecommit@v1.36.4 deserializers.go); neither declares // InvalidParameterException. ErrInvalidPullRequestStatus = awserr.New("InvalidPullRequestStatusException", awserr.ErrInvalidParameter) // ErrInvalidContinuationToken is returned when a nextToken/NextToken fails to decode. // Code is InvalidContinuationTokenException -- GetDifferences and ListFileCommitHistory // both declare it (codecommit@v1.36.4 deserializers.go); neither declares // InvalidParameterException. ErrInvalidContinuationToken = awserr.New("InvalidContinuationTokenException", awserr.ErrInvalidParameter) // ErrInvalidActorArn is returned when DescribePullRequestEventsInput.ActorArn is // not a well-formed ARN. Code is InvalidActorArnException, declared by // DescribePullRequestEvents specifically (codecommit@v1.36.4 deserializers.go); // real AWS also declares ActorDoesNotExistException for a well-formed ARN that // doesn't correspond to any account principal -- not implemented here (would // require cross-service coupling to IAM's user/role store, out of scope). ErrInvalidActorArn = awserr.New("InvalidActorArnException", awserr.ErrInvalidParameter) )
var ( // ErrManualMergeRequired is returned when a merge still has unresolved conflicts. ErrManualMergeRequired = awserr.New("ManualMergeRequiredException", awserr.ErrInvalidParameter) // ErrInvalidConflictDetailLevel is returned for a conflictDetailLevel outside FILE_LEVEL/LINE_LEVEL. ErrInvalidConflictDetailLevel = awserr.New("InvalidConflictDetailLevelException", awserr.ErrInvalidParameter) // ErrInvalidConflictResolutionStrategy is returned for an unknown conflictResolutionStrategy. ErrInvalidConflictResolutionStrategy = awserr.New( "InvalidConflictResolutionStrategyException", awserr.ErrInvalidParameter, ) // ErrInvalidConflictResolution is returned for a malformed conflictResolution. ErrInvalidConflictResolution = awserr.New("InvalidConflictResolutionException", awserr.ErrInvalidParameter) // ErrReplacementTypeRequired is returned for a replaceContents entry without a replacementType. ErrReplacementTypeRequired = awserr.New("ReplacementTypeRequiredException", awserr.ErrInvalidParameter) // ErrInvalidReplacementType is returned for an unknown replacementType. ErrInvalidReplacementType = awserr.New("InvalidReplacementTypeException", awserr.ErrInvalidParameter) // ErrReplacementContentRequired is returned for USE_NEW_CONTENT without content. ErrReplacementContentRequired = awserr.New("ReplacementContentRequiredException", awserr.ErrInvalidParameter) // ErrMultipleConflictResolutionEntries is returned when a file has more than one resolution entry. ErrMultipleConflictResolutionEntries = awserr.New( "MultipleConflictResolutionEntriesException", awserr.ErrInvalidParameter, ) // ErrPathRequired is returned for a resolution entry without a file path. ErrPathRequired = awserr.New("PathRequiredException", awserr.ErrInvalidParameter) // ErrInvalidFileMode is returned for a file mode outside NORMAL/EXECUTABLE/SYMLINK. ErrInvalidFileMode = awserr.New("InvalidFileModeException", awserr.ErrInvalidParameter) // ErrFileModeRequired is returned for a setFileModes entry without a file mode. ErrFileModeRequired = awserr.New("FileModeRequiredException", awserr.ErrInvalidParameter) // ErrInvalidMaxConflictFiles is returned for a non-positive maxConflictFiles. ErrInvalidMaxConflictFiles = awserr.New("InvalidMaxConflictFilesException", awserr.ErrInvalidParameter) // ErrInvalidMaxMergeHunks is returned for a non-positive maxMergeHunks. ErrInvalidMaxMergeHunks = awserr.New("InvalidMaxMergeHunksException", awserr.ErrInvalidParameter) )
Errors raised by the merge operations' conflict handling inputs.
var ErrNilAppContext = errors.New("AppContext is required")
ErrNilAppContext is returned when Provider.Init is called with a nil AppContext.
Functions ¶
func ValidateRepositoryName ¶
ValidateRepositoryName returns an error if name is not a valid CodeCommit repository name.
Types ¶
type ApprovalRuleTemplate ¶
type ApprovalRuleTemplate struct {
CreationDate time.Time `json:"creationDate"`
LastModifiedDate time.Time `json:"lastModifiedDate"`
ApprovalRuleTemplateID string `json:"approvalRuleTemplateId"`
ApprovalRuleTemplateName string `json:"approvalRuleTemplateName"`
ApprovalRuleTemplateARN string `json:"approvalRuleTemplateArn"`
ApprovalRuleTemplateContent string `json:"approvalRuleTemplateContent"`
ApprovalRuleTemplateDescription string `json:"approvalRuleTemplateDescription,omitempty"`
LastModifiedUser string `json:"lastModifiedUser,omitempty"`
RuleContentSha256 string `json:"ruleContentSha256"`
}
ApprovalRuleTemplate represents an AWS CodeCommit approval rule template.
type BatchAssociationError ¶
type BatchAssociationError struct {
RepositoryName string `json:"repositoryName"`
ErrorCode string `json:"errorCode"`
ErrorMessage string `json:"errorMessage"`
}
BatchAssociationError holds the error info for a single failed batch association.
type BatchCommitError ¶
type BatchCommitError struct {
CommitID string `json:"commitId"`
ErrorCode string `json:"errorCode"`
ErrorMessage string `json:"errorMessage"`
}
BatchCommitError holds error information for a failed batch commit retrieval.
type BatchDescribeMergeConflictsResult ¶
type BatchDescribeMergeConflictsResult struct {
DestinationCommitID string `json:"destinationCommitId"`
SourceCommitID string `json:"sourceCommitId"`
BaseCommitID string `json:"baseCommitId,omitempty"`
NextToken string `json:"nextToken,omitempty"`
Conflicts []MergeConflict `json:"conflicts"`
Errors []ConflictError `json:"errors,omitempty"`
}
BatchDescribeMergeConflictsResult holds the result of a merge conflict description.
type BlobInfo ¶
type BlobInfo struct {
BlobID string `json:"blobId"`
Path string `json:"path"`
Mode string `json:"mode"`
}
BlobInfo holds per-blob metadata in a file difference, matching real AWS shape.
type Branch ¶
type Branch struct {
BranchName string `json:"branchName"`
CommitID string `json:"commitId"`
RepositoryName string `json:"repositoryName"`
}
Branch represents a CodeCommit branch.
type Comment ¶
type Comment struct {
Location *CommentLocation `json:"-"`
CreationDate time.Time `json:"creationDate"`
LastModifiedDate time.Time `json:"lastModifiedDate"`
CommentID string `json:"commentId"`
Content string `json:"content"`
AuthorARN string `json:"authorArn"`
// InReplyTo links to parent comment for replies
InReplyTo string `json:"inReplyTo,omitempty"`
// PRid links comment to a pull request
PRid string `json:"-"`
// RepoName + AfterCommitID for commit comments
RepoName string `json:"-"`
AfterCommitID string `json:"-"`
BeforeCommitID string `json:"-"`
Deleted bool `json:"deleted"`
}
Comment represents a CodeCommit comment.
type CommentContext ¶
type CommentContext struct {
Location *CommentLocation
RepoName string
BeforeCommitID string
AfterCommitID string
PullRequestID string
AuthorARN string
}
CommentContext is the request context a new comment is anchored to.
type CommentLocation ¶
type CommentLocation struct {
FilePath string `json:"filePath,omitempty"`
RelativeFileVersion string `json:"relativeFileVersion,omitempty"`
FilePosition int64 `json:"filePosition,omitempty"`
}
CommentLocation is types.Location: where in a file a comment was made.
type Commit ¶
type Commit struct {
CreatedAt time.Time `json:"createdAt"`
CommitID string `json:"commitId"`
TreeID string `json:"treeId"`
Tree map[string]TreeEntry `json:"tree,omitempty"`
Message string `json:"message,omitempty"`
AdditionalData string `json:"additionalData,omitempty"`
AuthorName string `json:"authorName,omitempty"`
AuthorEmail string `json:"authorEmail,omitempty"`
CommitterName string `json:"committerName,omitempty"`
CommitterEmail string `json:"committerEmail,omitempty"`
RepositoryName string `json:"repositoryName"`
Parents []string `json:"parents,omitempty"`
HasTree bool `json:"hasTree,omitempty"`
}
Commit represents a CodeCommit commit.
type CommitChanges ¶
type CommitChanges struct {
Commit *Commit
Added map[string]string
Updated map[string]string
Deleted map[string]string
}
CommitChanges is CreateCommit's result: blob IDs by path for added, updated and deleted files.
type ConflictError ¶
type ConflictError struct {
ExceptionName string `json:"exceptionName"`
FilePath string `json:"filePath"`
Message string `json:"message"`
}
ConflictError is one per-file error of BatchDescribeMergeConflicts.
type ConflictMetadata ¶
type ConflictMetadata struct {
FileSizes *FileSizes `json:"fileSizes,omitempty"`
FileModes *FileModes `json:"fileModes,omitempty"`
ObjectTypes *ObjectTypes `json:"objectTypes,omitempty"`
MergeOperations *MergeOperations `json:"mergeOperations,omitempty"`
FilePath string `json:"filePath"`
NumberOfConflicts int `json:"numberOfConflicts"`
IsBinaryFile FileBinaryStatus `json:"isBinaryFile"`
ContentConflict bool `json:"contentConflict"`
FileModeConflict bool `json:"fileModeConflict"`
ObjectTypeConflict bool `json:"objectTypeConflict"`
}
ConflictMetadata holds metadata about a merge conflict.
type ConflictResolution ¶
type ConflictResolution struct {
DeleteFiles []string
ReplaceContents []ReplaceContentEntry
SetFileModes []SetFileModeEntry
}
ConflictResolution is the caller's explicit resolution of conflicting files.
type DeleteFileMetadata ¶ added in v1.5.0
type DeleteFileMetadata struct {
ParentCommitID string
AuthorName string
AuthorEmail string
CommitMessage string
KeepEmptyFolders bool
}
DeleteFileMetadata carries DeleteFile's authoring fields (commitMessage/ name/email on AWS's DeleteFileInput, alongside the already-enforced parentCommitId). Previously commitMessage/name/email were dropped entirely: the resulting commit always got a synthetic "Delete <path>" message and no author/committer identity.
type DescribeMergeConflictsResult ¶
type DescribeMergeConflictsResult struct {
SourceCommitID string
DestinationCommitID string
BaseCommitID string
NextToken string
Hunks []MergeHunk
Metadata ConflictMetadata
}
DescribeMergeConflictsResult is DescribeMergeConflicts' output.
type File ¶
type File struct {
FilePath string `json:"filePath"`
CommitSpecifier string `json:"commitSpecifier"`
BlobID string `json:"blobId"`
FileMode string `json:"fileMode"`
RepoName string `json:"-"`
FileContent []byte `json:"fileContent"`
}
File represents a file stored in CodeCommit.
RepoName identifies the owning repository. It exists purely so the flattened store.Table[File] (see store_setup.go; this collection was previously nested repoName -> filePath -> *File) can derive its composite "repoName|filePath" key from the value alone; it is not part of the CodeCommit wire API, hence json:"-".
type FileBinaryStatus ¶
type FileBinaryStatus struct {
Source bool `json:"source"`
Destination bool `json:"destination"`
Base bool `json:"base"`
}
FileBinaryStatus holds whether each version of a file is binary.
type FileDifference ¶
type FileDifference struct {
AfterBlob *BlobInfo `json:"afterBlob"`
BeforeBlob *BlobInfo `json:"beforeBlob"`
ChangeType string `json:"changeType"`
}
FileDifference represents a file difference between two commits.
type FileHistoryEntry ¶ added in v1.2.0
type FileHistoryEntry struct {
CommitID string `json:"commitId"`
BlobID string `json:"blobId,omitempty"`
}
FileHistoryEntry records one commit that touched a file path, paired with the blob ID that commit produced (or "" if the commit deleted the path). Stored oldest-first per repoName/filePath in InMemoryBackend.fileHistory and used to build AWS's FileVersion shape for ListFileCommitHistory.
type FileModes ¶
type FileModes struct {
Source string `json:"source,omitempty"`
Destination string `json:"destination,omitempty"`
Base string `json:"base,omitempty"`
}
FileModes holds a file's mode in the source, destination and base of a merge.
type FileSizes ¶
type FileSizes struct {
Source int64 `json:"source"`
Destination int64 `json:"destination"`
Base int64 `json:"base"`
}
FileSizes holds a file's size in the source, destination and base of a merge.
type FileVersionEntry ¶ added in v1.2.0
type FileVersionEntry struct {
Commit *Commit
FilePath string
BlobID string
RevisionChildren []string
}
FileVersionEntry is the resolved (commit + blob + path + children) tuple for one entry of a file's revision history, used to build the AWS FileVersion wire shape (blobId/commit/path/revisionChildren) in ListFileCommitHistory's response. RevisionChildren is computed against the full (unpaginated) history so it stays correct even when the entry itself is returned on a page boundary.
type Handler ¶
type Handler struct {
Backend *InMemoryBackend
// contains filtered or unexported fields
}
Handler is the Echo HTTP handler for AWS CodeCommit operations.
func NewHandler ¶
func NewHandler(backend *InMemoryBackend) *Handler
NewHandler creates a new CodeCommit handler.
func (*Handler) ChaosOperations ¶
ChaosOperations returns all operations that can be fault-injected.
func (*Handler) ChaosRegions ¶
ChaosRegions returns all regions this CodeCommit instance handles.
func (*Handler) ChaosServiceName ¶
ChaosServiceName returns the lowercase AWS service name for fault rule matching.
func (*Handler) EnableRegions ¶
func (h *Handler) EnableRegions()
EnableRegions makes h serve every other region through lazily built per-region siblings.
func (*Handler) ExtractOperation ¶
ExtractOperation extracts the CodeCommit operation from the X-Amz-Target header.
func (*Handler) ExtractResource ¶
ExtractResource extracts the repository name from the request body.
func (*Handler) GetSupportedOperations ¶
GetSupportedOperations returns the list of supported CodeCommit operations.
func (*Handler) Handler ¶
func (h *Handler) Handler() echo.HandlerFunc
Handler returns the Echo handler function.
func (*Handler) MatchPriority ¶
MatchPriority returns the routing priority.
func (*Handler) RegionHandler ¶
RegionHandler returns the handler serving region: h itself for the home region, else its sibling.
func (*Handler) RouteMatcher ¶
RouteMatcher returns a function that matches AWS CodeCommit requests.
type InMemoryBackend ¶
type InMemoryBackend struct {
// contains filtered or unexported fields
}
InMemoryBackend is the in-memory store for CodeCommit resources.
Phase 3.3 datalayer refactor: every map[string]*T resource field is registered exactly once (see store_setup.go's registerAllTables) as a *store.Table[T] on registry. Maps whose value is not a *T of its own (sets, plain scalars/strings, slices, or a pure reverse/derived index) are left as plain maps below -- see store_setup.go's file doc for the full audit of which field went which way and why.
func NewInMemoryBackend ¶
func NewInMemoryBackend(accountID, region string) *InMemoryBackend
NewInMemoryBackend creates a new in-memory CodeCommit backend.
func (*InMemoryBackend) AddApprovalRuleTemplateInternal ¶
func (b *InMemoryBackend) AddApprovalRuleTemplateInternal(t *ApprovalRuleTemplate)
AddApprovalRuleTemplateInternal seeds an ApprovalRuleTemplate directly.
func (*InMemoryBackend) AddBranchInternal ¶
func (b *InMemoryBackend) AddBranchInternal(repositoryName string, br *Branch)
AddBranchInternal seeds a Branch directly into the backend.
func (*InMemoryBackend) AddCommitInternal ¶
func (b *InMemoryBackend) AddCommitInternal(repositoryName string, c *Commit)
AddCommitInternal seeds a Commit directly into the backend.
func (*InMemoryBackend) AddPullRequestInternal ¶
func (b *InMemoryBackend) AddPullRequestInternal(pr *PullRequest)
AddPullRequestInternal seeds a PullRequest directly into the backend.
func (*InMemoryBackend) AddRepositoryInternal ¶
func (b *InMemoryBackend) AddRepositoryInternal(r *Repository)
AddRepositoryInternal seeds a Repository directly into the backend without going through normal validation.
func (*InMemoryBackend) AssociateApprovalRuleTemplateWithRepository ¶
func (b *InMemoryBackend) AssociateApprovalRuleTemplateWithRepository(templateName, repositoryName string) error
AssociateApprovalRuleTemplateWithRepository associates an approval rule template with a repository.
func (*InMemoryBackend) BatchAssociateApprovalRuleTemplateWithRepositories ¶
func (b *InMemoryBackend) BatchAssociateApprovalRuleTemplateWithRepositories( templateName string, repositoryNames []string, ) ([]string, []BatchAssociationError)
BatchAssociateApprovalRuleTemplateWithRepositories associates an approval rule template with multiple repositories. Returns lists of associated and failed repository names.
func (*InMemoryBackend) BatchDescribeMergeConflicts ¶
func (b *InMemoryBackend) BatchDescribeMergeConflicts( repoName, destSpec, sourceSpec, mergeOption string, filePaths []string, q MergeQuery, ) (*BatchDescribeMergeConflictsResult, error)
BatchDescribeMergeConflicts describes the conflicts of the requested files, or of every conflicting file when none is requested.
func (*InMemoryBackend) BatchDisassociateApprovalRuleTemplateFromRepositories ¶
func (b *InMemoryBackend) BatchDisassociateApprovalRuleTemplateFromRepositories( templateName string, repositoryNames []string, ) ([]string, []BatchAssociationError)
BatchDisassociateApprovalRuleTemplateFromRepositories removes associations between a template and multiple repositories.
func (*InMemoryBackend) BatchGetCommits ¶
func (b *InMemoryBackend) BatchGetCommits( repositoryName string, commitIDs []string, ) ([]*Commit, []BatchCommitError, error)
BatchGetCommits retrieves multiple commits by ID from a repository. Returns a 404 error if the repository does not exist.
func (*InMemoryBackend) BatchGetRepositories ¶
func (b *InMemoryBackend) BatchGetRepositories(names []string) ([]*Repository, []string, error)
BatchGetRepositories returns repositories by name, splitting results into found/notFound. AWS enforces a maximum of 25 repository names per request.
func (*InMemoryBackend) CreateApprovalRuleTemplate ¶
func (b *InMemoryBackend) CreateApprovalRuleTemplate(name, description, content string) (*ApprovalRuleTemplate, error)
CreateApprovalRuleTemplate creates a new approval rule template.
func (*InMemoryBackend) CreateBranch ¶
func (b *InMemoryBackend) CreateBranch(repositoryName, branchName, commitID string) error
CreateBranch creates a new branch in a repository.
func (*InMemoryBackend) CreateCommit ¶
func (b *InMemoryBackend) CreateCommit( repositoryName, branchName, authorName, authorEmail, message, parentCommitID string, putFiles []PutFileEntry, deleteFiles []string, keepEmptyFolders bool, ) (*Commit, map[string]string, map[string]string, error)
CreateCommit creates a new commit in a repository, tracking parent commits from the current branch head.
parentCommitID must match the current branch tip when the branch already has commits; AWS returns ParentCommitIdRequiredException if omitted and ParentCommitIdOutdatedException if it does not match the current tip.
func (*InMemoryBackend) CreateCommitDetailed ¶
func (b *InMemoryBackend) CreateCommitDetailed( repositoryName, branchName, authorName, authorEmail, message, parentCommitID string, putFiles []PutFileEntry, deleteFiles []string, setFileModes []SetFileModeEntry, keepEmptyFolders bool, ) (*CommitChanges, error)
CreateCommitDetailed is CreateCommit that also applies setFileModes and reports updated files separately.
func (*InMemoryBackend) CreatePullRequest ¶
func (b *InMemoryBackend) CreatePullRequest( title, description, clientRequestToken string, targets []PullRequestTarget, ) (*PullRequest, error)
CreatePullRequest creates a new pull request.
func (*InMemoryBackend) CreatePullRequestApprovalRule ¶
func (b *InMemoryBackend) CreatePullRequestApprovalRule( prID, ruleName, content string, ) (*PullRequestApprovalRule, error)
CreatePullRequestApprovalRule creates an approval rule on a pull request.
func (*InMemoryBackend) CreateRepository ¶
func (b *InMemoryBackend) CreateRepository( name, description, kmsKeyID string, kv map[string]string, ) (*Repository, error)
CreateRepository creates a new CodeCommit repository.
func (*InMemoryBackend) CreateUnreferencedMergeCommit ¶
func (b *InMemoryBackend) CreateUnreferencedMergeCommit( repoName, sourceSpec, destSpec, mergeOption, authorName, authorEmail, message string, s MergeSettings, ) (*Commit, error)
CreateUnreferencedMergeCommit creates, without moving any branch, the commit a squash or three-way merge of the two specifiers would produce.
func (*InMemoryBackend) DeleteApprovalRuleTemplate ¶
func (b *InMemoryBackend) DeleteApprovalRuleTemplate(name string) (string, error)
DeleteApprovalRuleTemplate deletes an approval rule template by name, returning its ID. The real DeleteApprovalRuleTemplateOutput echoes ApprovalRuleTemplateId as a required field (api_op_DeleteApprovalRuleTemplate.go:38).
func (*InMemoryBackend) DeleteBranch ¶
func (b *InMemoryBackend) DeleteBranch(repositoryName, branchName string) (*Branch, error)
DeleteBranch deletes a branch from a repository.
func (*InMemoryBackend) DeleteCommentContent ¶
func (b *InMemoryBackend) DeleteCommentContent(commentID string) error
DeleteCommentContent marks a comment as deleted and clears its content.
func (*InMemoryBackend) DeleteFile ¶
func (b *InMemoryBackend) DeleteFile( repoName, branchName, filePath string, meta DeleteFileMetadata, ) (*Commit, string, error)
DeleteFile removes a file and creates a delete commit. It returns the new commit and the blob ID of the removed file (AWS's DeleteFileOutput.BlobId is a required field reporting the blob that was taken out of the tree). AWS rejects deletion of a path that does not exist with FileDoesNotExistException, so callers must not be able to fabricate a delete commit for a file that was never there.
parentCommitId is a required field on AWS's DeleteFileInput (unlike CreateCommit, where it is optional) — verified against aws-sdk-go-v2/service/codecommit's validators.go, which client-side rejects a DeleteFileInput with a nil ParentCommitId before ever making a request. Real AWS documents it as "must be the HEAD commit for the branch", so a non-empty value that does not match the current branch tip is rejected the same way CreateCommit rejects a stale parentCommitId.
func (*InMemoryBackend) DeletePullRequestApprovalRule ¶
func (b *InMemoryBackend) DeletePullRequestApprovalRule(prID, ruleName string) (string, error)
DeletePullRequestApprovalRule deletes an approval rule from a pull request, returning its ID. The real DeletePullRequestApprovalRuleOutput echoes ApprovalRuleId as a required field (api_op_DeletePullRequestApprovalRule.go:48).
func (*InMemoryBackend) DeleteRepository ¶
func (b *InMemoryBackend) DeleteRepository(name string) (*Repository, error)
DeleteRepository deletes a repository by name and cascades to branches, commits, template associations, files, triggers, and pull requests targeting this repository.
func (*InMemoryBackend) DescribeMergeConflicts ¶
func (b *InMemoryBackend) DescribeMergeConflicts( repoName, destSpec, sourceSpec, mergeOption, filePath string, q MergeQuery, ) (*DescribeMergeConflictsResult, error)
DescribeMergeConflicts describes the conflict of one file, paging its hunks.
func (*InMemoryBackend) DescribePullRequestEvents ¶
func (b *InMemoryBackend) DescribePullRequestEvents(prID, eventType, actorARN string) ([]PullRequestEvent, error)
DescribePullRequestEvents returns events for a pull request, optionally filtered to a single pullRequestEventType (DescribePullRequestEventsInput. PullRequestEventType, api_op_DescribePullRequestEvents.go: "Optional. The pull request event type about which you want to return information.") and/or a single actorARN (DescribePullRequestEventsInput.ActorArn: "The Amazon Resource Name (ARN) of the user whose actions resulted in the event.").
func (*InMemoryBackend) DisassociateApprovalRuleTemplateFromRepository ¶
func (b *InMemoryBackend) DisassociateApprovalRuleTemplateFromRepository(templateName, repositoryName string) error
DisassociateApprovalRuleTemplateFromRepository removes an approval rule template association from a repository.
func (*InMemoryBackend) EvaluatePullRequestApprovalRules ¶
func (b *InMemoryBackend) EvaluatePullRequestApprovalRules(prID string) ([]RuleEvaluation, error)
EvaluatePullRequestApprovalRules evaluates all approval rules for a pull request.
func (*InMemoryBackend) GetApprovalRuleTemplate ¶
func (b *InMemoryBackend) GetApprovalRuleTemplate(name string) (*ApprovalRuleTemplate, error)
GetApprovalRuleTemplate retrieves an approval rule template by name.
func (*InMemoryBackend) GetBlob ¶
func (b *InMemoryBackend) GetBlob(repoName, blobID string) ([]byte, error)
GetBlob returns the content of a blob by blobID.
func (*InMemoryBackend) GetBranch ¶
func (b *InMemoryBackend) GetBranch(repositoryName, branchName string) (*Branch, error)
GetBranch returns a branch by repository and branch name.
func (*InMemoryBackend) GetComment ¶
func (b *InMemoryBackend) GetComment(commentID string) (*Comment, error)
GetComment retrieves a comment by ID.
func (*InMemoryBackend) GetCommentReactions ¶
func (b *InMemoryBackend) GetCommentReactions(commentID string) ([]Reaction, error)
GetCommentReactions returns reactions for a comment.
func (*InMemoryBackend) GetCommentsForComparedCommit ¶
func (b *InMemoryBackend) GetCommentsForComparedCommit( repoName, afterCommitID, beforeCommitID string, ) ([]*Comment, error)
GetCommentsForComparedCommit returns comments on a commit pair, oldest first. An empty beforeCommitID matches any.
func (*InMemoryBackend) GetCommentsForPullRequest ¶
func (b *InMemoryBackend) GetCommentsForPullRequest( prID, repoName, beforeCommitID, afterCommitID string, ) ([]*Comment, error)
GetCommentsForPullRequest returns comments on a pull request, oldest first, optionally narrowed to a repository and commit pair.
func (*InMemoryBackend) GetCommit ¶
func (b *InMemoryBackend) GetCommit(repositoryName, commitID string) (*Commit, error)
GetCommit returns a commit by repository and commit ID.
func (*InMemoryBackend) GetDifferences ¶
func (b *InMemoryBackend) GetDifferences( repoName, afterCommitSpecifier, beforeCommitSpecifier, nextToken string, maxResults int, afterPath string, ) (page.Page[FileDifference], error)
GetDifferences returns a page of file differences between beforeCommitSpecifier and afterCommitSpecifier. When beforeCommitSpecifier is empty, returns all files in afterCommitSpecifier as ADDed. nextToken and maxResults implement AWS's cursor-based pagination for this op.
func (*InMemoryBackend) GetFile ¶
func (b *InMemoryBackend) GetFile(repoName, commitSpecifier, filePath string) (*File, error)
GetFile retrieves a file by repository, commit specifier, and path.
func (*InMemoryBackend) GetFolder ¶
func (b *InMemoryBackend) GetFolder(repoName, commitSpecifier, folderPath string) ([]string, error)
GetFolder lists file paths under a folder path.
func (*InMemoryBackend) GetFolderFiles ¶
func (b *InMemoryBackend) GetFolderFiles(repoName, commitSpecifier, folderPath string) ([]*File, error)
GetFolderFiles returns file metadata (path, blobId, fileMode) for files under a folder path. This provides richer info than GetFolder for handler responses matching the AWS API shape.
func (*InMemoryBackend) GetMergeCommit ¶
func (b *InMemoryBackend) GetMergeCommit( repoName, sourceSpec, destSpec string, s MergeSettings, ) (*MergeCommitResult, error)
GetMergeCommit returns the merge commit of the two specifiers, creating the unreferenced three-way commit if absent; unresolved conflicts leave it empty.
func (*InMemoryBackend) GetMergeConflicts ¶
func (b *InMemoryBackend) GetMergeConflicts( repoName, sourceSpec, destSpec, mergeOption string, q MergeQuery, ) (*MergeConflictsResult, error)
GetMergeConflicts reports whether the two commits merge cleanly and lists the conflicting files.
func (*InMemoryBackend) GetMergeOptions ¶
func (b *InMemoryBackend) GetMergeOptions( repoName, sourceSpec, destSpec string, s MergeSettings, ) (*MergeOptionsResult, error)
GetMergeOptions lists the merge strategies available for the two commits.
func (*InMemoryBackend) GetPullRequest ¶
func (b *InMemoryBackend) GetPullRequest(prID string) (*PullRequest, error)
GetPullRequest returns a pull request by ID.
func (*InMemoryBackend) GetPullRequestApprovalStates ¶
func (b *InMemoryBackend) GetPullRequestApprovalStates(prID string) ([]PullRequestApproval, error)
GetPullRequestApprovalStates returns the approval states for a pull request.
func (*InMemoryBackend) GetPullRequestOverrideState ¶
func (b *InMemoryBackend) GetPullRequestOverrideState(prID string) (bool, string, error)
GetPullRequestOverrideState returns whether a PR has been overridden and by whom.
func (*InMemoryBackend) GetRepository ¶
func (b *InMemoryBackend) GetRepository(name string) (*Repository, error)
GetRepository returns a repository by name.
func (*InMemoryBackend) GetRepositoryTriggers ¶
func (b *InMemoryBackend) GetRepositoryTriggers(repoName string) ([]RepositoryTrigger, error)
GetRepositoryTriggers returns triggers for a repository.
func (*InMemoryBackend) ListApprovalRuleTemplates ¶
func (b *InMemoryBackend) ListApprovalRuleTemplates() []*ApprovalRuleTemplate
ListApprovalRuleTemplates returns all approval rule templates.
func (*InMemoryBackend) ListAssociatedApprovalRuleTemplatesForRepository ¶
func (b *InMemoryBackend) ListAssociatedApprovalRuleTemplatesForRepository(repoName string) ([]string, error)
ListAssociatedApprovalRuleTemplatesForRepository returns template names associated with a repository.
func (*InMemoryBackend) ListBranches ¶
func (b *InMemoryBackend) ListBranches(repositoryName string) ([]string, error)
ListBranches returns all branch names for a repository in sorted order.
func (*InMemoryBackend) ListFileCommitHistory ¶
func (b *InMemoryBackend) ListFileCommitHistory( repoName, filePath, nextToken string, maxResults int, ) (page.Page[FileVersionEntry], error)
ListFileCommitHistory returns a page of FileVersionEntry describing the commits that touched the given filePath, oldest first, each paired with the blob ID that commit wrote for the path (empty when that commit deleted it). When filePath is empty (real AWS marks FilePath required, but a raw HTTP client could omit it), every commit in the repository is returned instead, with FilePath/BlobID left empty since no single path applies.
func (*InMemoryBackend) ListPullRequests ¶
func (b *InMemoryBackend) ListPullRequests(repositoryName, pullRequestStatus, authorARN string) ([]string, error)
ListPullRequests returns pull request IDs for a repository, optionally filtered by status. IDs are returned in numeric descending order (newest first), matching AWS behaviour. pullRequestStatus accepts "OPEN" or "CLOSED" (empty means return all); a merged pull request's status is "CLOSED", matching types.PullRequestStatusEnum, which has no MERGED member.
func (*InMemoryBackend) ListRepositories ¶
func (b *InMemoryBackend) ListRepositories() []*Repository
ListRepositories returns all repositories sorted by name.
func (*InMemoryBackend) ListRepositoriesForApprovalRuleTemplate ¶
func (b *InMemoryBackend) ListRepositoriesForApprovalRuleTemplate(templateName string) ([]string, error)
ListRepositoriesForApprovalRuleTemplate returns repository names that have a given template associated.
func (*InMemoryBackend) ListTagsForResource ¶
func (b *InMemoryBackend) ListTagsForResource(resourceARN string) (map[string]string, error)
ListTagsForResource returns tags for a repository by ARN.
func (*InMemoryBackend) MergeBase ¶
func (b *InMemoryBackend) MergeBase(repoName, sourceID, destID string) string
MergeBase returns the nearest common ancestor of two commits (a commit is its own ancestor), or "" when their histories are unrelated.
func (*InMemoryBackend) MergeBranchesByFastForward ¶
func (b *InMemoryBackend) MergeBranchesByFastForward( repoName, sourceRef, destinationRef, targetBranch string, ) (*Commit, error)
MergeBranchesByFastForward merges branches by fast-forward: the target branch's tip is moved to the resolved source commit and no commit is created.
func (*InMemoryBackend) MergeBranchesBySquash ¶ added in v1.3.1
func (b *InMemoryBackend) MergeBranchesBySquash( repoName, sourceSpecifier, destSpecifier string, opts MergeBranchesOptions, ) (*Commit, error)
MergeBranchesBySquash merges source into destination as one new commit on top of the destination tip; the source's own commits are not parents.
func (*InMemoryBackend) MergeBranchesByThreeWay ¶ added in v1.3.1
func (b *InMemoryBackend) MergeBranchesByThreeWay( repoName, sourceSpecifier, destSpecifier string, opts MergeBranchesOptions, ) (*Commit, error)
MergeBranchesByThreeWay merges source into destination as a merge commit with two parents, the destination tip first.
func (*InMemoryBackend) MergePullRequestByFastForward ¶
func (b *InMemoryBackend) MergePullRequestByFastForward( prID, repoName, sourceCommitID string, opts MergePullRequestOptions, ) (*PullRequest, error)
MergePullRequestByFastForward merges a pull request by fast-forward.
func (*InMemoryBackend) MergePullRequestBySquash ¶
func (b *InMemoryBackend) MergePullRequestBySquash( prID, repoName, sourceCommitID string, opts MergePullRequestOptions, ) (*PullRequest, error)
MergePullRequestBySquash merges a pull request by squash.
func (*InMemoryBackend) MergePullRequestByThreeWay ¶
func (b *InMemoryBackend) MergePullRequestByThreeWay( prID, repoName, sourceCommitID string, opts MergePullRequestOptions, ) (*PullRequest, error)
MergePullRequestByThreeWay merges a pull request by three-way merge.
func (*InMemoryBackend) OverridePullRequestApprovalRules ¶
func (b *InMemoryBackend) OverridePullRequestApprovalRules(prID, overrideStatus, overriderARN string) error
OverridePullRequestApprovalRules sets the override status for a pull request.
func (*InMemoryBackend) PostComment ¶
func (b *InMemoryBackend) PostComment(cc CommentContext, content string) (*Comment, error)
PostComment creates a comment on a compared commit or, when ctx.PullRequestID is set, a pull request.
func (*InMemoryBackend) PostCommentReply ¶
func (b *InMemoryBackend) PostCommentReply(inReplyTo, content, authorARN string) (*Comment, error)
PostCommentReply creates a reply that inherits its parent's commit or pull request context.
func (*InMemoryBackend) PutCommentReaction ¶
func (b *InMemoryBackend) PutCommentReaction(commentID, emoji, userARN string) error
PutCommentReaction adds a reaction to a comment on behalf of userARN (the resolved caller identity -- PutCommentReactionInput carries no client-supplied ARN field, matching OverridePullRequestApprovalRules' same convention, see handler_pull_requests.go). Idempotent per (commentID, emoji, userARN): reacting twice with the same emoji does not duplicate the entry, matching a real "Put" operation's semantics.
func (*InMemoryBackend) PutFile ¶
func (b *InMemoryBackend) PutFile( repoName, branchName, filePath string, content []byte, meta PutFileMetadata, ) (*Commit, string, error)
PutFile stores a file and creates a commit. It returns the new commit and the blob ID of the stored file content (AWS's PutFileOutput.BlobId is a required field, so callers must round-trip this into GetBlob).
parentCommitId is optional here, matching CreateCommit's established convention in this backend (see CreateCommit's doc comment): when provided, it is checked against the branch tip; when omitted, no race detection happens, same relaxation CreateCommit already makes versus AWS's stricter "required for a non-empty branch" rule.
func (*InMemoryBackend) PutRepositoryTriggers ¶
func (b *InMemoryBackend) PutRepositoryTriggers(repoName string, triggers []RepositoryTrigger) error
PutRepositoryTriggers replaces triggers for a repository.
func (*InMemoryBackend) Region ¶
func (b *InMemoryBackend) Region() string
Region returns the AWS region this backend is configured for.
func (*InMemoryBackend) Reset ¶
func (b *InMemoryBackend) Reset()
Reset clears all backend state, returning it to a pristine empty state.
func (*InMemoryBackend) ResolveCommitSpecifier ¶
func (b *InMemoryBackend) ResolveCommitSpecifier(repoName, specifier string) (string, error)
ResolveCommitSpecifier resolves a branch name or full commit ID to a commit ID, taking the read lock itself -- the exported counterpart of resolveCommitSpecifier for callers (handleGetMergeCommit) that are not already holding b.mu.
func (*InMemoryBackend) Restore ¶
func (b *InMemoryBackend) Restore(ctx context.Context, data []byte) error
Restore deserializes state from JSON. It implements persistence.Persistable.
func (*InMemoryBackend) Snapshot ¶
func (b *InMemoryBackend) Snapshot(ctx context.Context) []byte
Snapshot serializes current state to JSON. It implements persistence.Persistable.
func (*InMemoryBackend) TagResource ¶
func (b *InMemoryBackend) TagResource(resourceARN string, kv map[string]string) error
TagResource adds or replaces tags on a repository by ARN.
func (*InMemoryBackend) TaggedResources ¶ added in v1.3.1
func (b *InMemoryBackend) TaggedResources() []TaggedEntry
TaggedResources returns every CodeCommit repository ARN that currently has at least one tag applied via TagResource.
func (*InMemoryBackend) TestRepositoryTriggers ¶
func (b *InMemoryBackend) TestRepositoryTriggers(repoName string, triggers []RepositoryTrigger) ([]string, error)
TestRepositoryTriggers returns the names of triggers that succeeded. It tests the trigger list passed IN THIS CALL, not whatever is currently saved via PutRepositoryTriggers -- real AWS: "does not change or create a repository trigger" (codecommit@v1.36.4 api_op_TestRepositoryTriggers.go), so the two are independent inputs.
func (*InMemoryBackend) UntagResource ¶
func (b *InMemoryBackend) UntagResource(resourceARN string, tagKeys []string) error
UntagResource removes tags from a repository by ARN.
func (*InMemoryBackend) UpdateApprovalRuleTemplateContent ¶
func (b *InMemoryBackend) UpdateApprovalRuleTemplateContent(name, content, existingSha256 string) error
UpdateApprovalRuleTemplateContent updates the content of an approval rule template; a non-empty existingSha256 must match the current content hash.
func (*InMemoryBackend) UpdateApprovalRuleTemplateDescription ¶
func (b *InMemoryBackend) UpdateApprovalRuleTemplateDescription(name, desc string) error
UpdateApprovalRuleTemplateDescription updates the description of an approval rule template.
func (*InMemoryBackend) UpdateApprovalRuleTemplateName ¶
func (b *InMemoryBackend) UpdateApprovalRuleTemplateName(oldName, newName string) error
UpdateApprovalRuleTemplateName renames an approval rule template.
func (*InMemoryBackend) UpdateComment ¶
func (b *InMemoryBackend) UpdateComment(commentID, content string) error
UpdateComment updates the content of a comment.
func (*InMemoryBackend) UpdateDefaultBranch ¶
func (b *InMemoryBackend) UpdateDefaultBranch(repoName, branchName string) error
UpdateDefaultBranch sets the default branch for a repository. AWS requires the branch to exist in the repository.
func (*InMemoryBackend) UpdatePullRequestApprovalRuleContent ¶
func (b *InMemoryBackend) UpdatePullRequestApprovalRuleContent( prID, ruleName, content, existingSha256 string, ) (*PullRequestApprovalRule, error)
UpdatePullRequestApprovalRuleContent updates the content of an approval rule on a pull request, returning the updated rule. A non-empty existingSha256 must match the hash of the current content. The real UpdatePullRequestApprovalRuleContentOutput echoes the full ApprovalRule as a required field (api_op_UpdatePullRequestApprovalRuleContent.go:82).
func (*InMemoryBackend) UpdatePullRequestApprovalState ¶
func (b *InMemoryBackend) UpdatePullRequestApprovalState(prID, userARN, approvalState string) error
UpdatePullRequestApprovalState sets the approval state for a user on a pull request. AWS rejects this operation on closed or merged pull requests.
func (*InMemoryBackend) UpdatePullRequestDescription ¶
func (b *InMemoryBackend) UpdatePullRequestDescription(prID, desc string) error
UpdatePullRequestDescription updates the description of a pull request. AWS rejects this operation on closed or merged pull requests.
func (*InMemoryBackend) UpdatePullRequestStatus ¶
func (b *InMemoryBackend) UpdatePullRequestStatus(prID, status string) error
UpdatePullRequestStatus updates the status of a pull request.
func (*InMemoryBackend) UpdatePullRequestTitle ¶
func (b *InMemoryBackend) UpdatePullRequestTitle(prID, title string) error
UpdatePullRequestTitle updates the title of a pull request. AWS rejects this operation on closed or merged pull requests.
func (*InMemoryBackend) UpdateRepositoryDescription ¶
func (b *InMemoryBackend) UpdateRepositoryDescription(name, desc string) error
UpdateRepositoryDescription sets the description of a repository.
func (*InMemoryBackend) UpdateRepositoryEncryptionKey ¶
func (b *InMemoryBackend) UpdateRepositoryEncryptionKey( name, kmsKeyID string, ) (string, string, error)
UpdateRepositoryEncryptionKey sets the KMS key ID for a repository, returning the repository ID and the KMS key ID that was previously in effect (the real UpdateRepositoryEncryptionKeyOutput echoes RepositoryId, KmsKeyId and OriginalKmsKeyId -- api_op_UpdateRepositoryEncryptionKey.go:49).
func (*InMemoryBackend) UpdateRepositoryName ¶
func (b *InMemoryBackend) UpdateRepositoryName(oldName, newName string) error
UpdateRepositoryName renames a repository from oldName to newName.
type MergeBranchesOptions ¶ added in v1.3.1
type MergeBranchesOptions struct {
TargetBranch string
CommitMessage string
AuthorName string
Email string
Settings MergeSettings
}
MergeBranchesOptions carries the optional fields MergeBranchesBySquash and MergeBranchesByThreeWay accept beyond the two commit specifiers.
type MergeCommitResult ¶
type MergeCommitResult struct {
SourceCommitID string
DestinationCommitID string
BaseCommitID string
MergedCommitID string
}
MergeCommitResult is GetMergeCommit's output.
type MergeConflict ¶
type MergeConflict struct {
MergeHunks []MergeHunk `json:"mergeHunks,omitempty"`
ConflictMetadata ConflictMetadata `json:"conflictMetadata"`
}
MergeConflict represents a single file conflict.
type MergeConflictsResult ¶
type MergeConflictsResult struct {
SourceCommitID string
DestinationCommitID string
BaseCommitID string
NextToken string
Conflicts []ConflictMetadata
Mergeable bool
}
MergeConflictsResult is GetMergeConflicts' output.
type MergeHunk ¶
type MergeHunk struct {
Source *MergeHunkDetail `json:"source,omitempty"`
Destination *MergeHunkDetail `json:"destination,omitempty"`
Base *MergeHunkDetail `json:"base,omitempty"`
IsConflict bool `json:"isConflict"`
}
MergeHunk represents a merge hunk.
type MergeHunkDetail ¶
type MergeHunkDetail struct {
HunkContent string `json:"hunkContent"`
StartLine int `json:"startLine"`
EndLine int `json:"endLine"`
}
MergeHunkDetail represents details about a merge hunk.
type MergeMetadata ¶
type MergeMetadata struct {
MergeCommitID string `json:"mergeCommitId,omitempty"`
MergeOption string `json:"mergeOption,omitempty"`
MergedBy string `json:"mergedBy,omitempty"`
IsMerged bool `json:"isMerged"`
}
MergeMetadata records how and by whom a pull request target was merged.
type MergeOperations ¶
type MergeOperations struct {
Source string `json:"source,omitempty"`
Destination string `json:"destination,omitempty"`
}
MergeOperations holds the change each side made to a file.
type MergeOptionsResult ¶
type MergeOptionsResult struct {
SourceCommitID string
DestinationCommitID string
BaseCommitID string
Options []string
}
MergeOptionsResult is GetMergeOptions' output.
type MergePullRequestOptions ¶
type MergePullRequestOptions struct {
CommitMessage string
AuthorName string
Email string
MergedBy string
Settings MergeSettings
}
MergePullRequestOptions carries the optional author/message fields of the squash and three-way pull request merges, plus the merging principal.
type MergeQuery ¶
type MergeQuery struct {
NextToken string
Settings MergeSettings
MaxFiles int
MaxHunks int
}
MergeQuery carries the paging and conflict handling inputs of the read-only merge operations.
type MergeSettings ¶
type MergeSettings struct {
Resolution *ConflictResolution
DetailLevel string
Strategy string
KeepEmptyFolders bool
}
MergeSettings carries the conflict handling inputs shared by the merge operations.
type ObjectTypes ¶
type ObjectTypes struct {
Source string `json:"source,omitempty"`
Destination string `json:"destination,omitempty"`
Base string `json:"base,omitempty"`
}
ObjectTypes holds a path's object type in the source, destination and base of a merge.
type Provider ¶
type Provider struct{}
Provider implements service.Provider for AWS CodeCommit.
func (*Provider) Init ¶
func (p *Provider) Init(ctx *service.AppContext) (service.Registerable, error)
Init initializes the CodeCommit service backend and handler.
type PullRequest ¶
type PullRequest struct {
CreationDate time.Time `json:"creationDate"`
LastActivityDate time.Time `json:"lastActivityDate"`
PullRequestID string `json:"pullRequestId"`
Title string `json:"title"`
Description string `json:"description,omitempty"`
AuthorARN string `json:"authorArn,omitempty"`
PullRequestStatus string `json:"pullRequestStatus"`
ClientRequestToken string `json:"clientRequestToken,omitempty"`
RevisionID string `json:"revisionId"`
PullRequestTargets []PullRequestTarget `json:"pullRequestTargets"`
}
PullRequest represents a CodeCommit pull request.
type PullRequestApproval ¶
type PullRequestApproval struct {
UserARN string `json:"userArn"`
ApprovalState string `json:"approvalState"`
}
PullRequestApproval represents a user's approval state for a pull request.
type PullRequestApprovalRule ¶
type PullRequestApprovalRule struct {
RuleID string `json:"approvalRuleId"`
RuleName string `json:"approvalRuleName"`
ApprovalRuleContent string `json:"approvalRuleContent"`
PRID string `json:"-"`
}
PullRequestApprovalRule represents an approval rule on a pull request.
PRID identifies the owning pull request. It exists purely so the flattened store.Table[PullRequestApprovalRule] (see store_setup.go; this collection was previously nested prID -> ruleName -> *rule) can derive its composite "prID|ruleName" key from the value alone; it is not part of the CodeCommit wire API, hence json:"-".
type PullRequestEvent ¶
type PullRequestEvent struct {
EventDate time.Time
PullRequestEventType string `json:"pullRequestEventType"`
// ActorARN is the ARN of the caller whose action produced this event
// (DescribePullRequestEventsInput.ActorArn, codecommit@v1.36.4
// api_op_DescribePullRequestEvents.go:36-39). Empty when the
// event-generating op ran without a resolved caller identity.
ActorARN string `json:"actorArn,omitempty"`
}
PullRequestEvent represents an event on a pull request. EventDate is time.Time, not string: the real PullRequestEvent.EventDate deserializes from a json.Number via ParseEpochSeconds (deserializers.go), so wiring it through as an RFC3339 string breaks every real SDK client's DescribePullRequestEvents call outright (see toWirePullRequestEvent).
type PullRequestTarget ¶
type PullRequestTarget struct {
MergeMetadata *MergeMetadata `json:"mergeMetadata,omitempty"`
RepositoryName string `json:"repositoryName"`
SourceReference string `json:"sourceReference"`
DestinationReference string `json:"destinationReference,omitempty"`
SourceCommit string `json:"sourceCommit,omitempty"`
DestinationCommit string `json:"destinationCommit,omitempty"`
MergeBase string `json:"mergeBase,omitempty"`
}
PullRequestTarget represents a target for a pull request.
type PutFileEntry ¶
type PutFileEntry struct {
FilePath string `json:"filePath"`
FileMode string `json:"fileMode"`
FileContent []byte `json:"fileContent"`
}
PutFileEntry describes a file to add or overwrite in a CreateCommit call.
type PutFileMetadata ¶ added in v1.5.0
type PutFileMetadata struct {
FileMode string
AuthorName string
AuthorEmail string
CommitMessage string
ParentCommitID string
}
PutFileMetadata carries PutFile's optional commit-authoring fields (commitMessage/name/email/fileMode/parentCommitId on AWS's PutFileInput). Previously dropped entirely: the resulting commit always got a synthetic "Add <path>" message and no author/committer identity, and concurrent writers were never checked against parentCommitId.
type ReplaceContentEntry ¶
type ReplaceContentEntry struct {
FilePath string
ReplacementType string
FileMode string
Content []byte
}
ReplaceContentEntry replaces a conflicting file's content.
type Repository ¶
type Repository struct {
CreationDate time.Time `json:"creationDate"`
LastModifiedDate time.Time `json:"lastModifiedDate"`
Tags *tags.Tags `json:"tags,omitempty"`
RepositoryName string `json:"repositoryName"`
RepositoryID string `json:"repositoryId"`
ARN string `json:"arn"`
Description string `json:"repositoryDescription,omitempty"`
AccountID string `json:"accountId"`
Region string `json:"-"`
CloneURLHTTP string `json:"cloneUrlHttp"`
CloneURLSSH string `json:"cloneUrlSsh"`
KmsKeyID string `json:"kmsKeyId,omitempty"`
DefaultBranch string `json:"defaultBranch,omitempty"`
}
Repository represents an AWS CodeCommit repository.
The Tags field is backend-owned. Callers must treat the returned pointer as read-only; mutate tags only via TagResource / CreateRepository.
type RepositoryTrigger ¶
type RepositoryTrigger struct {
Name string `json:"name"`
DestinationARN string `json:"destinationArn"`
Events []string `json:"events"`
}
RepositoryTrigger represents a trigger on a repository.
type RuleEvaluation ¶
type RuleEvaluation struct {
RuleName string `json:"approvalRuleName"`
Satisfied bool `json:"satisfied"`
}
RuleEvaluation represents the evaluation of a pull request approval rule.
type SetFileModeEntry ¶
SetFileModeEntry sets a conflicting file's mode.
type TaggedEntry ¶ added in v1.3.1
TaggedEntry pairs a resource ARN with its tag map, for cross-service tag enumeration by the Resource Groups Tagging API (see cli.go's wireTaggingCodeCommit).
Source Files
¶
- approval_rules.go
- branches.go
- comments.go
- commits.go
- errors.go
- files.go
- handler.go
- handler_approval_rules.go
- handler_branches.go
- handler_comments.go
- handler_commits.go
- handler_files.go
- handler_merges.go
- handler_pull_requests.go
- handler_reactions.go
- handler_repositories.go
- handler_tags.go
- handler_triggers.go
- idempotency.go
- linediff.go
- merge_engine.go
- merge_query.go
- merge_resolve.go
- merge_settings.go
- merges.go
- models.go
- persistence.go
- provider.go
- pull_requests.go
- reactions.go
- region_handler.go
- repositories.go
- store.go
- store_setup.go
- tags.go
- trees.go
- triggers.go