Documentation
¶
Index ¶
- Constants
- Variables
- func AllowsNestedOwner(kind Kind) bool
- func DBCIChecks(checks []CICheck) []db.CICheck
- func DBIssue(repoID int64, issue Issue) *db.Issue
- func DBIssueEvent(issueID int64, event IssueEvent) db.IssueEvent
- func DBLabels(labels []Label, updatedAt time.Time) []db.Label
- func DBMREvent(mrID int64, event MergeRequestEvent) db.MREvent
- func DBMergeRequest(repoID int64, mr MergeRequest) *db.MergeRequest
- func DBRepoIdentity(ref RepoRef) db.RepoIdentity
- func DBRepositoryIdentity(repo Repository) db.RepoIdentity
- func DefaultHost(kind Kind) (string, bool)
- func HostOrDefault(kind Kind, host string) (string, bool)
- func LowercaseRepoNames(kind Kind) bool
- func ProviderNotConfigured(kind Kind, host string) error
- func UnsupportedCapability(kind Kind, host, capability string) error
- type CICheck
- type CIReader
- type Capabilities
- type CommentMutator
- type Error
- type Issue
- type IssueEvent
- type IssueMutator
- type IssueReader
- type Kind
- type Label
- type MergeMutator
- type MergeRequest
- type MergeRequestContentMutator
- type MergeRequestEvent
- type MergeRequestReader
- type MergeResult
- type Metadata
- type PlatformErrorCode
- type Provider
- type ReadyForReviewMutator
- type Registry
- func (r *Registry) CIReader(kind Kind, host string) (CIReader, error)
- func (r *Registry) Capabilities(kind Kind, host string) (Capabilities, error)
- func (r *Registry) CommentMutator(kind Kind, host string) (CommentMutator, error)
- func (r *Registry) IssueMutator(kind Kind, host string) (IssueMutator, error)
- func (r *Registry) IssueReader(kind Kind, host string) (IssueReader, error)
- func (r *Registry) MergeMutator(kind Kind, host string) (MergeMutator, error)
- func (r *Registry) MergeRequestContentMutator(kind Kind, host string) (MergeRequestContentMutator, error)
- func (r *Registry) MergeRequestReader(kind Kind, host string) (MergeRequestReader, error)
- func (r *Registry) Provider(kind Kind, host string) (Provider, error)
- func (r *Registry) ReadyForReviewMutator(kind Kind, host string) (ReadyForReviewMutator, error)
- func (r *Registry) Register(provider Provider) error
- func (r *Registry) ReleaseReader(kind Kind, host string) (ReleaseReader, error)
- func (r *Registry) RepositoryReader(kind Kind, host string) (RepositoryReader, error)
- func (r *Registry) ReviewMutator(kind Kind, host string) (ReviewMutator, error)
- func (r *Registry) StateMutator(kind Kind, host string) (StateMutator, error)
- func (r *Registry) TagReader(kind Kind, host string) (TagReader, error)
- func (r *Registry) WorkflowApprovalMutator(kind Kind, host string) (WorkflowApprovalMutator, error)
- type Release
- type ReleaseReader
- type RepoRef
- type Repository
- type RepositoryListOptions
- type RepositoryReader
- type ReviewMutator
- type StateMutator
- type Tag
- type TagReader
- type WorkflowApprovalMutator
Constants ¶
View Source
const ( DefaultGitHubHost = "github.com" DefaultGitLabHost = "gitlab.com" DefaultForgejoHost = "codeberg.org" DefaultGiteaHost = "gitea.com" )
Variables ¶
View Source
var ( ErrUnsupportedCapability = &Error{Code: ErrCodeUnsupportedCapability} ErrProviderNotConfigured = &Error{Code: ErrCodeProviderNotConfigured} ErrMissingToken = &Error{Code: ErrCodeMissingToken} ErrInvalidRepoRef = &Error{Code: ErrCodeInvalidRepoRef} ErrPermissionDenied = &Error{Code: ErrCodePermissionDenied} ErrNotFound = &Error{Code: ErrCodeNotFound} ErrRateLimited = &Error{Code: ErrCodeRateLimited} )
Functions ¶
func AllowsNestedOwner ¶
func DBCIChecks ¶
func DBIssueEvent ¶
func DBIssueEvent(issueID int64, event IssueEvent) db.IssueEvent
func DBMergeRequest ¶
func DBMergeRequest(repoID int64, mr MergeRequest) *db.MergeRequest
func DBRepoIdentity ¶
func DBRepoIdentity(ref RepoRef) db.RepoIdentity
func DBRepositoryIdentity ¶
func DBRepositoryIdentity(repo Repository) db.RepoIdentity
func DefaultHost ¶
func LowercaseRepoNames ¶
func ProviderNotConfigured ¶
func UnsupportedCapability ¶
Types ¶
type Capabilities ¶
type CommentMutator ¶
type CommentMutator interface {
CreateMergeRequestComment(
ctx context.Context,
ref RepoRef,
number int,
body string,
) (MergeRequestEvent, error)
EditMergeRequestComment(
ctx context.Context,
ref RepoRef,
number int,
commentID int64,
body string,
) (MergeRequestEvent, error)
CreateIssueComment(ctx context.Context, ref RepoRef, number int, body string) (IssueEvent, error)
EditIssueComment(ctx context.Context, ref RepoRef, number int, commentID int64, body string) (IssueEvent, error)
}
type Error ¶
type IssueEvent ¶
type IssueMutator ¶
type IssueReader ¶
type MergeMutator ¶
type MergeRequest ¶
type MergeRequest struct {
Repo RepoRef
PlatformID int64
PlatformExternalID string
Number int
URL string
Title string
Author string
AuthorDisplayName string
State string
IsDraft bool
IsLocked bool
Body string
HeadBranch string
BaseBranch string
HeadSHA string
BaseSHA string
HeadRepoCloneURL string
Additions int
Deletions int
CommentCount int
ReviewDecision string
CIStatus string
CreatedAt time.Time
UpdatedAt time.Time
LastActivityAt time.Time
MergedAt *time.Time
ClosedAt *time.Time
Labels []Label
}
type MergeRequestEvent ¶
type MergeRequestReader ¶
type MergeRequestReader interface {
ListOpenMergeRequests(ctx context.Context, ref RepoRef) ([]MergeRequest, error)
GetMergeRequest(ctx context.Context, ref RepoRef, number int) (MergeRequest, error)
ListMergeRequestEvents(
ctx context.Context,
ref RepoRef,
number int,
) ([]MergeRequestEvent, error)
}
type MergeResult ¶
type Metadata ¶
type Metadata struct {
Kind Kind
Label string
DefaultHost string
AllowNestedOwner bool
LowercaseRepoNames bool
}
func MetadataFor ¶
type PlatformErrorCode ¶
type PlatformErrorCode string
const ( ErrCodeUnsupportedCapability PlatformErrorCode = "unsupported_capability" ErrCodeProviderNotConfigured PlatformErrorCode = "provider_not_configured" ErrCodeMissingToken PlatformErrorCode = "missing_token" ErrCodeInvalidRepoRef PlatformErrorCode = "invalid_repo_ref" ErrCodePermissionDenied PlatformErrorCode = "permission_denied" ErrCodeNotFound PlatformErrorCode = "not_found" ErrCodeRateLimited PlatformErrorCode = "rate_limited" )
type Provider ¶
type Provider interface {
Platform() Kind
Host() string
Capabilities() Capabilities
}
type ReadyForReviewMutator ¶
type Registry ¶
type Registry struct {
// contains filtered or unexported fields
}
func NewRegistry ¶
func (*Registry) Capabilities ¶
func (r *Registry) Capabilities(kind Kind, host string) (Capabilities, error)
func (*Registry) CommentMutator ¶
func (r *Registry) CommentMutator(kind Kind, host string) (CommentMutator, error)
func (*Registry) IssueMutator ¶
func (r *Registry) IssueMutator(kind Kind, host string) (IssueMutator, error)
func (*Registry) IssueReader ¶
func (r *Registry) IssueReader(kind Kind, host string) (IssueReader, error)
func (*Registry) MergeMutator ¶
func (r *Registry) MergeMutator(kind Kind, host string) (MergeMutator, error)
func (*Registry) MergeRequestContentMutator ¶
func (r *Registry) MergeRequestContentMutator( kind Kind, host string, ) (MergeRequestContentMutator, error)
func (*Registry) MergeRequestReader ¶
func (r *Registry) MergeRequestReader(kind Kind, host string) (MergeRequestReader, error)
func (*Registry) ReadyForReviewMutator ¶
func (r *Registry) ReadyForReviewMutator(kind Kind, host string) (ReadyForReviewMutator, error)
func (*Registry) ReleaseReader ¶
func (r *Registry) ReleaseReader(kind Kind, host string) (ReleaseReader, error)
func (*Registry) RepositoryReader ¶
func (r *Registry) RepositoryReader(kind Kind, host string) (RepositoryReader, error)
func (*Registry) ReviewMutator ¶
func (r *Registry) ReviewMutator(kind Kind, host string) (ReviewMutator, error)
func (*Registry) StateMutator ¶
func (r *Registry) StateMutator(kind Kind, host string) (StateMutator, error)
func (*Registry) WorkflowApprovalMutator ¶
func (r *Registry) WorkflowApprovalMutator(kind Kind, host string) (WorkflowApprovalMutator, error)
type ReleaseReader ¶
type RepoRef ¶
type RepoRef struct {
Platform Kind
Host string
Owner string
Name string
RepoPath string
PlatformID int64
PlatformExternalID string
WebURL string
CloneURL string
DefaultBranch string
}
func (RepoRef) DisplayName ¶
type Repository ¶
type RepositoryListOptions ¶
type RepositoryReader ¶
type RepositoryReader interface {
GetRepository(ctx context.Context, ref RepoRef) (Repository, error)
ListRepositories(
ctx context.Context,
owner string,
opts RepositoryListOptions,
) ([]Repository, error)
}
type ReviewMutator ¶
type StateMutator ¶
Click to show internal directories.
Click to hide internal directories.