Documentation
¶
Overview ¶
Package codegurureviewer implements the AWS CodeGuru Reviewer service.
Index ¶
- type AssociateRepositoryInput
- type AssociateRepositoryResponse
- type CodeCommitRepository
- type CodeReview
- type CodeReviewResponse
- type CreateCodeReviewInput
- type ErrorResponse
- type ListCodeReviewsResponse
- type ListRecommendationFeedbackResponse
- type ListRecommendationsResponse
- type ListRepositoryAssociationsResponse
- type MemoryStorage
- func (m *MemoryStorage) AssociateRepository(input *AssociateRepositoryInput) *RepositoryAssociation
- func (m *MemoryStorage) Close() error
- func (m *MemoryStorage) CreateCodeReview(input *CreateCodeReviewInput) (*CodeReview, error)
- func (m *MemoryStorage) DescribeCodeReview(arn string) (*CodeReview, error)
- func (m *MemoryStorage) DescribeRecommendationFeedback(codeReviewArn, recommendationID string) (*RecommendationFeedback, error)
- func (m *MemoryStorage) DescribeRepositoryAssociation(arn string) (*RepositoryAssociation, error)
- func (m *MemoryStorage) DisassociateRepository(arn string) (*RepositoryAssociation, error)
- func (m *MemoryStorage) ListCodeReviews() []CodeReview
- func (m *MemoryStorage) ListRecommendationFeedback(codeReviewArn string) []RecommendationFeedback
- func (m *MemoryStorage) ListRecommendations(_ string) []RecommendationSummary
- func (m *MemoryStorage) ListRepositoryAssociations() []RepositoryAssociationSummary
- func (m *MemoryStorage) MarshalJSON() ([]byte, error)
- func (m *MemoryStorage) PutRecommendationFeedback(input *PutRecommendationFeedbackInput) error
- func (m *MemoryStorage) UnmarshalJSON(data []byte) error
- type Option
- type PutRecommendationFeedbackInput
- type RecommendationFeedback
- type RecommendationFeedbackResponse
- type RecommendationSummary
- type RepositoryAssociation
- type RepositoryAssociationSummary
- type RepositoryInput
- type S3Repository
- type Service
- func (s *Service) AssociateRepository(w http.ResponseWriter, r *http.Request)
- func (s *Service) Close() error
- func (s *Service) CreateCodeReview(w http.ResponseWriter, r *http.Request)
- func (s *Service) DescribeCodeReview(w http.ResponseWriter, r *http.Request)
- func (s *Service) DescribeRecommendationFeedback(w http.ResponseWriter, r *http.Request)
- func (s *Service) DescribeRepositoryAssociation(w http.ResponseWriter, r *http.Request)
- func (s *Service) DisassociateRepository(w http.ResponseWriter, r *http.Request)
- func (s *Service) ListCodeReviews(w http.ResponseWriter, _ *http.Request)
- func (s *Service) ListRecommendationFeedback(w http.ResponseWriter, r *http.Request)
- func (s *Service) ListRecommendations(w http.ResponseWriter, r *http.Request)
- func (s *Service) ListRepositoryAssociations(w http.ResponseWriter, _ *http.Request)
- func (s *Service) Name() string
- func (s *Service) Prefix() string
- func (s *Service) PutRecommendationFeedback(w http.ResponseWriter, r *http.Request)
- func (s *Service) RegisterRoutes(r service.Router)
- type Storage
- type ThirdPartySourceRepository
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type AssociateRepositoryInput ¶
type AssociateRepositoryInput struct {
Repository *RepositoryInput `json:"Repository"`
Tags map[string]string `json:"Tags,omitempty"`
}
AssociateRepositoryInput represents the request body for AssociateRepository.
type AssociateRepositoryResponse ¶
type AssociateRepositoryResponse struct {
RepositoryAssociation *RepositoryAssociation `json:"RepositoryAssociation"`
Tags map[string]string `json:"Tags,omitempty"`
}
AssociateRepositoryResponse represents the response for AssociateRepository.
type CodeCommitRepository ¶
type CodeCommitRepository struct {
Name string `json:"Name"`
}
CodeCommitRepository represents a CodeCommit repository.
type CodeReview ¶
type CodeReview struct {
AssociationArn string `json:"AssociationArn"`
CodeReviewArn string `json:"CodeReviewArn"`
CreatedTimeStamp float64 `json:"CreatedTimeStamp"`
LastUpdatedTimeStamp float64 `json:"LastUpdatedTimeStamp"`
Name string `json:"Name"`
Owner string `json:"Owner"`
ProviderType string `json:"ProviderType"`
RepositoryName string `json:"RepositoryName"`
State string `json:"State"`
StateReason string `json:"StateReason,omitempty"`
Type string `json:"Type"`
}
CodeReview represents a CodeGuru Reviewer code review.
type CodeReviewResponse ¶
type CodeReviewResponse struct {
CodeReview *CodeReview `json:"CodeReview"`
}
CodeReviewResponse represents the response for CreateCodeReview/DescribeCodeReview.
type CreateCodeReviewInput ¶
type CreateCodeReviewInput struct {
Name string `json:"Name"`
RepositoryAssociationArn string `json:"RepositoryAssociationArn"`
}
CreateCodeReviewInput represents the request body for CreateCodeReview.
type ErrorResponse ¶
ErrorResponse represents an error response.
type ListCodeReviewsResponse ¶
type ListCodeReviewsResponse struct {
CodeReviewSummaries []CodeReview `json:"CodeReviewSummaries"`
NextToken string `json:"NextToken,omitempty"`
}
ListCodeReviewsResponse represents the response for ListCodeReviews.
type ListRecommendationFeedbackResponse ¶
type ListRecommendationFeedbackResponse struct {
RecommendationFeedbackSummaries []RecommendationFeedback `json:"RecommendationFeedbackSummaries"`
NextToken string `json:"NextToken,omitempty"`
}
ListRecommendationFeedbackResponse represents the response for ListRecommendationFeedback.
type ListRecommendationsResponse ¶
type ListRecommendationsResponse struct {
RecommendationSummaries []RecommendationSummary `json:"RecommendationSummaries"`
NextToken string `json:"NextToken,omitempty"`
}
ListRecommendationsResponse represents the response for ListRecommendations.
type ListRepositoryAssociationsResponse ¶
type ListRepositoryAssociationsResponse struct {
RepositoryAssociationSummaries []RepositoryAssociationSummary `json:"RepositoryAssociationSummaries"`
NextToken string `json:"NextToken,omitempty"`
}
ListRepositoryAssociationsResponse represents the response for ListRepositoryAssociations.
type MemoryStorage ¶
type MemoryStorage struct {
Associations map[string]*RepositoryAssociation `json:"associations"`
CodeReviews map[string]*CodeReview `json:"codeReviews"`
Feedback map[string]map[string]*RecommendationFeedback `json:"feedback"` // codeReviewArn -> recommendationID -> feedback
// contains filtered or unexported fields
}
MemoryStorage is an in-memory implementation of Storage.
func NewMemoryStorage ¶
func NewMemoryStorage(opts ...Option) *MemoryStorage
NewMemoryStorage creates a new in-memory storage.
func (*MemoryStorage) AssociateRepository ¶
func (m *MemoryStorage) AssociateRepository(input *AssociateRepositoryInput) *RepositoryAssociation
AssociateRepository creates a new repository association.
func (*MemoryStorage) Close ¶ added in v0.6.0
func (m *MemoryStorage) Close() error
Close saves the storage state to disk if persistence is enabled.
func (*MemoryStorage) CreateCodeReview ¶
func (m *MemoryStorage) CreateCodeReview(input *CreateCodeReviewInput) (*CodeReview, error)
CreateCodeReview creates a new code review.
func (*MemoryStorage) DescribeCodeReview ¶
func (m *MemoryStorage) DescribeCodeReview(arn string) (*CodeReview, error)
DescribeCodeReview returns a code review by ARN.
func (*MemoryStorage) DescribeRecommendationFeedback ¶
func (m *MemoryStorage) DescribeRecommendationFeedback(codeReviewArn, recommendationID string) (*RecommendationFeedback, error)
DescribeRecommendationFeedback returns feedback for a recommendation.
func (*MemoryStorage) DescribeRepositoryAssociation ¶
func (m *MemoryStorage) DescribeRepositoryAssociation(arn string) (*RepositoryAssociation, error)
DescribeRepositoryAssociation returns a repository association by ARN.
func (*MemoryStorage) DisassociateRepository ¶
func (m *MemoryStorage) DisassociateRepository(arn string) (*RepositoryAssociation, error)
DisassociateRepository removes a repository association.
func (*MemoryStorage) ListCodeReviews ¶
func (m *MemoryStorage) ListCodeReviews() []CodeReview
ListCodeReviews returns all code reviews.
func (*MemoryStorage) ListRecommendationFeedback ¶
func (m *MemoryStorage) ListRecommendationFeedback(codeReviewArn string) []RecommendationFeedback
ListRecommendationFeedback returns all feedback for a code review.
func (*MemoryStorage) ListRecommendations ¶
func (m *MemoryStorage) ListRecommendations(_ string) []RecommendationSummary
ListRecommendations returns recommendations for a code review.
func (*MemoryStorage) ListRepositoryAssociations ¶
func (m *MemoryStorage) ListRepositoryAssociations() []RepositoryAssociationSummary
ListRepositoryAssociations returns all repository associations.
func (*MemoryStorage) MarshalJSON ¶ added in v0.6.0
func (m *MemoryStorage) MarshalJSON() ([]byte, error)
MarshalJSON serializes the storage state to JSON.
func (*MemoryStorage) PutRecommendationFeedback ¶
func (m *MemoryStorage) PutRecommendationFeedback(input *PutRecommendationFeedbackInput) error
PutRecommendationFeedback stores feedback for a recommendation.
func (*MemoryStorage) UnmarshalJSON ¶ added in v0.6.0
func (m *MemoryStorage) UnmarshalJSON(data []byte) error
UnmarshalJSON restores the storage state from JSON.
type Option ¶ added in v0.6.0
type Option func(*MemoryStorage)
Option is a configuration option for MemoryStorage.
func WithDataDir ¶ added in v0.6.0
WithDataDir enables persistent storage in the specified directory.
type PutRecommendationFeedbackInput ¶
type PutRecommendationFeedbackInput struct {
CodeReviewArn string `json:"CodeReviewArn"`
Reactions []string `json:"Reactions"`
RecommendationID string `json:"RecommendationId"`
}
PutRecommendationFeedbackInput represents the request body for PutRecommendationFeedback.
type RecommendationFeedback ¶
type RecommendationFeedback struct {
CodeReviewArn string `json:"CodeReviewArn"`
CreatedTimeStamp float64 `json:"CreatedTimeStamp"`
LastUpdatedTimeStamp float64 `json:"LastUpdatedTimeStamp"`
Reactions []string `json:"Reactions"`
RecommendationID string `json:"RecommendationId"`
UserID string `json:"UserId"`
}
RecommendationFeedback represents feedback on a recommendation.
type RecommendationFeedbackResponse ¶
type RecommendationFeedbackResponse struct {
RecommendationFeedback *RecommendationFeedback `json:"RecommendationFeedback"`
}
RecommendationFeedbackResponse represents the response for DescribeRecommendationFeedback.
type RecommendationSummary ¶
type RecommendationSummary struct {
Description string `json:"Description"`
EndLine int `json:"EndLine"`
FilePath string `json:"FilePath"`
RecommendationID string `json:"RecommendationId"`
Severity string `json:"Severity,omitempty"`
StartLine int `json:"StartLine"`
RecommendationCategory string `json:"RecommendationCategory,omitempty"`
}
RecommendationSummary represents a recommendation from a code review.
type RepositoryAssociation ¶
type RepositoryAssociation struct {
AssociationArn string `json:"AssociationArn"`
AssociationID string `json:"AssociationId"`
ConnectionArn string `json:"ConnectionArn,omitempty"`
CreatedTimeStamp float64 `json:"CreatedTimeStamp"`
LastUpdatedTimeStamp float64 `json:"LastUpdatedTimeStamp"`
Name string `json:"Name"`
Owner string `json:"Owner"`
ProviderType string `json:"ProviderType"`
State string `json:"State"`
StateReason string `json:"StateReason,omitempty"`
Tags map[string]string `json:"Tags,omitempty"`
}
RepositoryAssociation represents a CodeGuru Reviewer repository association.
type RepositoryAssociationSummary ¶
type RepositoryAssociationSummary struct {
AssociationArn string `json:"AssociationArn"`
AssociationID string `json:"AssociationId"`
ConnectionArn string `json:"ConnectionArn,omitempty"`
LastUpdatedTimeStamp float64 `json:"LastUpdatedTimeStamp"`
Name string `json:"Name"`
Owner string `json:"Owner"`
ProviderType string `json:"ProviderType"`
State string `json:"State"`
}
RepositoryAssociationSummary represents a summary of a repository association.
type RepositoryInput ¶
type RepositoryInput struct {
CodeCommit *CodeCommitRepository `json:"CodeCommit,omitempty"`
Bitbucket *ThirdPartySourceRepository `json:"Bitbucket,omitempty"`
GitHubEnterpriseServer *ThirdPartySourceRepository `json:"GitHubEnterpriseServer,omitempty"`
S3Bucket *S3Repository `json:"S3Bucket,omitempty"`
}
RepositoryInput represents a repository in an associate request.
type S3Repository ¶
S3Repository represents an S3 repository.
type Service ¶
type Service struct {
// contains filtered or unexported fields
}
Service implements the AWS CodeGuru Reviewer service.
func (*Service) AssociateRepository ¶
func (s *Service) AssociateRepository(w http.ResponseWriter, r *http.Request)
AssociateRepository handles POST /associations.
func (*Service) CreateCodeReview ¶
func (s *Service) CreateCodeReview(w http.ResponseWriter, r *http.Request)
CreateCodeReview handles POST /codereviews.
func (*Service) DescribeCodeReview ¶
func (s *Service) DescribeCodeReview(w http.ResponseWriter, r *http.Request)
DescribeCodeReview handles GET /codereviews/{CodeReviewArn}.
func (*Service) DescribeRecommendationFeedback ¶
func (s *Service) DescribeRecommendationFeedback(w http.ResponseWriter, r *http.Request)
DescribeRecommendationFeedback handles GET /feedback/{CodeReviewArn}.
func (*Service) DescribeRepositoryAssociation ¶
func (s *Service) DescribeRepositoryAssociation(w http.ResponseWriter, r *http.Request)
DescribeRepositoryAssociation handles GET /associations/{AssociationArn}.
func (*Service) DisassociateRepository ¶
func (s *Service) DisassociateRepository(w http.ResponseWriter, r *http.Request)
DisassociateRepository handles DELETE /associations/{AssociationArn}.
func (*Service) ListCodeReviews ¶
func (s *Service) ListCodeReviews(w http.ResponseWriter, _ *http.Request)
ListCodeReviews handles GET /codereviews.
func (*Service) ListRecommendationFeedback ¶
func (s *Service) ListRecommendationFeedback(w http.ResponseWriter, r *http.Request)
ListRecommendationFeedback handles GET /feedback/{CodeReviewArn}/RecommendationFeedback.
func (*Service) ListRecommendations ¶
func (s *Service) ListRecommendations(w http.ResponseWriter, r *http.Request)
ListRecommendations handles GET /codereviews/{CodeReviewArn}/Recommendations.
func (*Service) ListRepositoryAssociations ¶
func (s *Service) ListRepositoryAssociations(w http.ResponseWriter, _ *http.Request)
ListRepositoryAssociations handles GET /associations.
func (*Service) PutRecommendationFeedback ¶
func (s *Service) PutRecommendationFeedback(w http.ResponseWriter, r *http.Request)
PutRecommendationFeedback handles PUT /feedback.
func (*Service) RegisterRoutes ¶
RegisterRoutes registers routes with the router.
type Storage ¶
type Storage interface {
AssociateRepository(input *AssociateRepositoryInput) *RepositoryAssociation
DescribeRepositoryAssociation(arn string) (*RepositoryAssociation, error)
DisassociateRepository(arn string) (*RepositoryAssociation, error)
ListRepositoryAssociations() []RepositoryAssociationSummary
CreateCodeReview(input *CreateCodeReviewInput) (*CodeReview, error)
DescribeCodeReview(arn string) (*CodeReview, error)
ListCodeReviews() []CodeReview
ListRecommendations(codeReviewArn string) []RecommendationSummary
PutRecommendationFeedback(input *PutRecommendationFeedbackInput) error
DescribeRecommendationFeedback(codeReviewArn, recommendationID string) (*RecommendationFeedback, error)
ListRecommendationFeedback(codeReviewArn string) []RecommendationFeedback
}
Storage defines the interface for CodeGuru Reviewer storage operations.
type ThirdPartySourceRepository ¶
type ThirdPartySourceRepository struct {
ConnectionArn string `json:"ConnectionArn"`
Name string `json:"Name"`
Owner string `json:"Owner"`
}
ThirdPartySourceRepository represents a third-party repository.