Documentation
¶
Overview ¶
Package v2 the v2 version of plugin sdk
Index ¶
- type PluginClient
- func (p *PluginClient) AuthCheck(ctx context.Context, option metav1alpha1.AuthCheckOptions) (*metav1alpha1.AuthCheck, error)
- func (p *PluginClient) AuthToken(ctx context.Context) (*metav1alpha1.AuthToken, error)
- func (p *PluginClient) CheckAlive(ctx context.Context) error
- func (p *PluginClient) CreateGitBranch(ctx context.Context, payload metav1alpha1.CreateBranchPayload) (metav1alpha1.GitBranch, error)
- func (p *PluginClient) CreateGitCommit(ctx context.Context, option coderepositoryv1alpha1.CreateGitCommitOption) (metav1alpha1.GitCommit, error)
- func (p *PluginClient) CreateGitCommitComment(ctx context.Context, payload metav1alpha1.CreateCommitCommentPayload) (metav1alpha1.GitCommitComment, error)
- func (p *PluginClient) CreateGitCommitStatus(ctx context.Context, payload metav1alpha1.CreateCommitStatusPayload) (metav1alpha1.GitCommitStatus, error)
- func (p *PluginClient) CreateGitRepoFile(ctx context.Context, payload metav1alpha1.CreateRepoFilePayload) (metav1alpha1.GitCommit, error)
- func (p *PluginClient) CreateProject(ctx context.Context, project *metav1alpha1.Project) (*metav1alpha1.Project, error)
- func (p *PluginClient) CreatePullRequest(ctx context.Context, payload metav1alpha1.CreatePullRequestPayload) (metav1alpha1.GitPullRequest, error)
- func (p *PluginClient) CreatePullRequestComment(ctx context.Context, payload metav1alpha1.CreatePullRequestCommentPayload) (metav1alpha1.GitPullRequestNote, error)
- func (p *PluginClient) CreateTestCaseExecution(ctx context.Context, params metav1alpha1.TestProjectOptions, ...) (*metav1alpha1.TestCaseExecution, error)
- func (p *PluginClient) DeleteArtifact(ctx context.Context, params metav1alpha1.ArtifactOptions) error
- func (p *PluginClient) DeleteArtifactTag(ctx context.Context, params metav1alpha1.ArtifactTagOptions) error
- func (p *PluginClient) DeleteProjectArtifact(ctx context.Context, params metav1alpha1.ProjectArtifactOptions) error
- func (p *PluginClient) GetArtifact(ctx context.Context, params metav1alpha1.ArtifactOptions) (*metav1alpha1.Artifact, error)
- func (p *PluginClient) GetCodeQuality(ctx context.Context, projectKey string) (*metav1alpha1.CodeQuality, error)
- func (p *PluginClient) GetCodeQualityLineCharts(ctx context.Context, opt metav1alpha1.CodeQualityLineChartOption) (*metav1alpha1.CodeQualityLineChart, error)
- func (p *PluginClient) GetCodeQualityOverviewByBranch(ctx context.Context, opt metav1alpha1.CodeQualityBaseOption) (*metav1alpha1.CodeQuality, error)
- func (p *PluginClient) GetGitBranch(ctx context.Context, repo metav1alpha1.GitRepo, branch string) (metav1alpha1.GitBranch, error)
- func (p *PluginClient) GetGitCommit(ctx context.Context, option metav1alpha1.GitCommitOption) (metav1alpha1.GitCommit, error)
- func (p *PluginClient) GetGitPullRequest(ctx context.Context, option metav1alpha1.GitPullRequestOption) (metav1alpha1.GitPullRequest, error)
- func (p *PluginClient) GetGitRepoFile(ctx context.Context, option metav1alpha1.GitRepoFileOption) (metav1alpha1.GitRepoFile, error)
- func (p *PluginClient) GetGitRepository(ctx context.Context, repoOption metav1alpha1.GitRepo) (metav1alpha1.GitRepository, error)
- func (p *PluginClient) GetGitRepositoryFileTree(ctx context.Context, option metav1alpha1.GitRepoFileTreeOption, ...) (metav1alpha1.GitRepositoryFileTree, error)
- func (p *PluginClient) GetGitRepositoryTag(ctx context.Context, option metav1alpha1.GitTag) (metav1alpha1.GitRepositoryTag, error)
- func (p *PluginClient) GetOverview(ctx context.Context) (*metav1alpha1.CodeQualityProjectOverview, error)
- func (p *PluginClient) GetProject(ctx context.Context, id string) (*metav1alpha1.Project, error)
- func (p *PluginClient) GetProjectArtifact(ctx context.Context, params metav1alpha1.ProjectArtifactOptions) (*metav1alpha1.Artifact, error)
- func (p *PluginClient) GetProjectArtifactFile(ctx context.Context, params metav1alpha1.ProjectArtifactOptions) (io.ReadCloser, error)
- func (p *PluginClient) GetSubTypeProject(ctx context.Context, getOption types.GetProjectOption) (*metav1alpha1.Project, error)
- func (p *PluginClient) GetSummaryByTaskID(ctx context.Context, opt metav1alpha1.CodeQualityTaskOption) (*metav1alpha1.CodeQualityTaskMetrics, error)
- func (p *PluginClient) GetTestCase(ctx context.Context, params metav1alpha1.TestProjectOptions) (*metav1alpha1.TestCase, error)
- func (p *PluginClient) GetTestPlan(ctx context.Context, params metav1alpha1.TestProjectOptions) (*metav1alpha1.TestPlan, error)
- func (p *PluginClient) GetToolMetadata(ctx context.Context) (*metav1alpha1.ToolMeta, error)
- func (p *PluginClient) Initialize(ctx context.Context) error
- func (p *PluginClient) ListArtifacts(ctx context.Context, params metav1alpha1.ArtifactOptions, ...) (*metav1alpha1.ArtifactList, error)
- func (p *PluginClient) ListBlobStores(ctx context.Context, listOption metav1alpha1.ListOptions) (*metav1alpha1.BlobStoreList, error)
- func (p *PluginClient) ListGitBranch(ctx context.Context, branchOption metav1alpha1.GitBranchOption, ...) (metav1alpha1.GitBranchList, error)
- func (p *PluginClient) ListGitCommit(ctx context.Context, option metav1alpha1.GitCommitListOption, ...) (metav1alpha1.GitCommitList, error)
- func (p *PluginClient) ListGitCommitComment(ctx context.Context, option metav1alpha1.GitCommitOption, ...) (metav1alpha1.GitCommitCommentList, error)
- func (p *PluginClient) ListGitCommitStatus(ctx context.Context, option metav1alpha1.GitCommitOption, ...) (metav1alpha1.GitCommitStatusList, error)
- func (p *PluginClient) ListGitPullRequest(ctx context.Context, option metav1alpha1.GitPullRequestListOption, ...) (metav1alpha1.GitPullRequestList, error)
- func (p *PluginClient) ListGitRepository(ctx context.Context, id, keyword string, subtype metav1alpha1.ProjectSubType, ...) (metav1alpha1.GitRepositoryList, error)
- func (p *PluginClient) ListGitRepositoryTag(ctx context.Context, option metav1alpha1.GitRepositoryTagListOption, ...) (metav1alpha1.GitRepositoryTagList, error)
- func (p *PluginClient) ListProjectArtifacts(ctx context.Context, params metav1alpha1.ArtifactOptions, ...) (*metav1alpha1.ArtifactList, error)
- func (p *PluginClient) ListProjects(ctx context.Context, option metav1alpha1.ListOptions) (*metav1alpha1.ProjectList, error)
- func (p *PluginClient) ListPullRequestComment(ctx context.Context, option metav1alpha1.GitPullRequestOption, ...) (metav1alpha1.GitPullRequestNoteList, error)
- func (p *PluginClient) ListRepositories(ctx context.Context, params metav1alpha1.RepositoryOptions, ...) (*metav1alpha1.RepositoryList, error)
- func (p *PluginClient) ListTestCaseExecutions(ctx context.Context, params metav1alpha1.TestProjectOptions, ...) (*metav1alpha1.TestCaseExecutionList, error)
- func (p *PluginClient) ListTestCases(ctx context.Context, params metav1alpha1.TestProjectOptions, ...) (*metav1alpha1.TestCaseList, error)
- func (p *PluginClient) ListTestModules(ctx context.Context, params metav1alpha1.TestProjectOptions, ...) (*metav1alpha1.TestModuleList, error)
- func (p *PluginClient) ListTestPlans(ctx context.Context, params metav1alpha1.TestProjectOptions, ...) (*metav1alpha1.TestPlanList, error)
- func (p *PluginClient) UpdatePullRequestComment(ctx context.Context, payload metav1alpha1.UpdatePullRequestCommentPayload) (metav1alpha1.GitPullRequestNote, error)
- func (p *PluginClient) UploadArtifact(ctx context.Context, params metav1alpha1.ProjectArtifactOptions, r io.Reader) error
- func (p *PluginClient) WithClassAddress(classAddress *duckv1.Addressable) *PluginClient
- func (p *PluginClient) WithMeta(meta base.Meta) *PluginClient
- func (p *PluginClient) WithRequestOptions(opts ...base.OptionFunc) *PluginClient
- func (p *PluginClient) WithSecret(secret corev1.Secret) *PluginClient
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type PluginClient ¶
type PluginClient struct {
types.Interface
*base.PluginClient
}
PluginClient describe a plugin client with version 2
func NewPluginClient ¶
func NewPluginClient(pluginAddress *duckv1.Addressable, meta base.Meta, secret corev1.Secret, opts ...base.BuildOptions) *PluginClient
NewPluginClient construct a new plugin client
func (*PluginClient) AuthCheck ¶
func (p *PluginClient) AuthCheck(ctx context.Context, option metav1alpha1.AuthCheckOptions) (*metav1alpha1.AuthCheck, error)
AuthCheck check authorization
func (*PluginClient) AuthToken ¶
func (p *PluginClient) AuthToken(ctx context.Context) (*metav1alpha1.AuthToken, error)
AuthToken generate token or refresh token
func (*PluginClient) CheckAlive ¶
func (p *PluginClient) CheckAlive(ctx context.Context) error
CheckAlive check plugin alive
func (*PluginClient) CreateGitBranch ¶
func (p *PluginClient) CreateGitBranch(ctx context.Context, payload metav1alpha1.CreateBranchPayload) (metav1alpha1.GitBranch, error)
CreateGitBranch create git branch
func (*PluginClient) CreateGitCommit ¶
func (p *PluginClient) CreateGitCommit(ctx context.Context, option coderepositoryv1alpha1.CreateGitCommitOption) (metav1alpha1.GitCommit, error)
CreateGitCommit create git commit
func (*PluginClient) CreateGitCommitComment ¶
func (p *PluginClient) CreateGitCommitComment(ctx context.Context, payload metav1alpha1.CreateCommitCommentPayload) (metav1alpha1.GitCommitComment, error)
CreateGitCommitComment create a git commit comment
func (*PluginClient) CreateGitCommitStatus ¶
func (p *PluginClient) CreateGitCommitStatus(ctx context.Context, payload metav1alpha1.CreateCommitStatusPayload) (metav1alpha1.GitCommitStatus, error)
CreateGitCommitStatus create git commit status
func (*PluginClient) CreateGitRepoFile ¶
func (p *PluginClient) CreateGitRepoFile(ctx context.Context, payload metav1alpha1.CreateRepoFilePayload) (metav1alpha1.GitCommit, error)
CreateGitRepoFile create a new repo file
func (*PluginClient) CreateProject ¶
func (p *PluginClient) CreateProject(ctx context.Context, project *metav1alpha1.Project) (*metav1alpha1.Project, error)
CreateProject create project
func (*PluginClient) CreatePullRequest ¶
func (p *PluginClient) CreatePullRequest(ctx context.Context, payload metav1alpha1.CreatePullRequestPayload) (metav1alpha1.GitPullRequest, error)
CreatePullRequest create a pull request
func (*PluginClient) CreatePullRequestComment ¶
func (p *PluginClient) CreatePullRequestComment(ctx context.Context, payload metav1alpha1.CreatePullRequestCommentPayload) (metav1alpha1.GitPullRequestNote, error)
CreatePullRequestComment create a pull request comment
func (*PluginClient) CreateTestCaseExecution ¶
func (p *PluginClient) CreateTestCaseExecution(ctx context.Context, params metav1alpha1.TestProjectOptions, payload metav1alpha1.TestCaseExecution) (*metav1alpha1.TestCaseExecution, error)
CreateTestCaseExecution create test case execution
func (*PluginClient) DeleteArtifact ¶
func (p *PluginClient) DeleteArtifact(ctx context.Context, params metav1alpha1.ArtifactOptions) error
DeleteArtifact delete a artifact
func (*PluginClient) DeleteArtifactTag ¶
func (p *PluginClient) DeleteArtifactTag(ctx context.Context, params metav1alpha1.ArtifactTagOptions) error
DeleteArtifactTag delete a specific tag of the artifact.
func (*PluginClient) DeleteProjectArtifact ¶
func (p *PluginClient) DeleteProjectArtifact(ctx context.Context, params metav1alpha1.ProjectArtifactOptions) error
DeleteProjectArtifact delete project artifact
func (*PluginClient) GetArtifact ¶
func (p *PluginClient) GetArtifact(ctx context.Context, params metav1alpha1.ArtifactOptions) (*metav1alpha1.Artifact, error)
GetArtifact get artifact detail
func (*PluginClient) GetCodeQuality ¶
func (p *PluginClient) GetCodeQuality(ctx context.Context, projectKey string) (*metav1alpha1.CodeQuality, error)
GetCodeQuality get code quality data of a specific project
func (*PluginClient) GetCodeQualityLineCharts ¶
func (p *PluginClient) GetCodeQualityLineCharts(ctx context.Context, opt metav1alpha1.CodeQualityLineChartOption) (*metav1alpha1.CodeQualityLineChart, error)
GetCodeQualityLineCharts get code quality data used for line charts
func (*PluginClient) GetCodeQualityOverviewByBranch ¶
func (p *PluginClient) GetCodeQualityOverviewByBranch(ctx context.Context, opt metav1alpha1.CodeQualityBaseOption) (*metav1alpha1.CodeQuality, error)
GetCodeQualityOverviewByBranch get code quality data of a specific branch
func (*PluginClient) GetGitBranch ¶
func (p *PluginClient) GetGitBranch(ctx context.Context, repo metav1alpha1.GitRepo, branch string) (metav1alpha1.GitBranch, error)
GetGitBranch get specific git branch
func (*PluginClient) GetGitCommit ¶
func (p *PluginClient) GetGitCommit(ctx context.Context, option metav1alpha1.GitCommitOption) (metav1alpha1.GitCommit, error)
GetGitCommit get git commit detail
func (*PluginClient) GetGitPullRequest ¶
func (p *PluginClient) GetGitPullRequest(ctx context.Context, option metav1alpha1.GitPullRequestOption) (metav1alpha1.GitPullRequest, error)
GetGitPullRequest get a pull request
func (*PluginClient) GetGitRepoFile ¶
func (p *PluginClient) GetGitRepoFile(ctx context.Context, option metav1alpha1.GitRepoFileOption) (metav1alpha1.GitRepoFile, error)
GetGitRepoFile get a repo file content
func (*PluginClient) GetGitRepository ¶
func (p *PluginClient) GetGitRepository(ctx context.Context, repoOption metav1alpha1.GitRepo) (metav1alpha1.GitRepository, error)
GetGitRepository get git repository
func (*PluginClient) GetGitRepositoryFileTree ¶
func (p *PluginClient) GetGitRepositoryFileTree(ctx context.Context, option metav1alpha1.GitRepoFileTreeOption, listOption metav1alpha1.ListOptions) (metav1alpha1.GitRepositoryFileTree, error)
GetGitRepositoryFileTree get git repository file tree
func (*PluginClient) GetGitRepositoryTag ¶
func (p *PluginClient) GetGitRepositoryTag(ctx context.Context, option metav1alpha1.GitTag) (metav1alpha1.GitRepositoryTag, error)
GetGitRepositoryTag get git repository tag
func (*PluginClient) GetOverview ¶
func (p *PluginClient) GetOverview(ctx context.Context) (*metav1alpha1.CodeQualityProjectOverview, error)
GetOverview get code quality overview data
func (*PluginClient) GetProject ¶
func (p *PluginClient) GetProject(ctx context.Context, id string) (*metav1alpha1.Project, error)
GetProject get project
func (*PluginClient) GetProjectArtifact ¶
func (p *PluginClient) GetProjectArtifact(ctx context.Context, params metav1alpha1.ProjectArtifactOptions) (*metav1alpha1.Artifact, error)
GetProjectArtifact get project artifact
func (*PluginClient) GetProjectArtifactFile ¶
func (p *PluginClient) GetProjectArtifactFile(ctx context.Context, params metav1alpha1.ProjectArtifactOptions) (io.ReadCloser, error)
GetProjectArtifactFile download project artifact file Note: you must close the io.ReadCloser after use or it will cause a memory leak
func (*PluginClient) GetSubTypeProject ¶
func (p *PluginClient) GetSubTypeProject(ctx context.Context, getOption types.GetProjectOption) (*metav1alpha1.Project, error)
GetSubTypeProject get project with subtype
func (*PluginClient) GetSummaryByTaskID ¶
func (p *PluginClient) GetSummaryByTaskID(ctx context.Context, opt metav1alpha1.CodeQualityTaskOption) (*metav1alpha1.CodeQualityTaskMetrics, error)
GetSummaryByTaskID get code quality summary data by task id
func (*PluginClient) GetTestCase ¶
func (p *PluginClient) GetTestCase(ctx context.Context, params metav1alpha1.TestProjectOptions) (*metav1alpha1.TestCase, error)
GetTestCase get test case
func (*PluginClient) GetTestPlan ¶
func (p *PluginClient) GetTestPlan(ctx context.Context, params metav1alpha1.TestProjectOptions) (*metav1alpha1.TestPlan, error)
GetTestPlan get test plan
func (*PluginClient) GetToolMetadata ¶
func (p *PluginClient) GetToolMetadata(ctx context.Context) (*metav1alpha1.ToolMeta, error)
GetToolMetadata get tool metadata
func (*PluginClient) Initialize ¶
func (p *PluginClient) Initialize(ctx context.Context) error
Initialize initialize plugin
func (*PluginClient) ListArtifacts ¶
func (p *PluginClient) ListArtifacts(ctx context.Context, params metav1alpha1.ArtifactOptions, option metav1alpha1.ListOptions) (*metav1alpha1.ArtifactList, error)
ListArtifacts list artifacts
func (*PluginClient) ListBlobStores ¶
func (p *PluginClient) ListBlobStores(ctx context.Context, listOption metav1alpha1.ListOptions) (*metav1alpha1.BlobStoreList, error)
ListBlobStores list blob stores
func (*PluginClient) ListGitBranch ¶
func (p *PluginClient) ListGitBranch(ctx context.Context, branchOption metav1alpha1.GitBranchOption, option metav1alpha1.ListOptions) (metav1alpha1.GitBranchList, error)
ListGitBranch list git branches
func (*PluginClient) ListGitCommit ¶
func (p *PluginClient) ListGitCommit(ctx context.Context, option metav1alpha1.GitCommitListOption, listOption metav1alpha1.ListOptions) (metav1alpha1.GitCommitList, error)
ListGitCommit list git commits
func (*PluginClient) ListGitCommitComment ¶
func (p *PluginClient) ListGitCommitComment(ctx context.Context, option metav1alpha1.GitCommitOption, listOption metav1alpha1.ListOptions) (metav1alpha1.GitCommitCommentList, error)
ListGitCommitComment list git commit comment
func (*PluginClient) ListGitCommitStatus ¶
func (p *PluginClient) ListGitCommitStatus(ctx context.Context, option metav1alpha1.GitCommitOption, listOption metav1alpha1.ListOptions) (metav1alpha1.GitCommitStatusList, error)
ListGitCommitStatus list git commit status
func (*PluginClient) ListGitPullRequest ¶
func (p *PluginClient) ListGitPullRequest(ctx context.Context, option metav1alpha1.GitPullRequestListOption, listOption metav1alpha1.ListOptions) (metav1alpha1.GitPullRequestList, error)
ListGitPullRequest list pull requests
func (*PluginClient) ListGitRepository ¶
func (p *PluginClient) ListGitRepository(ctx context.Context, id, keyword string, subtype metav1alpha1.ProjectSubType, listOption metav1alpha1.ListOptions) (metav1alpha1.GitRepositoryList, error)
ListGitRepository list git repositories
func (*PluginClient) ListGitRepositoryTag ¶
func (p *PluginClient) ListGitRepositoryTag(ctx context.Context, option metav1alpha1.GitRepositoryTagListOption, listOption metav1alpha1.ListOptions) (metav1alpha1.GitRepositoryTagList, error)
ListGitRepositoryTag list git repository tags
func (*PluginClient) ListProjectArtifacts ¶
func (p *PluginClient) ListProjectArtifacts(ctx context.Context, params metav1alpha1.ArtifactOptions, option metav1alpha1.ListOptions) (*metav1alpha1.ArtifactList, error)
ListProjectArtifacts list project artifacts
func (*PluginClient) ListProjects ¶
func (p *PluginClient) ListProjects(ctx context.Context, option metav1alpha1.ListOptions) (*metav1alpha1.ProjectList, error)
ListProjects list projects
func (*PluginClient) ListPullRequestComment ¶
func (p *PluginClient) ListPullRequestComment(ctx context.Context, option metav1alpha1.GitPullRequestOption, listOption metav1alpha1.ListOptions) (metav1alpha1.GitPullRequestNoteList, error)
ListPullRequestComment list pull request comments
func (*PluginClient) ListRepositories ¶
func (p *PluginClient) ListRepositories(ctx context.Context, params metav1alpha1.RepositoryOptions, option metav1alpha1.ListOptions) (*metav1alpha1.RepositoryList, error)
ListRepositories list repositories
func (*PluginClient) ListTestCaseExecutions ¶
func (p *PluginClient) ListTestCaseExecutions(ctx context.Context, params metav1alpha1.TestProjectOptions, option metav1alpha1.ListOptions) (*metav1alpha1.TestCaseExecutionList, error)
ListTestCaseExecutions list test case executions
func (*PluginClient) ListTestCases ¶
func (p *PluginClient) ListTestCases(ctx context.Context, params metav1alpha1.TestProjectOptions, option metav1alpha1.ListOptions) (*metav1alpha1.TestCaseList, error)
ListTestCases list test cases
func (*PluginClient) ListTestModules ¶
func (p *PluginClient) ListTestModules(ctx context.Context, params metav1alpha1.TestProjectOptions, option metav1alpha1.ListOptions) (*metav1alpha1.TestModuleList, error)
ListTestModules list test modules
func (*PluginClient) ListTestPlans ¶
func (p *PluginClient) ListTestPlans(ctx context.Context, params metav1alpha1.TestProjectOptions, option metav1alpha1.ListOptions) (*metav1alpha1.TestPlanList, error)
ListTestPlans list test plans
func (*PluginClient) UpdatePullRequestComment ¶
func (p *PluginClient) UpdatePullRequestComment(ctx context.Context, payload metav1alpha1.UpdatePullRequestCommentPayload) (metav1alpha1.GitPullRequestNote, error)
UpdatePullRequestComment update a pull request comment
func (*PluginClient) UploadArtifact ¶
func (p *PluginClient) UploadArtifact(ctx context.Context, params metav1alpha1.ProjectArtifactOptions, r io.Reader) error
UploadArtifact upload artifact file
func (*PluginClient) WithClassAddress ¶
func (p *PluginClient) WithClassAddress(classAddress *duckv1.Addressable) *PluginClient
WithClassAddress set class address of target plugin
func (*PluginClient) WithMeta ¶
func (p *PluginClient) WithMeta(meta base.Meta) *PluginClient
WithMeta set metadata of target tool
func (*PluginClient) WithRequestOptions ¶
func (p *PluginClient) WithRequestOptions(opts ...base.OptionFunc) *PluginClient
WithRequestOptions set options for the next request
func (*PluginClient) WithSecret ¶
func (p *PluginClient) WithSecret(secret corev1.Secret) *PluginClient
WithSecret set authorization secret of target tool
Source Files
¶
- artifact.go
- auth.go
- blobstore.go
- client.go
- code_quality.go
- doc.go
- gitbranch.go
- gitcommentstatus.go
- gitcommit.go
- gitcommitcomment.go
- gitcontent.go
- gitfiletree.go
- gitpullrequest.go
- gitrepository.go
- gitrepotag.go
- project.go
- projectartifact.go
- repository.go
- testcase.go
- testcaseexecution.go
- testmodule.go
- testplan.go
- tool_metadata.go
- tool_service.go