autogits/workflow-pr/pr.go
2024-12-04 08:55:40 +01:00

33 lines
775 B
Go

package main
import (
"src.opensuse.org/autogits/common"
"src.opensuse.org/autogits/common/gitea-generated/models"
)
//go:generate mockgen -source=pr.go -destination=mock/pr.go -typed
type GiteaPRInterface interface {
GetAssociatedPrjGitPR(org, repo string, id int) (*models.PullRequest, error)
GetAssociatedPRs(org, repo string, id int) ([]*models.PullRequest, error)
}
type PRInterface struct {
gitea common.Gitea
}
func AllocatePRInterface(gitea common.Gitea) GiteaPRInterface {
return &PRInterface{
gitea: gitea,
}
}
func (s *PRInterface) GetAssociatedPrjGitPR(org, repo string, id int) (*models.PullRequest, error) {
return nil, nil
}
func (s *PRInterface) GetAssociatedPRs(org, repo string, id int) ([]*models.PullRequest, error) {
return nil, nil
}