Documentation ¶
Index ¶
- Constants
- func FromURL(repoURL string, options ...ProviderOption) (Provider, Repository, error)
- type Comment
- type GitHubProvider
- func (p GitHubProvider) AddCommentToPullRequest(ctx context.Context, pr PullRequest, body []byte) (*Comment, error)
- func (p GitHubProvider) ListPullRequests(ctx context.Context, repo Repository) ([]PullRequest, error)
- func (p *GitHubProvider) SetHostname(hostname string) error
- func (p *GitHubProvider) SetLogger(log logr.Logger) error
- func (p *GitHubProvider) SetToken(tokenType, token string) error
- func (p *GitHubProvider) Setup() error
- type Provider
- type ProviderOption
- type ProviderType
- type PullRequest
- type Repository
Constants ¶
View Source
const ( ProviderGitHub = ProviderType(giturlapis.ProviderGitHub) ProviderGitlab = ProviderType(giturlapis.ProviderGitLab) ProviderBitbucket = ProviderType(giturlapis.ProviderBitBucket) ProviderAzure = ProviderType(giturlapis.ProviderAzure) )
View Source
const APITokenType = "api-token"
Variables ¶
This section is empty.
Functions ¶
func FromURL ¶
func FromURL(repoURL string, options ...ProviderOption) (Provider, Repository, error)
Types ¶
type GitHubProvider ¶
type GitHubProvider struct {
// contains filtered or unexported fields
}
func (GitHubProvider) AddCommentToPullRequest ¶
func (p GitHubProvider) AddCommentToPullRequest(ctx context.Context, pr PullRequest, body []byte) (*Comment, error)
func (GitHubProvider) ListPullRequests ¶
func (p GitHubProvider) ListPullRequests(ctx context.Context, repo Repository) ([]PullRequest, error)
func (*GitHubProvider) SetHostname ¶
func (p *GitHubProvider) SetHostname(hostname string) error
func (*GitHubProvider) SetToken ¶
func (p *GitHubProvider) SetToken(tokenType, token string) error
func (*GitHubProvider) Setup ¶
func (p *GitHubProvider) Setup() error
type Provider ¶
type Provider interface { ListPullRequests(ctx context.Context, repo Repository) ([]PullRequest, error) AddCommentToPullRequest(ctx context.Context, repo PullRequest, body []byte) (*Comment, error) SetLogger(logr.Logger) error SetToken(tokenType, token string) error SetHostname(hostname string) error Setup() error }
func New ¶
func New(provider ProviderType, options ...ProviderOption) (Provider, error)
type ProviderOption ¶
func WithDomain ¶
func WithDomain(domain string) ProviderOption
func WithLogger ¶
func WithLogger(log logr.Logger) ProviderOption
func WithToken ¶
func WithToken(tokenType, token string) ProviderOption
type ProviderType ¶
type ProviderType string
type PullRequest ¶
type Repository ¶
func (Repository) String ¶
func (r Repository) String() string
Click to show internal directories.
Click to hide internal directories.