v2

package
v0.14.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Mar 14, 2025 License: Apache-2.0 Imports: 15 Imported by: 0

README

Design Principles

The method signatures are fully consistent with the plugin interface which defined in plugin/interface.go

Documentation

Overview

Package v2 the v2 version of plugin sdk

Index

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

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

CreateGitBranch create git branch

func (*PluginClient) CreateGitCommit

CreateGitCommit create git commit

func (*PluginClient) CreateGitCommitComment

CreateGitCommitComment create a git commit comment

func (*PluginClient) CreateGitCommitStatus

CreateGitCommitStatus create git commit status

func (*PluginClient) CreateGitRepoFile

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

CreatePullRequest create a pull request

func (*PluginClient) CreatePullRequestComment

CreatePullRequestComment create a pull request comment

func (*PluginClient) CreateTestCaseExecution

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

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

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

GetGitCommit get git commit detail

func (*PluginClient) GetGitPullRequest

GetGitPullRequest get a pull request

func (*PluginClient) GetGitRepoFile

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

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

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

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

GetSummaryByTaskID get code quality summary data by task id

func (*PluginClient) GetTestCase

GetTestCase get test case

func (*PluginClient) GetTestPlan

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

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

ListGitBranch list git branches

func (*PluginClient) ListGitCommit

ListGitCommit list git commits

func (*PluginClient) ListGitCommitComment

ListGitCommitComment list git commit comment

func (*PluginClient) ListGitCommitStatus

ListGitCommitStatus list git commit status

func (*PluginClient) ListGitPullRequest

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

ListGitRepositoryTag list git repository tags

func (*PluginClient) ListProjectArtifacts

ListProjectArtifacts list project artifacts

func (*PluginClient) ListProjects

ListProjects list projects

func (*PluginClient) ListPullRequestComment

ListPullRequestComment list pull request comments

func (*PluginClient) ListRepositories

ListRepositories list repositories

func (*PluginClient) ListTestCaseExecutions

ListTestCaseExecutions list test case executions

func (*PluginClient) ListTestCases

ListTestCases list test cases

func (*PluginClient) ListTestModules

ListTestModules list test modules

func (*PluginClient) ListTestPlans

ListTestPlans list test plans

func (*PluginClient) UpdatePullRequestComment

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

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL