29 lines
1.3 KiB
Go
Raw Normal View History

2025-02-22 09:42:15 +01:00
package port
import (
"context"
"errors"
2025-02-22 09:42:15 +01:00
"forge.cadoles.com/wpetit/clearcase/internal/core/model"
)
var (
2025-03-06 22:47:02 +01:00
ErrFileNotFound = errors.New("file not found")
ErrPullRequestNotFound = errors.New("pull request not found")
)
2025-02-22 09:42:15 +01:00
type Forge interface {
2025-03-06 22:47:02 +01:00
ListProjects(ctx context.Context) ([]*model.Project, error)
ListOpenedPullRequests(ctx context.Context, projectID string) ([]*model.PullRequest, error)
GetPullRequestDiff(ctx context.Context, projectID string, pullRequestID string) (string, error)
GetPullRequestTemplate(ctx context.Context, projectID string) (string, error)
GetPullRequests(ctx context.Context, projectID string, pullRequestIDs ...string) ([]*model.PullRequest, error)
UpdatePullRequest(ctx context.Context, projectID string, pullRequestID string, title string, body string) (string, error)
2025-02-22 18:01:45 +01:00
CreateIssue(ctx context.Context, projectID string, title string, body string) (string, error)
2025-02-22 09:42:15 +01:00
GetIssues(ctx context.Context, projectID string, issueIDs ...string) ([]*model.Issue, error)
GetIssueTemplate(ctx context.Context, projectID string) (string, error)
GetProjectLanguages(ctx context.Context, projectID string) ([]string, error)
GetProject(ctx context.Context, projectID string) (*model.Project, error)
GetFile(ctx context.Context, projectID string, path string) ([]byte, error)
2025-02-22 09:42:15 +01:00
}