Documentation
¶
Index ¶
- func NewProvider(cfg Config) (interfaces.CodeProvider, error)
- type Config
- type FetchOptions
- type Fetcher
- func (f *Fetcher) BatchProcessMRs(ctx context.Context, projectID string, filter *model.MergeRequestFilter, ...) error
- func (f *Fetcher) FetchMRsByAuthor(ctx context.Context, projectID, authorID string) ([]*model.MergeRequest, error)
- func (f *Fetcher) FetchMRsToReview(ctx context.Context, projectID string, options FetchOptions) ([]*model.MergeRequest, error)
- func (f *Fetcher) FetchOpenMRs(ctx context.Context, projectID string) ([]*model.MergeRequest, error)
- func (f *Fetcher) FetchRecentMRs(ctx context.Context, projectID string, since time.Duration) ([]*model.MergeRequest, error)
- func (f *Fetcher) PollForUpdates(ctx context.Context, projectID string, interval time.Duration, ...) error
- type ProviderType
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func NewProvider ¶
func NewProvider(cfg Config) (interfaces.CodeProvider, error)
NewProvider creates a new VCS provider based on the configuration
Types ¶
type Config ¶
type Config struct {
Type ProviderType `yaml:"type" env:"PROVIDER_TYPE"`
BaseURL string `yaml:"base_url" env:"PROVIDER_BASE_URL"`
Token string `yaml:"token" env:"PROVIDER_TOKEN"`
WebhookSecret string `yaml:"webhook_secret" env:"PROVIDER_WEBHOOK_SECRET"`
BotUsername string `yaml:"bot_username" env:"PROVIDER_BOT_USERNAME"`
}
Config represents VCS provider configuration
func (*Config) PrepareAndValidate ¶
type FetchOptions ¶
type FetchOptions struct {
TargetBranch string // Filter by target branch (e.g., "main", "develop")
UpdatedSince *time.Time // Only fetch MRs updated after this time
CreatedSince *time.Time // Only fetch MRs created after this time
Limit int // Maximum number of results (default: 50)
}
FetchOptions defines options for fetching merge requests
func (*FetchOptions) SetDefaults ¶
func (o *FetchOptions) SetDefaults()
SetDefaults sets default values for fetch options
type Fetcher ¶
type Fetcher struct {
// contains filtered or unexported fields
}
Fetcher provides utility methods for fetching merge requests from repositories
func NewFetcher ¶
func NewFetcher(provider interfaces.CodeProvider) *Fetcher
NewFetcher creates a new MR fetcher instance
func (*Fetcher) BatchProcessMRs ¶
func (f *Fetcher) BatchProcessMRs(ctx context.Context, projectID string, filter *model.MergeRequestFilter, processor func(*model.MergeRequest) error) error
BatchProcessMRs processes multiple merge requests with a callback function
func (*Fetcher) FetchMRsByAuthor ¶
func (f *Fetcher) FetchMRsByAuthor(ctx context.Context, projectID, authorID string) ([]*model.MergeRequest, error)
FetchMRsByAuthor retrieves merge requests created by a specific author
func (*Fetcher) FetchMRsToReview ¶
func (f *Fetcher) FetchMRsToReview(ctx context.Context, projectID string, options FetchOptions) ([]*model.MergeRequest, error)
FetchMRsToReview retrieves merge requests that need review based on various criteria
func (*Fetcher) FetchOpenMRs ¶
func (f *Fetcher) FetchOpenMRs(ctx context.Context, projectID string) ([]*model.MergeRequest, error)
FetchOpenMRs retrieves all open merge requests from a repository
type ProviderType ¶
type ProviderType string
const ( GitLab ProviderType = "gitlab" GitHub ProviderType = "github" Bitbucket ProviderType = "bitbucket" )
SupportedProviderTypes defines the supported VCS provider types