Documentation
¶
Index ¶
- Variables
- func ConvertIssues(issues []*githubmodel.Issue) []*cluster.Artifact
- func ConvertPullRequests(prs []*githubmodel.PullRequest) []*cluster.Artifact
- func ParseArtifactID(id string) (artifactType string, number int, err error)
- type Adapter
- type GitHubAdapter
- func (a *GitHubAdapter) ConvertIssue(issue interface{}) (*cluster.Artifact, error)
- func (a *GitHubAdapter) ConvertPullRequest(pr interface{}) (*cluster.Artifact, error)
- func (a *GitHubAdapter) FetchArtifacts(ctx context.Context, token, owner, repo string) ([]cluster.Artifact, error)
- func (a *GitHubAdapter) GetPlatform() cluster.SourcePlatform
Constants ¶
This section is empty.
Variables ¶
View Source
var ( ErrInvalidIssueType = errors.New("invalid issue type: expected *github.Issue") ErrInvalidPRType = errors.New("invalid pull request type: expected *github.PullRequest") )
Common errors for adapter operations
Functions ¶
func ConvertIssues ¶
func ConvertIssues(issues []*githubmodel.Issue) []*cluster.Artifact
ConvertIssues is a convenience function to convert multiple issues
func ConvertPullRequests ¶
func ConvertPullRequests(prs []*githubmodel.PullRequest) []*cluster.Artifact
ConvertPullRequests is a convenience function to convert multiple PRs
Types ¶
type Adapter ¶
type Adapter interface {
// ConvertIssue converts a platform-specific issue to a cluster.Artifact
ConvertIssue(issue interface{}) (*cluster.Artifact, error)
// ConvertPullRequest converts a platform-specific pull request to a cluster.Artifact
ConvertPullRequest(pr interface{}) (*cluster.Artifact, error)
// GetPlatform returns the source platform identifier
GetPlatform() cluster.SourcePlatform
// FetchArtifacts fetches all artifacts (issues, PRs, etc.) as a standardized type from the platform
FetchArtifacts(ctx context.Context, token, owner, repo string) ([]cluster.Artifact, error)
}
Adapter defines the interface for converting platform-specific artifacts into the standardized cluster.Artifact model
type GitHubAdapter ¶
type GitHubAdapter struct{}
GitHubAdapter implements the Adapter interface for GitHub
func NewGitHubAdapter ¶
func NewGitHubAdapter() *GitHubAdapter
NewGitHubAdapter creates a new GitHub adapter instance
func (*GitHubAdapter) ConvertIssue ¶
func (a *GitHubAdapter) ConvertIssue(issue interface{}) (*cluster.Artifact, error)
ConvertIssue converts a GitHub issue to a cluster.Artifact
func (*GitHubAdapter) ConvertPullRequest ¶
func (a *GitHubAdapter) ConvertPullRequest(pr interface{}) (*cluster.Artifact, error)
ConvertPullRequest converts a GitHub pull request to a cluster.Artifact
func (*GitHubAdapter) FetchArtifacts ¶
func (a *GitHubAdapter) FetchArtifacts(ctx context.Context, token, owner, repo string) ([]cluster.Artifact, error)
FetchArtifacts fetches all artifacts (issues and PRs) from GitHub
func (*GitHubAdapter) GetPlatform ¶
func (a *GitHubAdapter) GetPlatform() cluster.SourcePlatform
GetPlatform returns the GitHub platform identifier
Click to show internal directories.
Click to hide internal directories.