Documentation ¶
Index ¶
- Constants
- func AuthFilter(req *restful.Request, resp *restful.Response, chain *restful.FilterChain)
- func MetaFilter(req *restful.Request, resp *restful.Response, chain *restful.FilterChain)
- type AdditionalWebhookRegister
- type ArtifactDeleter
- type ArtifactGetter
- type ArtifactLister
- 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) 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) 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 ClientAuth
- type ClientBlobStore
- type ClientCodeQuality
- type ClientGitBranch
- type ClientGitCommit
- type ClientGitCommitComment
- type ClientGitCommitStatus
- type ClientGitContent
- type ClientGitPullRequest
- type ClientGitRepository
- type ClientProject
- type ClientProjectGetter
- type ClientRepository
- type CodeQualityGetter
- type GitBranchCreator
- type GitBranchGetter
- type GitBranchLister
- type GitCommitCommentCreator
- type GitCommitCommentLister
- type GitCommitGetter
- type GitCommitLister
- type GitCommitStatusCreator
- type GitCommitStatusLister
- type GitPullRequestCommentCreator
- type GitPullRequestCommentLister
- type GitPullRequestHandler
- type GitRepoFileCreator
- type GitRepoFileGetter
- type GitRepositoryGetter
- type GitRepositoryLister
- type GitTriggerRegister
- type ImageConfigGetter
- type Interface
- type IssueAttributeGetter
- type IssueBranchCreator
- type IssueBranchDeleter
- type IssueBranchLister
- type IssueGetter
- type IssueLister
- type Meta
- type OptionFunc
- func BodyOpts(body interface{}) 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 PluginAttributes
- type PluginClient
- 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) 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) 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) GitPullRequest(meta Meta, secret corev1.Secret) ClientGitPullRequest
- func (p *PluginClient) GitRepository(meta Meta, secret corev1.Secret) ClientGitRepository
- 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) 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
- type PluginRegister
- type ProjectCreator
- type ProjectGetter
- type ProjectLister
- type ProjectUserLister
- type RepositoryLister
- type ScanImage
- 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" )
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 MetaFilter ¶
func MetaFilter(req *restful.Request, resp *restful.Response, chain *restful.FilterChain)
MetaFilter meta filter for go restful, parsing plugin meta
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 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) 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)
}
AuthCheck 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 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) 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) }
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 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 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 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) }
GitRepositoryLister create git commit comment
type GitCommitCommentLister ¶
type GitCommitCommentLister interface { Interface ListGitCommitComment(ctx context.Context, option metav1alpha1.GitCommitOption, listOption metav1alpha1.ListOptions) (metav1alpha1.GitCommitCommentList, error) }
GitRepositoryLister list git commit comment
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 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 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 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 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) }
GetImageConfig get image config
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) }
project management
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 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 PluginAttributes ¶ added in v0.2.0
type PluginClient ¶
type PluginClient struct {
// contains filtered or unexported fields
}
PluginClient client for plugins
func NewPluginClient ¶
func NewPluginClient(opts ...BuildOptions) *PluginClient
NewPluginClient creates a new plugin 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) 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) 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) GitPullRequest ¶
func (p *PluginClient) GitPullRequest(meta Meta, secret corev1.Secret) ClientGitPullRequest
GitPullRequest get pr client
func (*PluginClient) GitRepository ¶
func (p *PluginClient) GitRepository(meta Meta, secret corev1.Secret) ClientGitRepository
GitRepository get repo 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) 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
type PluginRegister ¶
type PluginRegister interface { Interface GetIntegrationClassName() string // GetAddressURL Returns its own plugin access URL GetAddressURL() *apis.URL // 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 ScanImage ¶
type ScanImage interface { Interface ScanImage(ctx context.Context, params metav1alpha1.ArtifactOptions) error }
ScanImage scan image
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