codecommit

package
v1.10.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Aug 4, 2026 License: MIT Imports: 8 Imported by: 0

Documentation

Index

Constants

View Source
const (
	PRStatusOpen   = "OPEN"
	PRStatusClosed = "CLOSED"
	PRStatusMerged = "MERGED"
)

Pull request status constants.

Variables

This section is empty.

Functions

This section is empty.

Types

type BlobInfo

type BlobInfo struct {
	BlobID string
	Path   string
	Mode   string
}

BlobInfo describes a file blob in a diff.

type Branch

type Branch struct {
	Name     string
	CommitID string
}

Branch represents a branch within a repository.

type CodeCommitService

type CodeCommitService struct {
	// contains filtered or unexported fields
}

CodeCommitService is the cloudmock implementation of the AWS CodeCommit API.

func New

func New(accountID, region string) *CodeCommitService

New returns a new CodeCommitService for the given AWS account ID and region.

func NewWithLocator

func NewWithLocator(accountID, region string, locator ServiceLocator) *CodeCommitService

NewWithLocator returns a new CodeCommitService with a ServiceLocator.

func (*CodeCommitService) Actions

func (s *CodeCommitService) Actions() []service.Action

Actions returns the list of CodeCommit API actions supported.

func (*CodeCommitService) HandleRequest

func (s *CodeCommitService) HandleRequest(ctx *service.RequestContext) (*service.Response, error)

HandleRequest routes an incoming CodeCommit request to the appropriate handler.

func (*CodeCommitService) HealthCheck

func (s *CodeCommitService) HealthCheck() error

HealthCheck always returns nil.

func (*CodeCommitService) Name

func (s *CodeCommitService) Name() string

Name returns the AWS service name used for routing.

func (*CodeCommitService) SetLocator

func (s *CodeCommitService) SetLocator(locator ServiceLocator)

SetLocator sets the service locator for cross-service calls.

type Comment

type Comment struct {
	CommentID      string
	Content        string
	PullRequestID  string
	RepositoryName string
	BeforeCommitID string
	AfterCommitID  string
	FilePath       string
	AuthorARN      string
	CreationDate   time.Time
	LastModified   time.Time
	Deleted        bool
}

Comment represents a comment on a pull request.

type Commit

type Commit struct {
	CommitID       string
	TreeID         string
	ParentIDs      []string
	Author         UserInfo
	Committer      UserInfo
	Message        string
	AdditionalData string
}

Commit represents a single commit.

type Difference

type Difference struct {
	BeforeBlob *BlobInfo
	AfterBlob  *BlobInfo
	ChangeType string
}

Difference represents a file difference between two commits.

type MergeMetadata

type MergeMetadata struct {
	IsMerged      bool
	MergedBy      string
	MergeCommitID string
}

MergeMetadata holds merge state for a pull request.

type PullRequest

type PullRequest struct {
	ID                   string
	Title                string
	Description          string
	Status               string
	AuthorARN            string
	CreationDate         time.Time
	LastActivityDate     time.Time
	RepositoryName       string
	SourceReference      string
	DestinationReference string
	MergeMetadata        *MergeMetadata
}

PullRequest represents a pull request.

type Repository

type Repository struct {
	ID            string
	Name          string
	ARN           string
	CloneURLHTTP  string
	CloneURLSSH   string
	Description   string
	DefaultBranch string
	CreatedAt     time.Time
	LastModified  time.Time
	Tags          map[string]string
}

Repository represents a CodeCommit repository.

type RepositoryTrigger

type RepositoryTrigger struct {
	Name           string
	DestinationARN string
	CustomData     string
	Branches       []string
	Events         []string
}

RepositoryTrigger represents a trigger on a repository.

type ServiceLocator

type ServiceLocator interface {
	Lookup(name string) (service.Service, error)
}

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 CodeCommit resources.

func NewStore

func NewStore(accountID, region string) *Store

NewStore creates an empty CodeCommit store.

func (*Store) CreateBranch

func (s *Store) CreateBranch(repoName, branchName, commitID string) *service.AWSError

func (*Store) CreatePullRequest

func (s *Store) CreatePullRequest(repoName, title, description, sourceRef, destRef string) (*PullRequest, *service.AWSError)

func (*Store) CreateRepository

func (s *Store) CreateRepository(name, description string, tags map[string]string) (*Repository, *service.AWSError)

func (*Store) DeleteBranch

func (s *Store) DeleteBranch(repoName, branchName string) (*Branch, *service.AWSError)

func (*Store) DeleteRepository

func (s *Store) DeleteRepository(name string) (*Repository, *service.AWSError)

func (*Store) GetBranch

func (s *Store) GetBranch(repoName, branchName string) (*Branch, *service.AWSError)

func (*Store) GetCommentsForPullRequest

func (s *Store) GetCommentsForPullRequest(prID string) ([]*Comment, *service.AWSError)

func (*Store) GetCommit

func (s *Store) GetCommit(repoName, commitID string) (*Commit, *service.AWSError)

func (*Store) GetDifferences

func (s *Store) GetDifferences(repoName, beforeCommitSpec, afterCommitSpec string) ([]Difference, *service.AWSError)

func (*Store) GetPullRequest

func (s *Store) GetPullRequest(prID string) (*PullRequest, *service.AWSError)

func (*Store) GetRepository

func (s *Store) GetRepository(name string) (*Repository, *service.AWSError)

func (*Store) GetRepositoryTriggers

func (s *Store) GetRepositoryTriggers(repoName string) ([]RepositoryTrigger, *service.AWSError)

func (*Store) ListBranches

func (s *Store) ListBranches(repoName string) ([]string, *service.AWSError)

func (*Store) ListPullRequests

func (s *Store) ListPullRequests(repoName, status string) []string

func (*Store) ListRepositories

func (s *Store) ListRepositories() []*Repository

func (*Store) ListTagsForResource

func (s *Store) ListTagsForResource(arn string) map[string]string

func (*Store) MergePullRequestByFastForward

func (s *Store) MergePullRequestByFastForward(prID, repoName string) (*PullRequest, *service.AWSError)

func (*Store) MergePullRequestBySquash

func (s *Store) MergePullRequestBySquash(prID, repoName string) (*PullRequest, *service.AWSError)

func (*Store) PostCommentForPullRequest

func (s *Store) PostCommentForPullRequest(prID, repoName, content, beforeCommitID, afterCommitID, filePath string) (*Comment, *service.AWSError)

func (*Store) PutRepositoryTriggers

func (s *Store) PutRepositoryTriggers(repoName string, triggers []RepositoryTrigger) (string, *service.AWSError)

func (*Store) TagResource

func (s *Store) TagResource(arn string, tags map[string]string) *service.AWSError

func (*Store) UntagResource

func (s *Store) UntagResource(arn string, keys []string) *service.AWSError

func (*Store) UpdatePullRequestStatus

func (s *Store) UpdatePullRequestStatus(prID, status string) (*PullRequest, *service.AWSError)

func (*Store) UpdatePullRequestTitle

func (s *Store) UpdatePullRequestTitle(prID, title string) (*PullRequest, *service.AWSError)

func (*Store) UpdateRepositoryDescription

func (s *Store) UpdateRepositoryDescription(name, description string) *service.AWSError

func (*Store) UpdateRepositoryName

func (s *Store) UpdateRepositoryName(oldName, newName string) *service.AWSError

type UserInfo

type UserInfo struct {
	Name  string
	Email string
	Date  time.Time
}

UserInfo represents commit author/committer information.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL