Documentation ¶
Overview ¶
Package client contains functions to add and retrieve auth from context
Index ¶
- Constants
- func AuthFilter(req *restful.Request, resp *restful.Response, chain *restful.FilterChain)
- func GetGitRepoInfo(gitAddress string) (host string, gitRepo metav1alpha1.GitRepo, err error)
- func IsNotImplementedError(err error) bool
- func MetaFilter(req *restful.Request, resp *restful.Response, chain *restful.FilterChain)
- func WithGitPluginClient(parent context.Context, gitPluginClient *GitPluginClient) context.Context
- func WithPluginClient(parent context.Context, pluginClient *PluginClient) context.Context
- type AdditionalWebhookRegister
- type ArtifactDeleter
- type ArtifactGetter
- type ArtifactLister
- type ArtifactTagDeleter
- type ArtifactTriggerRegister
- type Auth
- func (a *Auth) Basic() (AuthMethod, error)
- func (a *Auth) BearerToken(attribute string) (AuthMethod, error)
- func (a *Auth) Get(attribute string) (string, error)
- func (a *Auth) GetBasicInfo() (userName string, password string, err error)
- func (a *Auth) GetDynamicInfo() (ak string, sk string, err error)
- func (a *Auth) GetOAuth2Token() (string, error)
- func (a *Auth) Header(attribute string, header string) (AuthMethod, error)
- func (a *Auth) HeaderWithPrefix(attribute string, header string, prefix string) (AuthMethod, error)
- func (a *Auth) IsBasic() bool
- func (a *Auth) IsDynamic() bool
- func (a *Auth) IsOAuth2() bool
- func (a *Auth) OAuth2() (AuthMethod, error)
- func (a *Auth) Query(attribute string, query string) (AuthMethod, error)
- func (a *Auth) WithContext(ctx context.Context) context.Context
- type AuthChecker
- type AuthMethod
- type AuthTokenGenerator
- type BlobStoreLister
- type BuildOptions
- type Client
- type ClientArtifact
- type ClientAuth
- type ClientBlobStore
- type ClientCodeQuality
- type ClientGitBranch
- type ClientGitCommit
- type ClientGitCommitComment
- type ClientGitCommitStatus
- type ClientGitContent
- type ClientGitPullRequest
- type ClientGitRepository
- type ClientGitRepositoryFileTree
- type ClientGitRepositoryTag
- type ClientProject
- type ClientProjectGetter
- type ClientRepository
- type ClientTestCase
- type ClientTestCaseExecution
- type ClientTestModule
- type ClientTestPlan
- type ClientToolService
- type CodeQualityGetter
- type DependentResourceGetter
- type GitBranchCreator
- type GitBranchGetter
- type GitBranchLister
- type GitCommitCommentCreator
- type GitCommitCommentLister
- type GitCommitCreator
- type GitCommitGetter
- type GitCommitLister
- type GitCommitStatusCreator
- type GitCommitStatusLister
- type GitPluginClient
- type GitPullRequestCRUClient
- type GitPullRequestCommentCreator
- type GitPullRequestCommentLister
- type GitPullRequestCommentUpdater
- type GitPullRequestHandler
- type GitRepoFileCreator
- type GitRepoFileGetter
- type GitRepositoryFileTreeGetter
- type GitRepositoryGetter
- type GitRepositoryLister
- type GitRepositoryTagGetter
- type GitRepositoryTagLister
- type GitTriggerRegister
- type ImageConfigGetter
- type Initializer
- type Interface
- type IssueAttributeGetter
- type IssueBranchCreator
- type IssueBranchDeleter
- type IssueBranchLister
- type IssueGetter
- type IssueLister
- type LivenessChecker
- type Meta
- type OptionFunc
- func BodyOpts(body interface{}) OptionFunc
- func DefaultOptions() []OptionFunc
- func ErrorOpts(err interface{}) OptionFunc
- func HeaderOpts(key, value string) OptionFunc
- func ListOpts(opts metav1alpha1.ListOptions) OptionFunc
- func MetaOpts(meta Meta) OptionFunc
- func QueryOpts(params map[string]string) OptionFunc
- func ResultOpts(dest interface{}) OptionFunc
- func SecretOpts(secret corev1.Secret) OptionFunc
- type PluginAddressable
- type PluginAttributes
- type PluginClient
- func (p *PluginClient) Artifact(meta Meta, secret corev1.Secret) ClientArtifact
- func (p *PluginClient) Auth(meta Meta, secret corev1.Secret) ClientAuth
- func (p *PluginClient) BlobStore(meta Meta, secret corev1.Secret) ClientBlobStore
- func (p *PluginClient) Body(body interface{}) OptionFunc
- func (p *PluginClient) Clone() *PluginClient
- func (p *PluginClient) CodeQuality(meta Meta, secret corev1.Secret) ClientCodeQuality
- func (p *PluginClient) Delete(ctx context.Context, baseURL *duckv1.Addressable, path string, ...) error
- func (p *PluginClient) Dest(dest interface{}) OptionFunc
- func (p *PluginClient) Error(err interface{}) OptionFunc
- func (p *PluginClient) FullUrl(address *duckv1.Addressable, uri string) string
- func (p *PluginClient) Get(ctx context.Context, baseURL *duckv1.Addressable, path string, ...) error
- func (p *PluginClient) GitBranch(meta Meta, secret corev1.Secret) ClientGitBranch
- func (p *PluginClient) GitCommit(meta Meta, secret corev1.Secret) ClientGitCommit
- func (p *PluginClient) GitCommitComment(meta Meta, secret corev1.Secret) ClientGitCommitComment
- func (p *PluginClient) GitCommitStatus(meta Meta, secret corev1.Secret) ClientGitCommitStatus
- func (p *PluginClient) GitContent(meta Meta, secret corev1.Secret) ClientGitContent
- func (p *PluginClient) GitPluginClient() *GitPluginClient
- func (p *PluginClient) GitPullRequest(meta Meta, secret corev1.Secret) GitPullRequestCRUClient
- func (p *PluginClient) GitRepository(meta Meta, secret corev1.Secret) ClientGitRepository
- func (p *PluginClient) GitRepositoryFileTree(meta Meta, secret corev1.Secret) ClientGitRepositoryFileTree
- func (p *PluginClient) GitRepositoryTag(meta Meta, secret corev1.Secret) ClientGitRepositoryTag
- func (p *PluginClient) HandleError(response *resty.Response, err error) error
- func (p *PluginClient) Header(key, value string) OptionFunc
- func (p *PluginClient) ListOptions(opts metav1alpha1.ListOptions) OptionFunc
- func (p *PluginClient) Meta(meta Meta) OptionFunc
- func (p *PluginClient) NewArtifact() ClientArtifact
- func (p *PluginClient) NewAuth() ClientAuth
- func (p *PluginClient) NewBlobStore() ClientBlobStore
- func (p *PluginClient) NewCodeQuality() ClientCodeQuality
- func (p *PluginClient) NewGitBranch() ClientGitBranch
- func (p *PluginClient) NewGitCommit() ClientGitCommit
- func (p *PluginClient) NewGitCommitComment() ClientGitCommitComment
- func (p *PluginClient) NewGitCommitStatus() ClientGitCommitStatus
- func (p *PluginClient) NewGitContent() ClientGitContent
- func (p *PluginClient) NewGitPullRequest() GitPullRequestCRUClient
- func (p *PluginClient) NewGitRepository() ClientGitRepository
- func (p *PluginClient) NewGitRepositoryFileTree() ClientGitRepositoryFileTree
- func (p *PluginClient) NewGitRepositoryTag() ClientGitRepositoryTag
- func (p *PluginClient) NewProject() ClientProject
- func (p *PluginClient) NewRepository() ClientRepository
- func (p *PluginClient) NewToolService() ClientToolService
- func (p *PluginClient) Post(ctx context.Context, baseURL *duckv1.Addressable, path string, ...) error
- func (p *PluginClient) Project(meta Meta, secret corev1.Secret) ClientProject
- func (p *PluginClient) Put(ctx context.Context, baseURL *duckv1.Addressable, path string, ...) error
- func (p *PluginClient) Query(params map[string]string) OptionFunc
- func (p *PluginClient) R(ctx context.Context, baseURL *duckv1.Addressable, options ...OptionFunc) *resty.Request
- func (p *PluginClient) Repository(meta Meta, secret corev1.Secret) ClientRepository
- func (p *PluginClient) Secret(secret corev1.Secret) OptionFunc
- func (p *PluginClient) TestCase(meta Meta, secret corev1.Secret) ClientTestCase
- func (p *PluginClient) TestCaseExecution(meta Meta, secret corev1.Secret) ClientTestCaseExecution
- func (p *PluginClient) TestModule(meta Meta, secret corev1.Secret) ClientTestModule
- func (p *PluginClient) TestPlan(meta Meta, secret corev1.Secret) ClientTestPlan
- func (p *PluginClient) WithClassAddress(classAddress *duckv1.Addressable) *PluginClient
- func (p *PluginClient) WithIntegrationClassName(integrationClassName string) *PluginClient
- func (p *PluginClient) WithMeta(meta Meta) *PluginClient
- func (p *PluginClient) WithSecret(secret corev1.Secret) *PluginClient
- type PluginRegister
- type ProjectCreator
- type ProjectGetter
- type ProjectLister
- type ProjectUserLister
- type RepositoryLister
- type ResourcePathFormatter
- type ResponseStatusErr
- type ScanImage
- type TestCaseExecutionCreator
- type TestCaseExecutionLister
- type TestCaseGetter
- type TestCaseLister
- type TestModuleLister
- type TestPlanGetter
- type TestPlanLister
- type WebhookReceiver
- type WebhookRegister
- type WebhookResourceDiffer
Constants ¶
const ( OAuth2KeyAccessToken = "accessToken" AuthHeaderAuthorization = "Authorization" AuthPrefixBearer = "Bearer" // OAuth2ClientIDKey is the key of the clientID for AuthTypeOAuth2 secrets OAuth2ClientIDKey = "clientID" // OAuth2ClientSecretKey is the key of the clientSecret for AuthTypeOAuth2 secrets OAuth2ClientSecretKey = "clientSecret" // OAuth2CodeKey is the key of the code for AuthTypeOAuth2 secrets OAuth2CodeKey = "code" // OAuth2AccessTokenKeyKey is the key of the accessTokenKey for AuthTypeOAuth2 secrets OAuth2AccessTokenKeyKey = "accessTokenKey" // OAuth2AccessTokenKey is the key of the accessToken for AuthTypeOAuth2 secrets OAuth2AccessTokenKey = "accessToken" // OAuth2ScopeKey is the key of the scope for AuthTypeOAuth2 secrets OAuth2ScopeKey = "scope" // OAuth2RefreshTokenKey is the key of the refreshToken for AuthTypeOAuth2 secrets OAuth2RefreshTokenKey = "refreshToken" // OAuth2ExpiresInKey is the key of the expiresIn for AuthTypeOAuth2 secrets OAuth2CreatedAtKey = "createdAt" // OAuth2ExpiresInKey is the key of the expiresIn for AuthTypeOAuth2 secrets OAuth2ExpiresInKey = "expiresIn" // OAuth2RedirectURLKey is the key of the redirectURL for AuthTypeOAuth2 secrets OAuth2RedirectURLKey = "redirectURL" // OAuth2BaseURLKey is the key of the baseURL for AuthTypeOAuth2 secrets OAuth2BaseURLKey = "baseURL" // DynamicUsernameKey is the key of the username for dynamic secrets. DynamicUsernameKey = corev1.BasicAuthUsernameKey // DynamicPasswordKey is the key of the password for dynamic secrets. DynamicPasswordKey = corev1.BasicAuthPasswordKey // DynamicClientKeyKey is the key of the clientKey for dynamic secret DynamicClientKeyKey = "key" // DynamicClientSecretKey is the key of the clientSecret for dynamic secret DynamicClientSecretKey = "secret" // redefine key for dynamic token reflush. DynamicAccessTokenKey = OAuth2AccessTokenKey DynamicRefreshTokenKey = OAuth2RefreshTokenKey DynamicCreatedAtKey = OAuth2CreatedAtKey DynamicExpiresInKey = OAuth2ExpiresInKey DynamicBaseURLKey = OAuth2BaseURLKey )
const ( // PluginAuthHeader header for auth type (kubernetes secret type) PluginAuthHeader = "X-Plugin-Auth" // PluginSecretHeader header to store data part of the secret PluginSecretHeader = "X-Plugin-Secret" )
const ( // PluginMetaHeader header to store metadata for the plugin PluginMetaHeader = "X-Plugin-Meta" // PluginSubresourcesHeader subresources header parameter // used as a header to avoid overloading the url query parameters // and any url length limits PluginSubresourcesHeader = "X-Subresources" )
Variables ¶
This section is empty.
Functions ¶
func AuthFilter ¶
func AuthFilter(req *restful.Request, resp *restful.Response, chain *restful.FilterChain)
AuthFilter auth filter for go restful, parsing plugin auth
func GetGitRepoInfo ¶ added in v0.7.0
func GetGitRepoInfo(gitAddress string) (host string, gitRepo metav1alpha1.GitRepo, err error)
GetGitRepoInfo try to get the project and repository from the git address.
func IsNotImplementedError ¶ added in v0.7.0
IsNotImplementedError returns true if the plugin not implement the specified interface
func MetaFilter ¶
func MetaFilter(req *restful.Request, resp *restful.Response, chain *restful.FilterChain)
MetaFilter meta filter for go restful, parsing plugin meta
func WithGitPluginClient ¶ added in v0.7.0
func WithGitPluginClient(parent context.Context, gitPluginClient *GitPluginClient) context.Context
WithGitPluginClient returns a copy of parent in which the gitPluginClient value is set
func WithPluginClient ¶ added in v0.7.0
func WithPluginClient(parent context.Context, pluginClient *PluginClient) context.Context
WithPluginClient returns a copy of parent in which the pluginClient value is set
Types ¶
type AdditionalWebhookRegister ¶ added in v0.3.0
type AdditionalWebhookRegister interface { // GetWebhookSupport get webhook support map GetWebhookSupport() map[metav1alpha1.WebhookEventSupportType][]string }
type ArtifactDeleter ¶
type ArtifactDeleter interface { Interface DeleteArtifact(ctx context.Context, params metav1alpha1.ArtifactOptions) error }
ArtifactDeleter delete artifact
type ArtifactGetter ¶
type ArtifactGetter interface { Interface GetArtifact(ctx context.Context, params metav1alpha1.ArtifactOptions) (*metav1alpha1.Artifact, error) }
ArtifactGetter get artifact detail
type ArtifactLister ¶
type ArtifactLister interface { Interface ListArtifacts(ctx context.Context, params metav1alpha1.ArtifactOptions, option metav1alpha1.ListOptions) (*metav1alpha1.ArtifactList, error) }
ArtifactLister list artifact
type ArtifactTagDeleter ¶ added in v0.7.0
type ArtifactTagDeleter interface { Interface DeleteArtifactTag(ctx context.Context, params metav1alpha1.ArtifactTagOptions) error }
ArtifactTagDeleter delete a specific tag of the artifact.
type ArtifactTriggerRegister ¶ added in v0.3.0
type ArtifactTriggerRegister interface { GetIntegrationClassName() string // cloud event type of push hook that will match PushEventType() string }
ArtifactTriggerRegister used to register ArtifactTrigger
type Auth ¶
type Auth struct { // Type secret type as in kubernetes secret.type Type v1alpha1.AuthType `json:"type"` // Secret 's data value extracted from kubernetes Secret map[string][]byte `json:"data"` }
Auth plugin auth
func ExtractAuth ¶
ExtractAuth extract auth from a specific context
func (*Auth) BearerToken ¶
func (a *Auth) BearerToken(attribute string) (AuthMethod, error)
BearerToken return an bearer token auth method
func (*Auth) GetBasicInfo ¶
GetBasicInfo get basic auth username and password
func (*Auth) GetDynamicInfo ¶ added in v0.7.0
GetDynamicInfo get dynamic auth ak and sk
func (*Auth) GetOAuth2Token ¶
GetOAuth2Token get oauth2 access token
func (*Auth) Header ¶
func (a *Auth) Header(attribute string, header string) (AuthMethod, error)
Header return an auth method which could append to header with specific attribute
func (*Auth) HeaderWithPrefix ¶
HeaderWithPrefix return an auth method which could append to header with specific attribute and prefix
func (*Auth) OAuth2 ¶
func (a *Auth) OAuth2() (AuthMethod, error)
OAuth2 return an oauth2 auth method
type AuthChecker ¶ added in v0.2.0
type AuthChecker interface {
AuthCheck(ctx context.Context, option metav1alpha1.AuthCheckOptions) (*metav1alpha1.AuthCheck, error)
}
AuthChecker implements an authorization check method for plugins
type AuthMethod ¶
type AuthMethod func(request *resty.Request)
type AuthTokenGenerator ¶ added in v0.2.0
type AuthTokenGenerator interface {
AuthToken(ctx context.Context) (*metav1alpha1.AuthToken, error)
}
AuthTokenGenerator implements token generation/refresh API method
type BlobStoreLister ¶ added in v0.2.0
type BlobStoreLister interface { Interface ListBlobStores(ctx context.Context, listOption metav1alpha1.ListOptions) (*metav1alpha1.BlobStoreList, error) }
type BuildOptions ¶
type BuildOptions func(client *PluginClient)
BuildOptions Options to build the plugin client
func ClientOpts ¶
func ClientOpts(clt *resty.Client) BuildOptions
ClientOpts adds a custom client build options for plugin client
type Client ¶
type Client interface { Get(ctx context.Context, baseURL *duckv1.Addressable, uri string, options ...OptionFunc) error Post(ctx context.Context, baseURL *duckv1.Addressable, uri string, options ...OptionFunc) error Put(ctx context.Context, baseURL *duckv1.Addressable, uri string, options ...OptionFunc) error Delete(ctx context.Context, baseURL *duckv1.Addressable, uri string, options ...OptionFunc) error }
Client inteface for PluginClient, client code shoud use the interface as dependency
type ClientArtifact ¶ added in v0.7.0
type ClientArtifact interface { Get(ctx context.Context, baseURL *duckv1.Addressable, project string, repository string, artifact string, options ...OptionFunc) (*metav1alpha1.Artifact, error) List(ctx context.Context, baseURL *duckv1.Addressable, project string, repository string, options ...OptionFunc) (*metav1alpha1.ArtifactList, error) Delete(ctx context.Context, baseURL *duckv1.Addressable, project string, repository string, artifact string, options ...OptionFunc) error DeleteTag(ctx context.Context, baseURL *duckv1.Addressable, project string, repository string, artifact string, tag string, options ...OptionFunc) error }
type ClientAuth ¶ added in v0.2.0
type ClientAuth interface { Check(ctx context.Context, baseURL *duckv1.Addressable, options metav1alpha1.AuthCheckOptions, opts ...OptionFunc) (*metav1alpha1.AuthCheck, error) Token(ctx context.Context, baseURL *duckv1.Addressable, opts ...OptionFunc) (*metav1alpha1.AuthToken, error) }
ClientAuth provides methods to verify authentication
type ClientBlobStore ¶ added in v0.2.0
type ClientBlobStore interface {
List(ctx context.Context, baseURL *duckv1.Addressable, options ...OptionFunc) (*metav1alpha1.BlobStoreList, error)
}
type ClientCodeQuality ¶ added in v0.2.0
type ClientCodeQuality interface { Get(ctx context.Context, baseURL *duckv1.Addressable, projectKey string, options ...OptionFunc) (*metav1alpha1.CodeQuality, error) GetOverview(ctx context.Context, baseURL *duckv1.Addressable, options ...OptionFunc) (*metav1alpha1.CodeQualityProjectOverview, error) GetByBranch(ctx context.Context, baseURL *duckv1.Addressable, opt metav1alpha1.CodeQualityBaseOption, options ...OptionFunc) (*metav1alpha1.CodeQuality, error) GetLineCharts(ctx context.Context, baseURL *duckv1.Addressable, opt metav1alpha1.CodeQualityLineChartOption, options ...OptionFunc) (*metav1alpha1.CodeQualityLineChart, error) GetMetricsByTaskID(ctx context.Context, baseURL *duckv1.Addressable, opt metav1alpha1.CodeQualityTaskOption, options ...OptionFunc) (*metav1alpha1.CodeQualityTaskMetrics, error) }
type ClientGitBranch ¶
type ClientGitBranch interface { List(ctx context.Context, baseURL *duckv1.Addressable, repo metav1alpha1.GitBranchOption, options ...OptionFunc) (*metav1alpha1.GitBranchList, error) Create(ctx context.Context, baseURL *duckv1.Addressable, payload metav1alpha1.CreateBranchPayload, options ...OptionFunc) (*metav1alpha1.GitBranch, error) Get(ctx context.Context, baseURL *duckv1.Addressable, repo metav1alpha1.GitRepo, branch string, options ...OptionFunc) (*metav1alpha1.GitBranch, error) }
ClientGitBranch client for branch
type ClientGitCommit ¶
type ClientGitCommit interface { Get(ctx context.Context, baseURL *duckv1.Addressable, option metav1alpha1.GitCommitOption, options ...OptionFunc) (*metav1alpha1.GitCommit, error) Create(ctx context.Context, baseURL *duckv1.Addressable, option coderepositoryv1alpha1.CreateGitCommitOption, options ...OptionFunc) (*metav1alpha1.GitCommit, error) List(ctx context.Context, baseURL *duckv1.Addressable, option metav1alpha1.GitCommitListOption, options ...OptionFunc) (*metav1alpha1.GitCommitList, error) }
ClientGitCommit client for commit
type ClientGitCommitComment ¶
type ClientGitCommitComment interface { List(ctx context.Context, baseURL *duckv1.Addressable, option metav1alpha1.GitCommitOption, options ...OptionFunc) (*metav1alpha1.GitCommitCommentList, error) Create(ctx context.Context, baseURL *duckv1.Addressable, payload metav1alpha1.CreateCommitCommentPayload, options ...OptionFunc) (*metav1alpha1.GitCommitComment, error) }
type ClientGitCommitStatus ¶
type ClientGitCommitStatus interface { List(ctx context.Context, baseURL *duckv1.Addressable, option metav1alpha1.GitCommitOption, options ...OptionFunc) (*metav1alpha1.GitCommitStatusList, error) Create(ctx context.Context, baseURL *duckv1.Addressable, payload metav1alpha1.CreateCommitStatusPayload, options ...OptionFunc) (*metav1alpha1.GitCommitStatus, error) }
type ClientGitContent ¶
type ClientGitContent interface { Get(ctx context.Context, baseURL *duckv1.Addressable, option metav1alpha1.GitRepoFileOption, options ...OptionFunc) (*metav1alpha1.GitRepoFile, error) Create(ctx context.Context, baseURL *duckv1.Addressable, payload metav1alpha1.CreateRepoFilePayload, options ...OptionFunc) (*metav1alpha1.GitCommit, error) }
type ClientGitPullRequest ¶
type ClientGitPullRequest interface { Create( ctx context.Context, baseURL *duckv1.Addressable, payload metav1alpha1.CreatePullRequestPayload, options ...OptionFunc, ) (*metav1alpha1.GitPullRequest, error) CreateNote( ctx context.Context, baseURL *duckv1.Addressable, payload metav1alpha1.CreatePullRequestCommentPayload, options ...OptionFunc, ) (*metav1alpha1.GitPullRequestNote, error) List( ctx context.Context, baseURL *duckv1.Addressable, option metav1alpha1.GitPullRequestListOption, options ...OptionFunc, ) (*metav1alpha1.GitPullRequestList, error) ListNote(ctx context.Context, baseURL *duckv1.Addressable, option metav1alpha1.GitPullRequestOption, options ...OptionFunc, ) (*metav1alpha1.GitPullRequestNoteList, error) Get(ctx context.Context, baseURL *duckv1.Addressable, option metav1alpha1.GitPullRequestOption, options ...OptionFunc, ) (*metav1alpha1.GitPullRequest, error) }
ClientGitPullRequest is interface for Create and Read pull requests Deprecated: Integrations should implement GitPullRequestCRUClient instead (or additionally).
type ClientGitRepository ¶
type ClientGitRepository interface { List(ctx context.Context, baseURL *duckv1.Addressable, project, keyword string, subtype metav1alpha1.ProjectSubType, options ...OptionFunc) (*metav1alpha1.GitRepositoryList, error) Get(ctx context.Context, baseURL *duckv1.Addressable, project, repo string, options ...OptionFunc) (*metav1alpha1.GitRepository, error) }
ClientGitRepository client for repo
type ClientGitRepositoryFileTree ¶ added in v0.7.0
type ClientGitRepositoryFileTree interface { GetGitRepositoryFileTree( ctx context.Context, baseURL *duckv1.Addressable, option metav1alpha1.GitRepoFileTreeOption, options ...OptionFunc, ) (*metav1alpha1.GitRepositoryFileTree, error) }
ClientGitRepositoryFileTree defines the request interface for the file tree
type ClientGitRepositoryTag ¶ added in v0.7.0
type ClientGitRepositoryTag interface { Get(ctx context.Context, baseURL *duckv1.Addressable, option metav1alpha1.GitRepositoryTagOption, options ...OptionFunc) (*metav1alpha1.GitRepositoryTag, error) List(ctx context.Context, baseURL *duckv1.Addressable, option metav1alpha1.GitRepositoryTagListOption, options ...OptionFunc) (*metav1alpha1.GitRepositoryTagList, error) }
ClientGitRepositoryTag client for repository tag
type ClientProject ¶
type ClientProject interface { List(ctx context.Context, baseURL *duckv1.Addressable, options ...OptionFunc) (*metav1alpha1.ProjectList, error) Create(ctx context.Context, baseURL *duckv1.Addressable, project *metav1alpha1.Project, options ...OptionFunc) (*metav1alpha1.Project, error) Get(ctx context.Context, baseURL *duckv1.Addressable, id string, options ...OptionFunc) (*metav1alpha1.Project, error) }
type ClientProjectGetter ¶
type ClientProjectGetter interface {
Project(meta Meta, secret corev1.Secret) ClientProject
}
type ClientRepository ¶ added in v0.2.0
type ClientRepository interface {
List(ctx context.Context, baseURL *duckv1.Addressable, project string, options ...OptionFunc) (*metav1alpha1.RepositoryList, error)
}
type ClientTestCase ¶ added in v0.7.0
type ClientTestCase interface { List(ctx context.Context, baseURL *duckv1.Addressable, params metav1alpha1.TestProjectOptions, options ...OptionFunc) (*metav1alpha1.TestCaseList, error) Get(ctx context.Context, baseURL *duckv1.Addressable, params metav1alpha1.TestProjectOptions, options ...OptionFunc) (*metav1alpha1.TestCase, error) }
ClientTestCase for test case
type ClientTestCaseExecution ¶ added in v0.7.0
type ClientTestCaseExecution interface { List(ctx context.Context, baseURL *duckv1.Addressable, params metav1alpha1.TestProjectOptions, options ...OptionFunc) (*metav1alpha1.TestCaseExecutionList, error) Create(ctx context.Context, baseURL *duckv1.Addressable, params metav1alpha1.TestProjectOptions, payload metav1alpha1.TestCaseExecution, options ...OptionFunc, ) (*metav1alpha1.TestCaseExecution, error) }
ClientTestCaseExecution client for test case execution
type ClientTestModule ¶ added in v0.7.0
type ClientTestModule interface {
List(ctx context.Context, baseURL *duckv1.Addressable, params metav1alpha1.TestProjectOptions, options ...OptionFunc) (*metav1alpha1.TestModuleList, error)
}
ClientTestModule client for test module
type ClientTestPlan ¶ added in v0.7.0
type ClientTestPlan interface { List(ctx context.Context, baseURL *duckv1.Addressable, params metav1alpha1.TestProjectOptions, options ...OptionFunc, ) (*metav1alpha1.TestPlanList, error) Get(ctx context.Context, baseURL *duckv1.Addressable, params metav1alpha1.TestProjectOptions, options ...OptionFunc) (*metav1alpha1.TestPlan, error) }
ClientTestPlan client for test plan
type ClientToolService ¶ added in v0.7.0
type ClientToolService interface { CheckAlive(ctx context.Context, options ...OptionFunc) error Initialize(ctx context.Context, options ...OptionFunc) error }
type CodeQualityGetter ¶ added in v0.2.0
type CodeQualityGetter interface { Interface GetCodeQuality(ctx context.Context, projectKey string) (*metav1alpha1.CodeQuality, error) GetCodeQualityOverviewByBranch(ctx context.Context, opt metav1alpha1.CodeQualityBaseOption) (*metav1alpha1.CodeQuality, error) GetCodeQualityLineCharts(ctx context.Context, opt metav1alpha1.CodeQualityLineChartOption) (*metav1alpha1.CodeQualityLineChart, error) GetOverview(ctx context.Context) (*metav1alpha1.CodeQualityProjectOverview, error) GetSummaryByTaskID(ctx context.Context, opt metav1alpha1.CodeQualityTaskOption) (*metav1alpha1.CodeQualityTaskMetrics, error) }
type DependentResourceGetter ¶ added in v0.7.0
type DependentResourceGetter interface { // GetDependentResources parses params and returns expected dependent resources GetDependentResources(ctx context.Context, params []metav1alpha1.Param) ([]corev1.ObjectReference, error) }
DependentResourceGetter checks and returns dependent resource references
type GitBranchCreator ¶
type GitBranchCreator interface { Interface CreateGitBranch(ctx context.Context, payload metav1alpha1.CreateBranchPayload) (metav1alpha1.GitBranch, error) }
GitBranchCreator create git branch,github, gogs don't support create branch
type GitBranchGetter ¶
type GitBranchGetter interface { Interface GetGitBranch(ctx context.Context, repoOption metav1alpha1.GitRepo, branch string) (metav1alpha1.GitBranch, error) }
GitBranchGetter get git branch
type GitBranchLister ¶
type GitBranchLister interface { Interface ListGitBranch(ctx context.Context, branchOption metav1alpha1.GitBranchOption, option metav1alpha1.ListOptions) (metav1alpha1.GitBranchList, error) }
GitBranchLister List git branch
type GitCommitCommentCreator ¶
type GitCommitCommentCreator interface { Interface CreateGitCommitComment(ctx context.Context, payload metav1alpha1.CreateCommitCommentPayload) (metav1alpha1.GitCommitComment, error) }
GitCommitCommentCreator create git commit comment
type GitCommitCommentLister ¶
type GitCommitCommentLister interface { Interface ListGitCommitComment( ctx context.Context, option metav1alpha1.GitCommitOption, listOption metav1alpha1.ListOptions, ) (metav1alpha1.GitCommitCommentList, error) }
GitCommitCommentLister list git commit comment
type GitCommitCreator ¶ added in v0.8.0
type GitCommitCreator interface { Interface CreateGitCommit(ctx context.Context, option coderepositoryv1alpha1.CreateGitCommitOption) (metav1alpha1.GitCommit, error) }
GitCommitCreator create git commit
type GitCommitGetter ¶
type GitCommitGetter interface { Interface GetGitCommit(ctx context.Context, option metav1alpha1.GitCommitOption) (metav1alpha1.GitCommit, error) }
GitCommitGetter get git commit
type GitCommitLister ¶ added in v0.3.0
type GitCommitLister interface { Interface ListGitCommit( ctx context.Context, option metav1alpha1.GitCommitListOption, listOption metav1alpha1.ListOptions, ) (metav1alpha1.GitCommitList, error) }
GitCommitLister List git commit
type GitCommitStatusCreator ¶
type GitCommitStatusCreator interface { Interface CreateGitCommitStatus(ctx context.Context, payload metav1alpha1.CreateCommitStatusPayload) (metav1alpha1.GitCommitStatus, error) }
GitCommitStatusCreator create git commit status
type GitCommitStatusLister ¶
type GitCommitStatusLister interface { Interface ListGitCommitStatus( ctx context.Context, option metav1alpha1.GitCommitOption, listOption metav1alpha1.ListOptions, ) (metav1alpha1.GitCommitStatusList, error) }
GitCommitStatusLister list git commit status
type GitPluginClient ¶ added in v0.7.0
type GitPluginClient struct { *PluginClient // GitRepo Repo base info, such as project, repository GitRepo metav1alpha1.GitRepo // ClassObject store the integration class object // +optional ClassObject ctrlclient.Object }
GitPluginClient client for plugins
func GenerateGitPluginClient ¶ added in v0.7.0
func GenerateGitPluginClient(ctx context.Context, secretRef *corev1.ObjectReference, gitRepoURL, integrationClassName string, classAddress *duckv1.Addressable) ( gpclient *GitPluginClient, err error)
GenerateGitPluginClient generate git plugin client params
func GitPluginClientFrom ¶ added in v0.7.0
func GitPluginClientFrom(ctx context.Context) (*GitPluginClient, bool)
GitPluginClientFrom returns the value of the gitPluginClient key on the ctx
func GitPluginClientValue ¶ added in v0.7.0
func GitPluginClientValue(ctx context.Context) *GitPluginClient
GitPluginClientValue returns the value of the gitPluginClient key on the ctx, or the nil if none
func (*GitPluginClient) WithClassObject ¶ added in v0.7.0
func (p *GitPluginClient) WithClassObject(object ctrlclient.Object) *GitPluginClient
func (*GitPluginClient) WithGitRepo ¶ added in v0.7.0
func (p *GitPluginClient) WithGitRepo(gitRepo metav1alpha1.GitRepo) *GitPluginClient
type GitPullRequestCRUClient ¶ added in v0.7.0
type GitPullRequestCRUClient interface { ClientGitPullRequest UpdateNote( ctx context.Context, baseURL *duckv1.Addressable, payload metav1alpha1.UpdatePullRequestCommentPayload, options ...OptionFunc, ) (*metav1alpha1.GitPullRequestNote, error) }
GitPullRequestCRUClient is the client interface with Create Read and Update operations
type GitPullRequestCommentCreator ¶
type GitPullRequestCommentCreator interface { Interface CreatePullRequestComment(ctx context.Context, option metav1alpha1.CreatePullRequestCommentPayload) (metav1alpha1.GitPullRequestNote, error) }
GitPullRequestCommentCreator create pull request comment functions
type GitPullRequestCommentLister ¶
type GitPullRequestCommentLister interface { Interface ListPullRequestComment( ctx context.Context, option metav1alpha1.GitPullRequestOption, listOption metav1alpha1.ListOptions, ) (metav1alpha1.GitPullRequestNoteList, error) }
GitPullRequestCommentLister list pull request comment functions
type GitPullRequestCommentUpdater ¶ added in v0.7.0
type GitPullRequestCommentUpdater interface { Interface UpdatePullRequestComment(ctx context.Context, option metav1alpha1.UpdatePullRequestCommentPayload) (metav1alpha1.GitPullRequestNote, error) }
GitPullRequestCommentUpdater updates pull request comment
type GitPullRequestHandler ¶
type GitPullRequestHandler interface { Interface ListGitPullRequest( ctx context.Context, option metav1alpha1.GitPullRequestListOption, listOption metav1alpha1.ListOptions, ) (metav1alpha1.GitPullRequestList, error) GetGitPullRequest(ctx context.Context, option metav1alpha1.GitPullRequestOption) (metav1alpha1.GitPullRequest, error) CreatePullRequest(ctx context.Context, payload metav1alpha1.CreatePullRequestPayload) (metav1alpha1.GitPullRequest, error) }
GitPullRequestHandler list, get and create pr function
type GitRepoFileCreator ¶
type GitRepoFileCreator interface { Interface CreateGitRepoFile(ctx context.Context, payload metav1alpha1.CreateRepoFilePayload) (metav1alpha1.GitCommit, error) }
GitRepoFileCreator used to create a file, gogs don't support
type GitRepoFileGetter ¶
type GitRepoFileGetter interface { Interface GetGitRepoFile(ctx context.Context, option metav1alpha1.GitRepoFileOption) (metav1alpha1.GitRepoFile, error) }
GitRepoFileGetter used to get a file content
type GitRepositoryFileTreeGetter ¶ added in v0.7.0
type GitRepositoryFileTreeGetter interface { Interface GetGitRepositoryFileTree( ctx context.Context, repoOption metav1alpha1.GitRepoFileTreeOption, listOption metav1alpha1.ListOptions, ) (metav1alpha1.GitRepositoryFileTree, error) }
GitRepositoryFileTreeGetter get git repository file tree
type GitRepositoryGetter ¶
type GitRepositoryGetter interface { Interface GetGitRepository(ctx context.Context, repoOption metav1alpha1.GitRepo) (metav1alpha1.GitRepository, error) }
GitRepositoryGetter get git repository
type GitRepositoryLister ¶
type GitRepositoryLister interface { Interface ListGitRepository( ctx context.Context, id, keyword string, subtype metav1alpha1.ProjectSubType, listOption metav1alpha1.ListOptions, ) (metav1alpha1.GitRepositoryList, error) }
GitRepositoryLister list git repository
type GitRepositoryTagGetter ¶ added in v0.7.0
type GitRepositoryTagGetter interface { Interface GetGitRepositoryTag( ctx context.Context, option metav1alpha1.GitRepositoryTagOption, ) (metav1alpha1.GitRepositoryTag, error) }
GitRepositoryTagGetter get git repository Tag
type GitRepositoryTagLister ¶ added in v0.7.0
type GitRepositoryTagLister interface { Interface ListGitRepositoryTag( ctx context.Context, option metav1alpha1.GitRepositoryTagListOption, listOption metav1alpha1.ListOptions, ) (metav1alpha1.GitRepositoryTagList, error) }
GitRepositoryTagLister list git repository Tag
type GitTriggerRegister ¶
type GitTriggerRegister interface { GetIntegrationClassName() string // cloud event type of pull request hook that will match PullRequestEventType() string // cloud event type of push hook that will match PushEventType() string // cloud event type of push hook that will match TagEventType() string }
GitTriggerRegister used to register GitTrigger TODO: need refactor: maybe integration plugin should decided how to generate cloudevents filters up to now, it is not a better solution that relying on plugins to give some events type to GitTriggerReconcile.
PullRequestCloudEventFilter() CloudEventFilters BranchCloudEventFilter() CloudEventFilters TagCloudEventFilter() CloudEventFilters WebHook() WebHook
type ImageConfigGetter ¶ added in v0.3.0
type ImageConfigGetter interface { Interface GetImageConfig(ctx context.Context, params metav1alpha1.ArtifactOptions) (*metav1alpha1.ImageConfig, error) }
ImageConfigGetter get image config
type Initializer ¶ added in v0.7.0
type Initializer interface { // Initialize the tool service if desired Initialize(ctx context.Context) error }
Initializer initialize the tool service
type IssueAttributeGetter ¶ added in v0.3.0
type IssueAttributeGetter interface { Interface GetIssueAttribute(ctx context.Context, params metav1alpha1.IssueOptions, option metav1alpha1.ListOptions) (*metav1alpha1.Attribute, error) }
type IssueBranchCreator ¶ added in v0.3.0
type IssueBranchCreator interface { Interface CreateIssueBranch(ctx context.Context, params metav1alpha1.IssueOptions, payload metav1alpha1.Branch) (*metav1alpha1.Branch, error) }
type IssueBranchDeleter ¶ added in v0.3.0
type IssueBranchDeleter interface { Interface DeleteIssueBranch(ctx context.Context, params metav1alpha1.IssueOptions, option metav1alpha1.ListOptions) error }
type IssueBranchLister ¶ added in v0.3.0
type IssueBranchLister interface { Interface ListIssueBranches(ctx context.Context, params metav1alpha1.IssueOptions, option metav1alpha1.ListOptions) (*metav1alpha1.BranchList, error) }
type IssueGetter ¶ added in v0.3.0
type IssueGetter interface { Interface GetIssue(ctx context.Context, params metav1alpha1.IssueOptions, option metav1alpha1.ListOptions) (*metav1alpha1.Issue, error) }
type IssueLister ¶ added in v0.3.0
type IssueLister interface { Interface ListIssues(ctx context.Context, params metav1alpha1.IssueOptions, option metav1alpha1.ListOptions) (*metav1alpha1.IssueList, error) }
IssueLister issue lister
type LivenessChecker ¶ added in v0.7.0
type LivenessChecker interface { // CheckAlive check the tool service is alive CheckAlive(ctx context.Context) error }
LivenessChecker check the tool service is alive
type Meta ¶
type Meta struct { Version string `json:"version,omitempty"` BaseURL string `json:"baseURL,omitempty"` }
Meta Plugin meta with base url and version info, for calling plugin api
type OptionFunc ¶
type OptionFunc func(request *resty.Request)
OptionFunc options for requests
func DefaultOptions ¶ added in v0.7.0
func DefaultOptions() []OptionFunc
DefaultOptions for default plugin client options
func QueryOpts ¶
func QueryOpts(params map[string]string) OptionFunc
QueryOpts query parameters for the request
func ResultOpts ¶
func ResultOpts(dest interface{}) OptionFunc
ResultOpts request result automatically marshalled into object
func SecretOpts ¶
func SecretOpts(secret corev1.Secret) OptionFunc
SecretOpts provides a secret to be assigned to the request in the header
type PluginAddressable ¶ added in v0.7.0
type PluginAddressable interface { // GetAddressURL Returns its own plugin access URL GetAddressURL() *apis.URL }
PluginAddressable provides methods to get plugin address url
type PluginAttributes ¶ added in v0.2.0
type PluginClient ¶
type PluginClient struct { // ClassAddress is the address of the integration class // +optional ClassAddress *duckv1.Addressable // IntegrationClassName is the name of the integration class // +optional IntegrationClassName string // contains filtered or unexported fields }
PluginClient client for plugins
func NewPluginClient ¶
func NewPluginClient(opts ...BuildOptions) *PluginClient
NewPluginClient creates a new plugin client
func PluginClientFrom ¶ added in v0.7.0
func PluginClientFrom(ctx context.Context) (*PluginClient, bool)
PluginClientFrom returns the value of the pluginClient key on the ctx
func PluginClientValue ¶ added in v0.7.0
func PluginClientValue(ctx context.Context) *PluginClient
PluginClientValue returns the value of the pluginClient key on the ctx, or the nil if none
func (*PluginClient) Artifact ¶ added in v0.7.0
func (p *PluginClient) Artifact(meta Meta, secret corev1.Secret) ClientArtifact
Artifact get Artifact client
func (*PluginClient) Auth ¶ added in v0.2.0
func (p *PluginClient) Auth(meta Meta, secret corev1.Secret) ClientAuth
Auth provides an auth methods for clients
func (*PluginClient) BlobStore ¶ added in v0.2.0
func (p *PluginClient) BlobStore(meta Meta, secret corev1.Secret) ClientBlobStore
BlobStore get blob store client
func (*PluginClient) Body ¶
func (p *PluginClient) Body(body interface{}) OptionFunc
Body request body
func (*PluginClient) Clone ¶ added in v0.7.0
func (p *PluginClient) Clone() *PluginClient
Clone shallow clone the plugin client used to update some fields without changing the original
func (*PluginClient) CodeQuality ¶ added in v0.2.0
func (p *PluginClient) CodeQuality(meta Meta, secret corev1.Secret) ClientCodeQuality
CodeQuality get code quality client
func (*PluginClient) Delete ¶
func (p *PluginClient) Delete(ctx context.Context, baseURL *duckv1.Addressable, path string, options ...OptionFunc) error
Delete performs a DELETE request with the given parameters
func (*PluginClient) Dest ¶
func (p *PluginClient) Dest(dest interface{}) OptionFunc
Dest request result automatically marshalled into object
func (*PluginClient) Error ¶
func (p *PluginClient) Error(err interface{}) OptionFunc
Error error response object
func (*PluginClient) FullUrl ¶ added in v0.7.0
func (p *PluginClient) FullUrl(address *duckv1.Addressable, uri string) string
func (*PluginClient) Get ¶
func (p *PluginClient) Get(ctx context.Context, baseURL *duckv1.Addressable, path string, options ...OptionFunc) error
Get performs a GET request using defined options
func (*PluginClient) GitBranch ¶
func (p *PluginClient) GitBranch(meta Meta, secret corev1.Secret) ClientGitBranch
GitBranch get branch client
func (*PluginClient) GitCommit ¶
func (p *PluginClient) GitCommit(meta Meta, secret corev1.Secret) ClientGitCommit
GitCommit get pr client
func (*PluginClient) GitCommitComment ¶
func (p *PluginClient) GitCommitComment(meta Meta, secret corev1.Secret) ClientGitCommitComment
GitCommitComment get commit comment client
func (*PluginClient) GitCommitStatus ¶
func (p *PluginClient) GitCommitStatus(meta Meta, secret corev1.Secret) ClientGitCommitStatus
GitCommitStatus get commit comment client
func (*PluginClient) GitContent ¶
func (p *PluginClient) GitContent(meta Meta, secret corev1.Secret) ClientGitContent
GitContent get content client
func (*PluginClient) GitPluginClient ¶ added in v0.7.0
func (p *PluginClient) GitPluginClient() *GitPluginClient
GitPluginClient convert PluginClient to GitPluginClient
func (*PluginClient) GitPullRequest ¶
func (p *PluginClient) GitPullRequest(meta Meta, secret corev1.Secret) GitPullRequestCRUClient
GitPullRequest get pr client
func (*PluginClient) GitRepository ¶
func (p *PluginClient) GitRepository(meta Meta, secret corev1.Secret) ClientGitRepository
GitRepository get repo client
func (*PluginClient) GitRepositoryFileTree ¶ added in v0.7.0
func (p *PluginClient) GitRepositoryFileTree(meta Meta, secret corev1.Secret) ClientGitRepositoryFileTree
GitRepositoryFileTree get repo file tree client
func (*PluginClient) GitRepositoryTag ¶ added in v0.7.0
func (p *PluginClient) GitRepositoryTag(meta Meta, secret corev1.Secret) ClientGitRepositoryTag
GitRepositoryTag get repository tag client
func (*PluginClient) HandleError ¶
func (p *PluginClient) HandleError(response *resty.Response, err error) error
func (*PluginClient) Header ¶
func (p *PluginClient) Header(key, value string) OptionFunc
Header sets a header
func (*PluginClient) ListOptions ¶
func (p *PluginClient) ListOptions(opts metav1alpha1.ListOptions) OptionFunc
ListOptions options for lists
func (*PluginClient) Meta ¶
func (p *PluginClient) Meta(meta Meta) OptionFunc
Meta provides metadata for the request
func (*PluginClient) NewArtifact ¶ added in v0.7.0
func (p *PluginClient) NewArtifact() ClientArtifact
NewArtifact get Artifact client Use the internal meta and secret to generate the client, please assign in advance.
func (*PluginClient) NewAuth ¶ added in v0.7.0
func (p *PluginClient) NewAuth() ClientAuth
NewAuth provides an auth methods for clients Use the internal meta and secret to generate the client, please assign in advance.
func (*PluginClient) NewBlobStore ¶ added in v0.7.0
func (p *PluginClient) NewBlobStore() ClientBlobStore
NewBlobStore get blob store client Use the internal meta and secret to generate the client, please assign in advance.
func (*PluginClient) NewCodeQuality ¶ added in v0.7.0
func (p *PluginClient) NewCodeQuality() ClientCodeQuality
NewCodeQuality get code quality client Use the internal meta and secret to generate the client, please assign in advance.
func (*PluginClient) NewGitBranch ¶ added in v0.7.0
func (p *PluginClient) NewGitBranch() ClientGitBranch
NewGitBranch get branch client Use the internal meta and secret to generate the client, please assign in advance.
func (*PluginClient) NewGitCommit ¶ added in v0.7.0
func (p *PluginClient) NewGitCommit() ClientGitCommit
NewGitCommit get pr client Use the internal meta and secret to generate the client, please assign in advance.
func (*PluginClient) NewGitCommitComment ¶ added in v0.7.0
func (p *PluginClient) NewGitCommitComment() ClientGitCommitComment
NewGitCommitComment get commit comment client Use the internal meta and secret to generate the client, please assign in advance.
func (*PluginClient) NewGitCommitStatus ¶ added in v0.7.0
func (p *PluginClient) NewGitCommitStatus() ClientGitCommitStatus
NewGitCommitStatus get commit comment client Use the internal meta and secret to generate the client, please assign in advance.
func (*PluginClient) NewGitContent ¶ added in v0.7.0
func (p *PluginClient) NewGitContent() ClientGitContent
NewGitContent get content client Use the internal meta and secret to generate the client, please assign in advance.
func (*PluginClient) NewGitPullRequest ¶ added in v0.7.0
func (p *PluginClient) NewGitPullRequest() GitPullRequestCRUClient
NewGitPullRequest get pr client Use the internal meta and secret to generate the client, please assign in advance.
func (*PluginClient) NewGitRepository ¶ added in v0.7.0
func (p *PluginClient) NewGitRepository() ClientGitRepository
NewGitRepository get repo client Use the internal meta and secret to generate the client, please assign in advance.
func (*PluginClient) NewGitRepositoryFileTree ¶ added in v0.7.0
func (p *PluginClient) NewGitRepositoryFileTree() ClientGitRepositoryFileTree
NewGitRepositoryFileTree get repo file tree client Use the internal meta and secret to generate the client, please assign in advance.
func (*PluginClient) NewGitRepositoryTag ¶ added in v0.7.0
func (p *PluginClient) NewGitRepositoryTag() ClientGitRepositoryTag
NewGitRepositoryTag get repository tag client Use the internal meta and secret to generate the client, please assign in advance.
func (*PluginClient) NewProject ¶ added in v0.7.0
func (p *PluginClient) NewProject() ClientProject
NewProject get project client Use the internal meta and secret to generate the client, please assign in advance.
func (*PluginClient) NewRepository ¶ added in v0.7.0
func (p *PluginClient) NewRepository() ClientRepository
NewRepository get Repository client Use the internal meta and secret to generate the client, please assign in advance.
func (*PluginClient) NewToolService ¶ added in v0.7.0
func (p *PluginClient) NewToolService() ClientToolService
NewToolService get tool service execution client
func (*PluginClient) Post ¶
func (p *PluginClient) Post(ctx context.Context, baseURL *duckv1.Addressable, path string, options ...OptionFunc) error
Post performs a POST request with the given parameters
func (*PluginClient) Project ¶
func (p *PluginClient) Project(meta Meta, secret corev1.Secret) ClientProject
Project get project client
func (*PluginClient) Put ¶
func (p *PluginClient) Put(ctx context.Context, baseURL *duckv1.Addressable, path string, options ...OptionFunc) error
Put performs a PUT request with the given parameters
func (*PluginClient) Query ¶
func (p *PluginClient) Query(params map[string]string) OptionFunc
Query query parameters for the request
func (*PluginClient) R ¶
func (p *PluginClient) R(ctx context.Context, baseURL *duckv1.Addressable, options ...OptionFunc) *resty.Request
R prepares a request based on the given information
func (*PluginClient) Repository ¶ added in v0.2.0
func (p *PluginClient) Repository(meta Meta, secret corev1.Secret) ClientRepository
Repository get Repository client
func (*PluginClient) Secret ¶
func (p *PluginClient) Secret(secret corev1.Secret) OptionFunc
Secret provides a secret to be assigned to the request in the header
func (*PluginClient) TestCase ¶ added in v0.7.0
func (p *PluginClient) TestCase(meta Meta, secret corev1.Secret) ClientTestCase
TestCase get test case client
func (*PluginClient) TestCaseExecution ¶ added in v0.7.0
func (p *PluginClient) TestCaseExecution(meta Meta, secret corev1.Secret) ClientTestCaseExecution
TestCaseExecution get test case execution client
func (*PluginClient) TestModule ¶ added in v0.7.0
func (p *PluginClient) TestModule(meta Meta, secret corev1.Secret) ClientTestModule
TestModule get test module client
func (*PluginClient) TestPlan ¶ added in v0.7.0
func (p *PluginClient) TestPlan(meta Meta, secret corev1.Secret) ClientTestPlan
TestPlan get test plan client
func (*PluginClient) WithClassAddress ¶ added in v0.7.0
func (p *PluginClient) WithClassAddress(classAddress *duckv1.Addressable) *PluginClient
func (*PluginClient) WithIntegrationClassName ¶ added in v0.7.0
func (p *PluginClient) WithIntegrationClassName(integrationClassName string) *PluginClient
func (*PluginClient) WithMeta ¶ added in v0.7.0
func (p *PluginClient) WithMeta(meta Meta) *PluginClient
func (*PluginClient) WithSecret ¶ added in v0.7.0
func (p *PluginClient) WithSecret(secret corev1.Secret) *PluginClient
type PluginRegister ¶
type PluginRegister interface { Interface PluginAddressable // GetIntegrationClassName returns integration class name GetIntegrationClassName() string // GetWebhookURL Returns a Webhook accessible URL for external tools // If not supported return nil, false GetWebhookURL() (*apis.URL, bool) // GetSupportedVersions Returns a list of supported versions by the plugin // For SaaS platform plugins use a "online" version. GetSupportedVersions() []string // GetSecretTypes Returns all secret types supported by the plugin GetSecretTypes() []string // GetReplicationPolicyTypes return replication policy types for ClusterIntegration GetReplicationPolicyTypes() []string // GetResourceTypes Returns a list of Resource types that can be used in ClusterIntegration and Integration GetResourceTypes() []string // GetAllowEmptySecret Returns if an empty secret is allowed with IntegrationClass GetAllowEmptySecret() []string }
PluginRegister plugin registration methods to update IntegrationClass status
type ProjectCreator ¶
type ProjectCreator interface { Interface CreateProject(ctx context.Context, project *metav1alpha1.Project) (*metav1alpha1.Project, error) }
ProjectCreator create project api
type ProjectGetter ¶
type ProjectGetter interface { Interface GetProject(ctx context.Context, id string) (*metav1alpha1.Project, error) }
ProjectGetter list project api
type ProjectLister ¶
type ProjectLister interface { Interface ListProjects(ctx context.Context, option metav1alpha1.ListOptions) (*metav1alpha1.ProjectList, error) }
ProjectLister list project api
type ProjectUserLister ¶ added in v0.3.0
type ProjectUserLister interface { Interface ListProjectUsers(ctx context.Context, params metav1alpha1.UserOptions, option metav1alpha1.ListOptions) (*metav1alpha1.UserList, error) }
type RepositoryLister ¶
type RepositoryLister interface { Interface ListRepositories( ctx context.Context, params metav1alpha1.RepositoryOptions, option metav1alpha1.ListOptions, ) (*metav1alpha1.RepositoryList, error) }
RepositoryLister list repository
type ResourcePathFormatter ¶ added in v0.7.0
type ResourcePathFormatter interface { // GetResourcePathFmt resource path format GetResourcePathFmt() map[metav1alpha1.ResourcePathScene]string // GetSubResourcePathFmt resource path format GetSubResourcePathFmt() map[metav1alpha1.ResourcePathScene]string }
ResourcePathFormatter implements a formatter for resource path base on different scene
type ResponseStatusErr ¶ added in v0.7.0
ResponseStatusErr is an error with `Status` type, used to handle plugin response
func (ResponseStatusErr) Error ¶ added in v0.7.0
func (p ResponseStatusErr) Error() string
Error implements error interface, output the error message
type ScanImage ¶
type ScanImage interface { Interface ScanImage(ctx context.Context, params metav1alpha1.ArtifactOptions) error }
ScanImage scan image
type TestCaseExecutionCreator ¶ added in v0.7.0
type TestCaseExecutionCreator interface { Interface CreateTestCaseExecution(ctx context.Context, params metav1alpha1.TestProjectOptions, payload metav1alpha1.TestCaseExecution) (*metav1alpha1.TestCaseExecution, error) }
TestCaseExecutionCreator create a new test case execution
type TestCaseExecutionLister ¶ added in v0.7.0
type TestCaseExecutionLister interface { Interface ListTestCaseExecutions(ctx context.Context, params metav1alpha1.TestProjectOptions, options metav1alpha1.ListOptions) (*metav1alpha1.TestCaseExecutionList, error) }
TestCaseExecutionLister list test case executions
type TestCaseGetter ¶ added in v0.7.0
type TestCaseGetter interface { Interface GetTestCase(ctx context.Context, params metav1alpha1.TestProjectOptions) (*metav1alpha1.TestCase, error) }
TestCaseGetter get a test case
type TestCaseLister ¶ added in v0.7.0
type TestCaseLister interface { Interface ListTestCases(ctx context.Context, params metav1alpha1.TestProjectOptions, options metav1alpha1.ListOptions) (*metav1alpha1.TestCaseList, error) }
TestCaseLister list test cases
type TestModuleLister ¶ added in v0.7.0
type TestModuleLister interface { Interface ListTestModules(ctx context.Context, params metav1alpha1.TestProjectOptions, options metav1alpha1.ListOptions) (*metav1alpha1.TestModuleList, error) }
TestModuleLister list a test module
type TestPlanGetter ¶ added in v0.7.0
type TestPlanGetter interface { Interface GetTestPlan(ctx context.Context, params metav1alpha1.TestProjectOptions) (*metav1alpha1.TestPlan, error) }
TestPlanGetter get a test plan
type TestPlanLister ¶ added in v0.7.0
type TestPlanLister interface { Interface ListTestPlans(ctx context.Context, params metav1alpha1.TestProjectOptions, option metav1alpha1.ListOptions) (*metav1alpha1.TestPlanList, error) }
TestPlanLister list test plans
type WebhookReceiver ¶
type WebhookReceiver interface { Interface ReceiveWebhook(ctx context.Context, req *restful.Request, secret string) (cloudevent.Event, error) }
WebhookReceiver receives a webhook request with validation and transform it into a cloud event
type WebhookRegister ¶
type WebhookRegister interface { // Use the methods below to manage webhooks in the target platform CreateWebhook(ctx context.Context, spec metav1alpha1.WebhookRegisterSpec, secret corev1.Secret) (metav1alpha1.WebhookRegisterStatus, error) UpdateWebhook(ctx context.Context, spec metav1alpha1.WebhookRegisterSpec, secret corev1.Secret) (metav1alpha1.WebhookRegisterStatus, error) DeleteWebhook(ctx context.Context, spec metav1alpha1.WebhookRegisterSpec, secret corev1.Secret) error ListWebhooks(ctx context.Context, uri apis.URL, secret corev1.Secret) ([]metav1alpha1.WebhookRegisterStatus, error) }
WebhookRegister used to register and manage webhooks
type WebhookResourceDiffer ¶
type WebhookResourceDiffer interface { // IsSameResource will provide two ResourceURI // the plugin should discern if they are the same. // If this method is not implemented a standard comparisons will be used IsSameResource(ctx context.Context, i, j metav1alpha1.ResourceURI) bool }
WebhookResourceDiffer used to compare different webhook resources in order to provide a way to merge webhook registration requests. If not provided, the resource's URI will be directly compared
Source Files ¶
- artifact.go
- auth.go
- auth_client.go
- blobstore.go
- code_quality.go
- context.go
- error.go
- git_plugin_client.go
- gitbranch.go
- gitcommit.go
- gitcommitcomment.go
- gitcommitstatus.go
- gitcontent.go
- gitfiletree.go
- gitpullrequest.go
- gitrepository.go
- gitrepotag.go
- interface.go
- meta.go
- plugin_client.go
- plugin_options.go
- project.go
- repository.go
- testcase.go
- testcaseexecution.go
- testmodule.go
- testplan.go
- tool_service.go