Documentation ¶
Overview ¶
Package biz is a generated GoMock package.
Index ¶
- Constants
- Variables
- func Contains(arr []int, target int) bool
- func GetClusterFromTenantRepository(tenantRepositoryLocalPath, clusterName string) (*resourcev1alpha1.Cluster, error)
- func GetClusterTemplateHttpsURL(configs *nautesconfigs.Config) string
- func ListDeployKeys(ctx context.Context, codeRepo CodeRepo, pid int, opts *ListOptions) listFunc
- func SetResourceContext(ctx context.Context, ...) context.Context
- func SpliceCodeRepoResourceName(id int) string
- type AccessLevelValue
- type AccessTokenPermission
- type AccessTokenSecretData
- type BizOptions
- type CacheStore
- type CloneRepositoryParam
- type ClusterData
- type ClusterUsecase
- func (c *ClusterUsecase) CloneRepository(ctx context.Context, url string) (string, error)
- func (r *ClusterUsecase) ConvertKubeconfig(config, server string) (string, error)
- func (c *ClusterUsecase) DeleteCluster(ctx context.Context, clusterName string) error
- func (c *ClusterUsecase) DeleteDexConfig(param *cluster.ClusterRegistrationParam) error
- func (c *ClusterUsecase) GetCluster(ctx context.Context, clusterName string) (*resourcev1alpha1.Cluster, error)
- func (c *ClusterUsecase) GetDefaultCertificate(ctx context.Context) (string, error)
- func (c *ClusterUsecase) GetTenantRepository(ctx context.Context) (*Project, error)
- func (c *ClusterUsecase) ListClusters(ctx context.Context) ([]*resourcev1alpha1.Cluster, error)
- func (c *ClusterUsecase) SaveCluster(ctx context.Context, param *cluster.ClusterRegistrationParam, ...) error
- func (c *ClusterUsecase) SaveDexConfig(param *cluster.ClusterRegistrationParam, teantLocalPath string) error
- func (c *ClusterUsecase) SaveKubeconfig(ctx context.Context, id, server, config string) error
- type CodeRepo
- type CodeRepoBindingData
- type CodeRepoBindingUsecase
- func (c *CodeRepoBindingUsecase) CheckReference(options nodestree.CompareOptions, node *nodestree.Node, ...) (bool, error)
- func (c *CodeRepoBindingUsecase) CreateNode(path string, data interface{}) (*nodestree.Node, error)
- func (c *CodeRepoBindingUsecase) CreateResource(kind string) interface{}
- func (c *CodeRepoBindingUsecase) DeleteCodeRepoBinding(ctx context.Context, options *BizOptions) error
- func (c *CodeRepoBindingUsecase) GetCodeRepoBinding(ctx context.Context, options *BizOptions) (*resourcev1alpha1.CodeRepoBinding, error)
- func (c *CodeRepoBindingUsecase) GetDeployKeyFromSecretRepo(ctx context.Context, repoName, user, permissions string) (*DeployKeySecretData, error)
- func (c *CodeRepoBindingUsecase) ListCodeRepoBindings(ctx context.Context, options *BizOptions) ([]*nodestree.Node, error)
- func (c *CodeRepoBindingUsecase) RevokeDeployKey(ctx context.Context, codeRepos []*resourcev1alpha1.CodeRepo, ...) error
- func (c *CodeRepoBindingUsecase) SaveCodeRepoBinding(ctx context.Context, options *BizOptions, data *CodeRepoBindingData) error
- func (c *CodeRepoBindingUsecase) UpdateNode(resourceNode *nodestree.Node, data interface{}) (*nodestree.Node, error)
- type CodeRepoData
- type CodeRepoUsecase
- func (c *CodeRepoUsecase) CheckReference(options nodestree.CompareOptions, node *nodestree.Node, ...) (bool, error)
- func (c *CodeRepoUsecase) CreateNode(path string, data interface{}) (*nodestree.Node, error)
- func (c *CodeRepoUsecase) CreateResource(kind string) interface{}
- func (c *CodeRepoUsecase) DeleteCodeRepo(ctx context.Context, options *BizOptions) error
- func (c *CodeRepoUsecase) FilterAccessTokensByIDList(ctx context.Context, pid int, idList map[int]bool) ([]*ProjectAccessToken, error)
- func (c *CodeRepoUsecase) FilterProjectDeployKeysByIDList(ctx context.Context, pid int, idList map[int]bool) ([]*ProjectDeployKey, error)
- func (c *CodeRepoUsecase) GetAllAccessTokens(ctx context.Context, pid int) ([]*ProjectAccessToken, error)
- func (c *CodeRepoUsecase) GetCodeRepo(ctx context.Context, codeRepoName, productName string) (*nodestree.Node, error)
- func (c *CodeRepoUsecase) GetProjectByCodeRepoName(ctx context.Context, codeRepoName, productName string) (*resourcev1alpha1.CodeRepo, *Project, error)
- func (c *CodeRepoUsecase) ListAccessTokens(ctx context.Context, pid int, opts *ListOptions) ([]interface{}, error)
- func (c *CodeRepoUsecase) ListCodeRepos(ctx context.Context, productName string) ([]*nodestree.Node, error)
- func (c *CodeRepoUsecase) SaveCodeRepo(ctx context.Context, options *BizOptions, data *CodeRepoData, ...) error
- func (c *CodeRepoUsecase) UpdateNode(node *nodestree.Node, data interface{}) (*nodestree.Node, error)
- type CreateProjectAccessTokenOptions
- type DeployKeyProject
- type DeployKeySecretData
- type DeployKeyType
- type DeploymentRuntimeData
- type DeploymentRuntimeUsecase
- func (d *DeploymentRuntimeUsecase) CheckReference(options nodestree.CompareOptions, node *nodestree.Node, ...) (bool, error)
- func (e *DeploymentRuntimeUsecase) CreateNode(path string, data interface{}) (*nodestree.Node, error)
- func (d *DeploymentRuntimeUsecase) CreateResource(kind string) interface{}
- func (d *DeploymentRuntimeUsecase) DeleteDeploymentRuntime(ctx context.Context, options *BizOptions) error
- func (d *DeploymentRuntimeUsecase) GetDeploymentRuntime(ctx context.Context, deploymentRuntimeName, productName string) (*resourcev1alpha1.DeploymentRuntime, error)
- func (d *DeploymentRuntimeUsecase) ListDeploymentRuntimes(ctx context.Context, productName string) ([]*nodestree.Node, error)
- func (d *DeploymentRuntimeUsecase) SaveDeploymentRuntime(ctx context.Context, options *BizOptions, data *DeploymentRuntimeData) error
- func (e *DeploymentRuntimeUsecase) UpdateNode(resourceNode *nodestree.Node, data interface{}) (*nodestree.Node, error)
- type DexRepo
- type EnviromentData
- type EnvironmentUsecase
- func (e *EnvironmentUsecase) CheckReference(options nodestree.CompareOptions, node *nodestree.Node, ...) (bool, error)
- func (c *EnvironmentUsecase) ConvertProductToGroupName(ctx context.Context, env *resourcev1alpha1.Environment) error
- func (e *EnvironmentUsecase) CreateNode(path string, data interface{}) (*nodestree.Node, error)
- func (e *EnvironmentUsecase) CreateResource(kind string) interface{}
- func (e *EnvironmentUsecase) DeleteEnvironment(ctx context.Context, options *BizOptions) error
- func (e *EnvironmentUsecase) GetEnvironment(ctx context.Context, enviromentName, productName string) (*resourcev1alpha1.Environment, error)
- func (e *EnvironmentUsecase) ListEnvironments(ctx context.Context, productName string) ([]*nodestree.Node, error)
- func (e *EnvironmentUsecase) SaveEnvironment(ctx context.Context, options *BizOptions, data *EnviromentData) error
- func (e *EnvironmentUsecase) UpdateNode(resourceNode *nodestree.Node, data interface{}) (*nodestree.Node, error)
- type GitCodeRepoOptions
- type GitGroupOptions
- type GitRepo
- type GitlabCodeRepoOptions
- type Group
- func CreateGroup(ctx context.Context, codeRepo CodeRepo, gitOptions *GitGroupOptions) (group *Group, err error)
- func GetGroup(ctx context.Context, codeRepo CodeRepo, gid interface{}) (group *Group, err error)
- func UpdateGroup(ctx context.Context, codeRepo CodeRepo, configClient *nautesconfigs.Config, ...) (group *Group, err error)
- type GroupAndProjectItem
- type GroupOptions
- type ISOTime
- type Kubernetes
- type ListMatchOptions
- type ListOptions
- type MockCodeRepo
- func (m *MockCodeRepo) CreateCodeRepo(ctx context.Context, gid int, options *GitCodeRepoOptions) (*Project, error)
- func (m *MockCodeRepo) CreateGroup(ctx context.Context, gitOptions *GitGroupOptions) (*Group, error)
- func (m *MockCodeRepo) CreateProjectAccessToken(ctx context.Context, pid interface{}, opt *CreateProjectAccessTokenOptions) (*ProjectAccessToken, error)
- func (m *MockCodeRepo) DeleteCodeRepo(ctx context.Context, pid interface{}) error
- func (m *MockCodeRepo) DeleteDeployKey(ctx context.Context, pid interface{}, deployKey int) error
- func (m *MockCodeRepo) DeleteGroup(ctx context.Context, gid interface{}) error
- func (m *MockCodeRepo) DeleteProjectAccessToken(ctx context.Context, pid interface{}, id int) error
- func (m *MockCodeRepo) EXPECT() *MockCodeRepoMockRecorder
- func (m *MockCodeRepo) EnableProjectDeployKey(ctx context.Context, pid interface{}, deployKey int) (*ProjectDeployKey, error)
- func (m *MockCodeRepo) GetCodeRepo(ctx context.Context, pid interface{}) (*Project, error)
- func (m *MockCodeRepo) GetCurrentUser(ctx context.Context) (string, string, error)
- func (m *MockCodeRepo) GetDeployKey(ctx context.Context, pid interface{}, deployKeyID int) (*ProjectDeployKey, error)
- func (m *MockCodeRepo) GetGroup(ctx context.Context, gid interface{}) (*Group, error)
- func (m *MockCodeRepo) GetProjectAccessToken(ctx context.Context, pid interface{}, id int) (*ProjectAccessToken, error)
- func (m *MockCodeRepo) ListAccessTokens(ctx context.Context, pid interface{}, opt *ListOptions) ([]*ProjectAccessToken, error)
- func (m *MockCodeRepo) ListAllDeployKeys(ctx context.Context, opt *ListOptions) ([]*ProjectDeployKey, error)
- func (m *MockCodeRepo) ListAllGroups(ctx context.Context) ([]*Group, error)
- func (m *MockCodeRepo) ListCodeRepos(ctx context.Context, search string) ([]*Project, error)
- func (m *MockCodeRepo) ListDeployKeys(ctx context.Context, pid interface{}, opt *ListOptions) ([]*ProjectDeployKey, error)
- func (m *MockCodeRepo) ListGroupCodeRepos(ctx context.Context, gid interface{}, opts ...string) ([]*Project, error)
- func (m *MockCodeRepo) SaveDeployKey(ctx context.Context, pid interface{}, title string, canPush bool, ...) (*ProjectDeployKey, error)
- func (m *MockCodeRepo) UpdateCodeRepo(ctx context.Context, pid interface{}, options *GitCodeRepoOptions) (*Project, error)
- func (m *MockCodeRepo) UpdateDeployKey(ctx context.Context, pid interface{}, deployKey int, title string, ...) (*ProjectDeployKey, error)
- func (m *MockCodeRepo) UpdateGroup(ctx context.Context, gid interface{}, git *GitGroupOptions) (*Group, error)
- type MockCodeRepoMockRecorder
- func (mr *MockCodeRepoMockRecorder) CreateCodeRepo(ctx, gid, options interface{}) *gomock.Call
- func (mr *MockCodeRepoMockRecorder) CreateGroup(ctx, gitOptions interface{}) *gomock.Call
- func (mr *MockCodeRepoMockRecorder) CreateProjectAccessToken(ctx, pid, opt interface{}) *gomock.Call
- func (mr *MockCodeRepoMockRecorder) DeleteCodeRepo(ctx, pid interface{}) *gomock.Call
- func (mr *MockCodeRepoMockRecorder) DeleteDeployKey(ctx, pid, deployKey interface{}) *gomock.Call
- func (mr *MockCodeRepoMockRecorder) DeleteGroup(ctx, gid interface{}) *gomock.Call
- func (mr *MockCodeRepoMockRecorder) DeleteProjectAccessToken(ctx, pid, id interface{}) *gomock.Call
- func (mr *MockCodeRepoMockRecorder) EnableProjectDeployKey(ctx, pid, deployKey interface{}) *gomock.Call
- func (mr *MockCodeRepoMockRecorder) GetCodeRepo(ctx, pid interface{}) *gomock.Call
- func (mr *MockCodeRepoMockRecorder) GetCurrentUser(ctx interface{}) *gomock.Call
- func (mr *MockCodeRepoMockRecorder) GetDeployKey(ctx, pid, deployKeyID interface{}) *gomock.Call
- func (mr *MockCodeRepoMockRecorder) GetGroup(ctx, gid interface{}) *gomock.Call
- func (mr *MockCodeRepoMockRecorder) GetProjectAccessToken(ctx, pid, id interface{}) *gomock.Call
- func (mr *MockCodeRepoMockRecorder) ListAccessTokens(ctx, pid, opt interface{}) *gomock.Call
- func (mr *MockCodeRepoMockRecorder) ListAllDeployKeys(ctx, opt interface{}) *gomock.Call
- func (mr *MockCodeRepoMockRecorder) ListAllGroups(ctx interface{}) *gomock.Call
- func (mr *MockCodeRepoMockRecorder) ListCodeRepos(ctx, search interface{}) *gomock.Call
- func (mr *MockCodeRepoMockRecorder) ListDeployKeys(ctx, pid, opt interface{}) *gomock.Call
- func (mr *MockCodeRepoMockRecorder) ListGroupCodeRepos(ctx, gid interface{}, opts ...interface{}) *gomock.Call
- func (mr *MockCodeRepoMockRecorder) SaveDeployKey(ctx, pid, title, canPush, publicKey interface{}) *gomock.Call
- func (mr *MockCodeRepoMockRecorder) UpdateCodeRepo(ctx, pid, options interface{}) *gomock.Call
- func (mr *MockCodeRepoMockRecorder) UpdateDeployKey(ctx, pid, deployKey, title, canPush interface{}) *gomock.Call
- func (mr *MockCodeRepoMockRecorder) UpdateGroup(ctx, gid, git interface{}) *gomock.Call
- type MockDexRepo
- type MockDexRepoMockRecorder
- type MockGitRepo
- func (m *MockGitRepo) Clone(ctx context.Context, param *CloneRepositoryParam) (string, error)
- func (m *MockGitRepo) Commit(ctx context.Context, path string) error
- func (m *MockGitRepo) Diff(ctx context.Context, path string, command ...string) (string, error)
- func (m *MockGitRepo) EXPECT() *MockGitRepoMockRecorder
- func (m *MockGitRepo) Fetch(ctx context.Context, path string, command ...string) (string, error)
- func (m *MockGitRepo) Merge(ctx context.Context, path string) (string, error)
- func (m *MockGitRepo) Push(ctx context.Context, path string, command ...string) error
- func (m *MockGitRepo) SaveConfig(ctx context.Context, path string) error
- type MockGitRepoMockRecorder
- func (mr *MockGitRepoMockRecorder) Clone(ctx, param interface{}) *gomock.Call
- func (mr *MockGitRepoMockRecorder) Commit(ctx, path interface{}) *gomock.Call
- func (mr *MockGitRepoMockRecorder) Diff(ctx, path interface{}, command ...interface{}) *gomock.Call
- func (mr *MockGitRepoMockRecorder) Fetch(ctx, path interface{}, command ...interface{}) *gomock.Call
- func (mr *MockGitRepoMockRecorder) Merge(ctx, path interface{}) *gomock.Call
- func (mr *MockGitRepoMockRecorder) Push(ctx, path interface{}, command ...interface{}) *gomock.Call
- func (mr *MockGitRepoMockRecorder) SaveConfig(ctx, path interface{}) *gomock.Call
- type MockKubernetes
- type MockKubernetesMockRecorder
- type MockSecretrepo
- func (m *MockSecretrepo) AuthorizationSecret(ctx context.Context, id int, destUser, gitType, mountPath string) error
- func (m *MockSecretrepo) DeleteSecret(ctx context.Context, id int, user, permission string) error
- func (m *MockSecretrepo) EXPECT() *MockSecretrepoMockRecorder
- func (m *MockSecretrepo) GetDeployKey(ctx context.Context, secretOptions *SecretOptions) (*DeployKeySecretData, error)
- func (m *MockSecretrepo) GetProjectAccessToken(ctx context.Context, secretOptions *SecretOptions) (*AccessTokenSecretData, error)
- func (m *MockSecretrepo) GetSecret(ctx context.Context, secretOptions *SecretOptions) (string, error)
- func (m *MockSecretrepo) SaveClusterConfig(ctx context.Context, id, config string) error
- func (m *MockSecretrepo) SaveDeployKey(ctx context.Context, id, key, user, permission string, ...) error
- func (m *MockSecretrepo) SaveProjectAccessToken(ctx context.Context, id, token, user, permission string, ...) error
- type MockSecretrepoMockRecorder
- func (mr *MockSecretrepoMockRecorder) AuthorizationSecret(ctx, id, destUser, gitType, mountPath interface{}) *gomock.Call
- func (mr *MockSecretrepoMockRecorder) DeleteSecret(ctx, id, user, permission interface{}) *gomock.Call
- func (mr *MockSecretrepoMockRecorder) GetDeployKey(ctx, secretOptions interface{}) *gomock.Call
- func (mr *MockSecretrepoMockRecorder) GetProjectAccessToken(ctx, secretOptions interface{}) *gomock.Call
- func (mr *MockSecretrepoMockRecorder) GetSecret(ctx, secretOptions interface{}) *gomock.Call
- func (mr *MockSecretrepoMockRecorder) SaveClusterConfig(ctx, id, config interface{}) *gomock.Call
- func (mr *MockSecretrepoMockRecorder) SaveDeployKey(ctx, id, key, user, permission, extendKVs interface{}) *gomock.Call
- func (mr *MockSecretrepoMockRecorder) SaveProjectAccessToken(ctx, id, token, user, permission, extendKVs interface{}) *gomock.Call
- type PipelineRuntimeValidateClient
- type ProductAuthorization
- type ProductUsecase
- func (p *ProductUsecase) DeleteProduct(ctx context.Context, productID string) error
- func (p *ProductUsecase) GetGroupAndDefaultProject(ctx context.Context, productName string) (*GroupAndProjectItem, error)
- func (p *ProductUsecase) GetProduct(ctx context.Context, productName string) (*GroupAndProjectItem, error)
- func (p *ProductUsecase) ListProducts(ctx context.Context) ([]*GroupAndProjectItem, error)
- func (p *ProductUsecase) SaveProduct(ctx context.Context, productName string, gitOptions *GitGroupOptions) (group *Group, project *Project, err error)
- type Project
- type ProjectAccessToken
- type ProjectData
- type ProjectDeployKey
- type ProjectNamespace
- type ProjectPipelineRuntimeData
- type ProjectPipelineRuntimeUsecase
- func (p *ProjectPipelineRuntimeUsecase) CheckReference(options nodestree.CompareOptions, node *nodestree.Node, ...) (bool, error)
- func (p *ProjectPipelineRuntimeUsecase) CreateNode(path string, data interface{}) (*nodestree.Node, error)
- func (p *ProjectPipelineRuntimeUsecase) CreateResource(kind string) interface{}
- func (p *ProjectPipelineRuntimeUsecase) DeleteProjectPipelineRuntime(ctx context.Context, options *BizOptions) error
- func (p *ProjectPipelineRuntimeUsecase) GetProjectPipelineRuntime(ctx context.Context, projectPipelineName, productName string) (*nodestree.Node, error)
- func (p *ProjectPipelineRuntimeUsecase) IsRepositoryExist(ctx context.Context, productName, repoName string) (*Project, error)
- func (p *ProjectPipelineRuntimeUsecase) ListProjectPipelineRuntimes(ctx context.Context, productName string) ([]*nodestree.Node, error)
- func (p *ProjectPipelineRuntimeUsecase) SaveProjectPipelineRuntime(ctx context.Context, options *BizOptions, data *ProjectPipelineRuntimeData) error
- func (p *ProjectPipelineRuntimeUsecase) UpdateNode(node *nodestree.Node, data interface{}) (*nodestree.Node, error)
- type ProjectUsecase
- func (p *ProjectUsecase) CheckReference(options nodestree.CompareOptions, node *nodestree.Node, ...) (bool, error)
- func (p *ProjectUsecase) CreateNode(path string, data interface{}) (*nodestree.Node, error)
- func (p *ProjectUsecase) CreateResource(kind string) interface{}
- func (p *ProjectUsecase) DeleteProject(ctx context.Context, options *BizOptions) error
- func (p *ProjectUsecase) GetProject(ctx context.Context, projectName, productName string) (*resourcev1alpha1.Project, error)
- func (p *ProjectUsecase) ListProjects(ctx context.Context, productName string) ([]*resourcev1alpha1.Project, error)
- func (p *ProjectUsecase) SaveProject(ctx context.Context, options *BizOptions, data *ProjectData) error
- func (p *ProjectUsecase) UpdateNode(resourceNode *nodestree.Node, data interface{}) (*nodestree.Node, error)
- type ResourceInfo
- type ResourcesUsecase
- func (r *ResourcesUsecase) CloneCodeRepo(ctx context.Context, url string) (path string, err error)
- func (r *ResourcesUsecase) ConvertCodeRepoToRepoName(ctx context.Context, codeRepoName string) (string, error)
- func (r *ResourcesUsecase) ConvertGroupToProduct(ctx context.Context, productName string) (string, error)
- func (r *ResourcesUsecase) ConvertProductToGroupName(ctx context.Context, productName string) (string, error)
- func (r *ResourcesUsecase) ConvertRepoNameToCodeRepo(ctx context.Context, productName, codeRepoName string) (string, error)
- func (r *ResourcesUsecase) Delete(ctx context.Context, resourceOptions *resourceOptions, ...) error
- func (r *ResourcesUsecase) Get(ctx context.Context, resourceKind, productName string, ...) (*nodestree.Node, error)
- func (r *ResourcesUsecase) GetCodeRepo(ctx context.Context, ProductName, codeRepoName string) (*Project, error)
- func (r *ResourcesUsecase) GetGroupAndProjectByGroupID(ctx context.Context, gid interface{}) (*Group, *Project, error)
- func (r *ResourcesUsecase) GetNode(nodes *nodestree.Node, kind, resourceName string) *nodestree.Node
- func (r *ResourcesUsecase) GetNodes() (*nodestree.Node, error)
- func (r *ResourcesUsecase) InsertNodes(nodestree nodestree.NodesTree, nodes, resource *nodestree.Node) (*nodestree.Node, error)
- func (r *ResourcesUsecase) List(ctx context.Context, gid interface{}, operator nodestree.NodesOperator) (*nodestree.Node, error)
- func (r *ResourcesUsecase) RemoveNode(nodes, node *nodestree.Node) (*nodestree.Node, error)
- func (r *ResourcesUsecase) Save(ctx context.Context, resourceOptions *resourceOptions, data interface{}) error
- func (r *ResourcesUsecase) SaveConfig(ctx context.Context, path string) error
- func (r *ResourcesUsecase) SaveDeployConfig(nodes *nodestree.Node, path string) error
- func (r *ResourcesUsecase) WriteResource(node *nodestree.Node) (err error)
- type RretryCountType
- type SecretData
- type SecretOptions
- type Secretrepo
Constants ¶
const ( TenantLabel = "coderepo.resource.nautes.io/tenant-management" NautesClusterDir = "nautes/overlays/production/clusters" DefaultClusterTemplateURL = "https://github.com/nautes-labs/cluster-templates.git" SecretPath = "default" SecretEngine = "pki" )
const ( // Argo-operator Index key, Used to obtain roles from the configuration ArgoOperator = "Argo" // Product default project name DefaultProject = "default.project" KustomizationFileName = "kustomization.yaml" )
Common
const ( // Product naming prefix ProductPrefix = "product-" // CodeRepo naming prefix RepoPrefix = "repo-" )
prefix...
const ( // Secret Repo stores git related data engine name SecretsGitEngine = "git" // Secret Repo stores deploykey key SecretsDeployKey = "deploykey" // Secret Repo stores access token key SecretsAccessToken = "accesstoken" // Key data default store user DefaultUser = "default" // DeployKey fingerprint data Key Fingerprint = "fingerprint" // DeployKey fingerprint data ID DeployKeyID = "id" )
Secret store Constants
const ( // AccessToken fingerprint data ID AccessTokenID = "id" // Access token key path name AccessTokenName = "accesstoken-api" // Access token scope permissions APIPermission AccessTokenPermission = "api" // Access token authorization role Developer AccessLevelValue = 30 Maintainer AccessLevelValue = 40 Owner AccessLevelValue = 50 )
Access token
const ( // layout resouce directory names CodeReposSubDir = "code-repos" RuntimesDir = "runtimes" EnvSubDir = "envs" ProjectsDir = "projects" )
const ( ResourceInfoKey = "ResourceInfoKey" // How to mark this request method SaveMethod = "Save" DeleteMethod = "Delete" )
Constants used to store commit information
const ( PROJECT_NOT_FOUND = "PROJECT_NOT_FOUND" GROUP_NOT_FOUND = "GROUP_NOT_FOUND" NODE_NOT_FOUND = "NODE_NOT_FOUND" RESOURCE_NOT_FOUND = "RESOURCE_NOT_FOUND" RESOURCE_NOT_MATCH = "RESOURCE_NOT_MATCH" NO_AUTHORIZATION = "NO_AUTHORIZATION" )
Variables ¶
var ( ErrorProjectNotFound = errors.New(404, PROJECT_NOT_FOUND, "the project path is not found") ErrorGroupNotFound = errors.New(404, GROUP_NOT_FOUND, "the group path is not found") ErrorNodetNotFound = errors.New(404, NODE_NOT_FOUND, "the node is not found") ErrorResourceNoFound = errors.New(404, RESOURCE_NOT_FOUND, "the resource is not found") ErrorResourceNoMatch = errors.New(500, RESOURCE_NOT_MATCH, "the resource is not match") ErrorNoAuth = errors.New(403, NO_AUTHORIZATION, "no access to the code repository") )
var ProviderSet = wire.NewSet(NewProjectPipelineRuntimeUsecase, NewDeploymentRuntimeUsecase, NewProductUsecase, NewResourcesUsecase, NewProjectUsecase, NewEnviromentUsecase, NewClusterUsecase, NewCodeRepoUsecase, NewCodeRepoCodeRepoBindingUsecase)
ProviderSet is biz providers.
Functions ¶
func GetClusterFromTenantRepository ¶ added in v0.3.5
func GetClusterFromTenantRepository(tenantRepositoryLocalPath, clusterName string) (*resourcev1alpha1.Cluster, error)
func GetClusterTemplateHttpsURL ¶
func GetClusterTemplateHttpsURL(configs *nautesconfigs.Config) string
func ListDeployKeys ¶ added in v0.3.0
func ListDeployKeys(ctx context.Context, codeRepo CodeRepo, pid int, opts *ListOptions) listFunc
func SetResourceContext ¶ added in v0.3.1
func SetResourceContext(ctx context.Context, productName, method, parentResouceKind, parentResouceName, resourceKind, resourceName string) context.Context
SetResourceContext is mount resource information to context.
Types ¶
type AccessLevelValue ¶ added in v0.3.0
type AccessLevelValue int
type AccessTokenPermission ¶ added in v0.3.0
type AccessTokenPermission string
type AccessTokenSecretData ¶ added in v0.3.0
type AccessTokenSecretData struct { // The ID of the access token secret ID int }
type BizOptions ¶
type CacheStore ¶ added in v0.3.4
type CacheStore struct {
// contains filtered or unexported fields
}
type CloneRepositoryParam ¶
type ClusterData ¶
type ClusterUsecase ¶
type ClusterUsecase struct {
// contains filtered or unexported fields
}
func NewClusterUsecase ¶
func NewClusterUsecase(logger log.Logger, codeRepo CodeRepo, secretRepo Secretrepo, resourcesUsecase *ResourcesUsecase, configs *nautesconfigs.Config, client client.Client, cluster cluster.ClusterRegistrationOperator, dex DexRepo) *ClusterUsecase
func (*ClusterUsecase) CloneRepository ¶
func (*ClusterUsecase) ConvertKubeconfig ¶
func (r *ClusterUsecase) ConvertKubeconfig(config, server string) (string, error)
func (*ClusterUsecase) DeleteCluster ¶
func (c *ClusterUsecase) DeleteCluster(ctx context.Context, clusterName string) error
func (*ClusterUsecase) DeleteDexConfig ¶
func (c *ClusterUsecase) DeleteDexConfig(param *cluster.ClusterRegistrationParam) error
func (*ClusterUsecase) GetCluster ¶ added in v0.3.1
func (c *ClusterUsecase) GetCluster(ctx context.Context, clusterName string) (*resourcev1alpha1.Cluster, error)
func (*ClusterUsecase) GetDefaultCertificate ¶ added in v0.3.5
func (c *ClusterUsecase) GetDefaultCertificate(ctx context.Context) (string, error)
func (*ClusterUsecase) GetTenantRepository ¶
func (c *ClusterUsecase) GetTenantRepository(ctx context.Context) (*Project, error)
func (*ClusterUsecase) ListClusters ¶ added in v0.3.1
func (c *ClusterUsecase) ListClusters(ctx context.Context) ([]*resourcev1alpha1.Cluster, error)
func (*ClusterUsecase) SaveCluster ¶
func (c *ClusterUsecase) SaveCluster(ctx context.Context, param *cluster.ClusterRegistrationParam, kubeconfig string) error
func (*ClusterUsecase) SaveDexConfig ¶
func (c *ClusterUsecase) SaveDexConfig(param *cluster.ClusterRegistrationParam, teantLocalPath string) error
func (*ClusterUsecase) SaveKubeconfig ¶
func (c *ClusterUsecase) SaveKubeconfig(ctx context.Context, id, server, config string) error
type CodeRepo ¶
type CodeRepo interface { GetCurrentUser(ctx context.Context) (user string, email string, err error) CreateCodeRepo(ctx context.Context, gid int, options *GitCodeRepoOptions) (*Project, error) UpdateCodeRepo(ctx context.Context, pid interface{}, options *GitCodeRepoOptions) (*Project, error) DeleteCodeRepo(ctx context.Context, pid interface{}) error GetCodeRepo(ctx context.Context, pid interface{}) (*Project, error) ListDeployKeys(ctx context.Context, pid interface{}, opt *ListOptions) ([]*ProjectDeployKey, error) ListAllDeployKeys(ctx context.Context, opt *ListOptions) ([]*ProjectDeployKey, error) GetDeployKey(ctx context.Context, pid interface{}, deployKeyID int) (*ProjectDeployKey, error) EnableProjectDeployKey(ctx context.Context, pid interface{}, deployKey int) (*ProjectDeployKey, error) UpdateDeployKey(ctx context.Context, pid interface{}, deployKey int, title string, canPush bool) (*ProjectDeployKey, error) SaveDeployKey(ctx context.Context, pid interface{}, title string, canPush bool, publicKey []byte) (*ProjectDeployKey, error) DeleteDeployKey(ctx context.Context, pid interface{}, deployKey int) error CreateGroup(ctx context.Context, gitOptions *GitGroupOptions) (*Group, error) DeleteGroup(ctx context.Context, gid interface{}) error UpdateGroup(ctx context.Context, gid interface{}, git *GitGroupOptions) (*Group, error) GetGroup(ctx context.Context, gid interface{}) (*Group, error) ListAllGroups(ctx context.Context) ([]*Group, error) ListGroupCodeRepos(ctx context.Context, gid interface{}, opts ...string) ([]*Project, error) ListCodeRepos(ctx context.Context, search string) ([]*Project, error) ListAccessTokens(ctx context.Context, pid interface{}, opt *ListOptions) ([]*ProjectAccessToken, error) GetProjectAccessToken(ctx context.Context, pid interface{}, id int) (*ProjectAccessToken, error) CreateProjectAccessToken(ctx context.Context, pid interface{}, opt *CreateProjectAccessTokenOptions) (*ProjectAccessToken, error) DeleteProjectAccessToken(ctx context.Context, pid interface{}, id int) error }
type CodeRepoBindingData ¶ added in v0.3.0
type CodeRepoBindingData struct { Name string Spec resourcev1alpha1.CodeRepoBindingSpec }
type CodeRepoBindingUsecase ¶ added in v0.3.0
type CodeRepoBindingUsecase struct {
// contains filtered or unexported fields
}
func NewCodeRepoCodeRepoBindingUsecase ¶ added in v0.3.0
func NewCodeRepoCodeRepoBindingUsecase(logger log.Logger, codeRepo CodeRepo, secretRepo Secretrepo, nodestree nodestree.NodesTree, resourcesUsecase *ResourcesUsecase, config *nautesconfigs.Config, client client.Client) *CodeRepoBindingUsecase
func (*CodeRepoBindingUsecase) CheckReference ¶ added in v0.3.0
func (c *CodeRepoBindingUsecase) CheckReference(options nodestree.CompareOptions, node *nodestree.Node, k8sClient client.Client) (bool, error)
func (*CodeRepoBindingUsecase) CreateNode ¶ added in v0.3.0
func (c *CodeRepoBindingUsecase) CreateNode(path string, data interface{}) (*nodestree.Node, error)
func (*CodeRepoBindingUsecase) CreateResource ¶ added in v0.3.0
func (c *CodeRepoBindingUsecase) CreateResource(kind string) interface{}
func (*CodeRepoBindingUsecase) DeleteCodeRepoBinding ¶ added in v0.3.0
func (c *CodeRepoBindingUsecase) DeleteCodeRepoBinding(ctx context.Context, options *BizOptions) error
func (*CodeRepoBindingUsecase) GetCodeRepoBinding ¶ added in v0.3.0
func (c *CodeRepoBindingUsecase) GetCodeRepoBinding(ctx context.Context, options *BizOptions) (*resourcev1alpha1.CodeRepoBinding, error)
func (*CodeRepoBindingUsecase) GetDeployKeyFromSecretRepo ¶ added in v0.3.0
func (c *CodeRepoBindingUsecase) GetDeployKeyFromSecretRepo(ctx context.Context, repoName, user, permissions string) (*DeployKeySecretData, error)
func (*CodeRepoBindingUsecase) ListCodeRepoBindings ¶ added in v0.3.0
func (c *CodeRepoBindingUsecase) ListCodeRepoBindings(ctx context.Context, options *BizOptions) ([]*nodestree.Node, error)
func (*CodeRepoBindingUsecase) RevokeDeployKey ¶ added in v0.3.0
func (c *CodeRepoBindingUsecase) RevokeDeployKey(ctx context.Context, codeRepos []*resourcev1alpha1.CodeRepo, authorizationpid interface{}, permissions string) error
func (*CodeRepoBindingUsecase) SaveCodeRepoBinding ¶ added in v0.3.0
func (c *CodeRepoBindingUsecase) SaveCodeRepoBinding(ctx context.Context, options *BizOptions, data *CodeRepoBindingData) error
func (*CodeRepoBindingUsecase) UpdateNode ¶ added in v0.3.0
type CodeRepoData ¶
type CodeRepoData struct { Name string Spec resourcev1alpha1.CodeRepoSpec }
type CodeRepoUsecase ¶
type CodeRepoUsecase struct {
// contains filtered or unexported fields
}
func NewCodeRepoUsecase ¶
func NewCodeRepoUsecase(logger log.Logger, codeRepo CodeRepo, secretRepo Secretrepo, nodestree nodestree.NodesTree, config *nautesconfigs.Config, resourcesUsecase *ResourcesUsecase, codeRepoBindingUsecase *CodeRepoBindingUsecase, client client.Client) *CodeRepoUsecase
func (*CodeRepoUsecase) CheckReference ¶
func (c *CodeRepoUsecase) CheckReference(options nodestree.CompareOptions, node *nodestree.Node, k8sClient client.Client) (bool, error)
func (*CodeRepoUsecase) CreateNode ¶
func (c *CodeRepoUsecase) CreateNode(path string, data interface{}) (*nodestree.Node, error)
func (*CodeRepoUsecase) CreateResource ¶
func (c *CodeRepoUsecase) CreateResource(kind string) interface{}
func (*CodeRepoUsecase) DeleteCodeRepo ¶
func (c *CodeRepoUsecase) DeleteCodeRepo(ctx context.Context, options *BizOptions) error
func (*CodeRepoUsecase) FilterAccessTokensByIDList ¶ added in v0.3.0
func (c *CodeRepoUsecase) FilterAccessTokensByIDList(ctx context.Context, pid int, idList map[int]bool) ([]*ProjectAccessToken, error)
func (*CodeRepoUsecase) FilterProjectDeployKeysByIDList ¶ added in v0.3.0
func (c *CodeRepoUsecase) FilterProjectDeployKeysByIDList(ctx context.Context, pid int, idList map[int]bool) ([]*ProjectDeployKey, error)
func (*CodeRepoUsecase) GetAllAccessTokens ¶ added in v0.3.0
func (c *CodeRepoUsecase) GetAllAccessTokens(ctx context.Context, pid int) ([]*ProjectAccessToken, error)
func (*CodeRepoUsecase) GetCodeRepo ¶
func (*CodeRepoUsecase) GetProjectByCodeRepoName ¶ added in v0.3.1
func (c *CodeRepoUsecase) GetProjectByCodeRepoName(ctx context.Context, codeRepoName, productName string) (*resourcev1alpha1.CodeRepo, *Project, error)
func (*CodeRepoUsecase) ListAccessTokens ¶ added in v0.3.0
func (c *CodeRepoUsecase) ListAccessTokens(ctx context.Context, pid int, opts *ListOptions) ([]interface{}, error)
func (*CodeRepoUsecase) ListCodeRepos ¶
func (*CodeRepoUsecase) SaveCodeRepo ¶
func (c *CodeRepoUsecase) SaveCodeRepo(ctx context.Context, options *BizOptions, data *CodeRepoData, gitOptions *GitCodeRepoOptions) error
func (*CodeRepoUsecase) UpdateNode ¶
type CreateProjectAccessTokenOptions ¶ added in v0.3.0
type CreateProjectAccessTokenOptions struct { // Name represents the name of the project access token. Name *string `url:"name,omitempty" json:"name,omitempty"` // Scopes represents the scopes to be granted to the project access token. Scopes *[]string `url:"scopes,omitempty" json:"scopes,omitempty"` // AccessLevel represents the access level to be granted to the project access token. AccessLevel *AccessLevelValue `url:"access_level,omitempty" json:"access_level,omitempty"` // ExpiresAt represents the date and time when the project access token will expire. ExpiresAt *ISOTime `url:"expires_at,omitempty" json:"expires_at,omitempty"` }
type DeployKeyProject ¶ added in v0.3.0
type DeployKeyProject struct { // The ID of the project ID int `json:"id"` // The description of the project Description string `json:"description"` // The name of the project Name string `json:"name"` // The name of the project with namespace NameWithNamespace string `json:"name_with_namespace"` // The path of the project Path string `json:"path"` // The path of the project with namespace PathWithNamespace string `json:"path_with_namespace"` // The date and time when the project was created CreatedAt *time.Time `json:"created_at"` }
type DeployKeySecretData ¶
type DeployKeyType ¶ added in v0.3.0
type DeployKeyType string
const ( // Git read-only and read-write permissions ReadOnly DeployKeyType = "readonly" ReadWrite DeployKeyType = "readwrite" )
Deploykey
type DeploymentRuntimeData ¶
type DeploymentRuntimeData struct { Name string Spec resourcev1alpha1.DeploymentRuntimeSpec }
type DeploymentRuntimeUsecase ¶
type DeploymentRuntimeUsecase struct {
// contains filtered or unexported fields
}
func NewDeploymentRuntimeUsecase ¶
func NewDeploymentRuntimeUsecase(logger log.Logger, codeRepo CodeRepo, nodestree nodestree.NodesTree, resourcesUsecase *ResourcesUsecase, client client.Client, config *nautesconfigs.Config) *DeploymentRuntimeUsecase
func (*DeploymentRuntimeUsecase) CheckReference ¶
func (d *DeploymentRuntimeUsecase) CheckReference(options nodestree.CompareOptions, node *nodestree.Node, k8sClient client.Client) (bool, error)
func (*DeploymentRuntimeUsecase) CreateNode ¶
func (e *DeploymentRuntimeUsecase) CreateNode(path string, data interface{}) (*nodestree.Node, error)
func (*DeploymentRuntimeUsecase) CreateResource ¶
func (d *DeploymentRuntimeUsecase) CreateResource(kind string) interface{}
func (*DeploymentRuntimeUsecase) DeleteDeploymentRuntime ¶
func (d *DeploymentRuntimeUsecase) DeleteDeploymentRuntime(ctx context.Context, options *BizOptions) error
func (*DeploymentRuntimeUsecase) GetDeploymentRuntime ¶
func (d *DeploymentRuntimeUsecase) GetDeploymentRuntime(ctx context.Context, deploymentRuntimeName, productName string) (*resourcev1alpha1.DeploymentRuntime, error)
func (*DeploymentRuntimeUsecase) ListDeploymentRuntimes ¶
func (*DeploymentRuntimeUsecase) SaveDeploymentRuntime ¶
func (d *DeploymentRuntimeUsecase) SaveDeploymentRuntime(ctx context.Context, options *BizOptions, data *DeploymentRuntimeData) error
func (*DeploymentRuntimeUsecase) UpdateNode ¶
type EnviromentData ¶
type EnviromentData struct { Name string Spec resourcev1alpha1.EnvironmentSpec }
type EnvironmentUsecase ¶
type EnvironmentUsecase struct {
// contains filtered or unexported fields
}
func NewEnviromentUsecase ¶
func NewEnviromentUsecase(logger log.Logger, config *nautesconfigs.Config, codeRepo CodeRepo, nodestree nodestree.NodesTree, resourcesUsecase *ResourcesUsecase) *EnvironmentUsecase
func (*EnvironmentUsecase) CheckReference ¶
func (e *EnvironmentUsecase) CheckReference(options nodestree.CompareOptions, node *nodestree.Node, k8sClient client.Client) (bool, error)
func (*EnvironmentUsecase) ConvertProductToGroupName ¶ added in v0.3.1
func (c *EnvironmentUsecase) ConvertProductToGroupName(ctx context.Context, env *resourcev1alpha1.Environment) error
func (*EnvironmentUsecase) CreateNode ¶
func (e *EnvironmentUsecase) CreateNode(path string, data interface{}) (*nodestree.Node, error)
func (*EnvironmentUsecase) CreateResource ¶
func (e *EnvironmentUsecase) CreateResource(kind string) interface{}
func (*EnvironmentUsecase) DeleteEnvironment ¶
func (e *EnvironmentUsecase) DeleteEnvironment(ctx context.Context, options *BizOptions) error
func (*EnvironmentUsecase) GetEnvironment ¶
func (e *EnvironmentUsecase) GetEnvironment(ctx context.Context, enviromentName, productName string) (*resourcev1alpha1.Environment, error)
func (*EnvironmentUsecase) ListEnvironments ¶
func (*EnvironmentUsecase) SaveEnvironment ¶
func (e *EnvironmentUsecase) SaveEnvironment(ctx context.Context, options *BizOptions, data *EnviromentData) error
func (*EnvironmentUsecase) UpdateNode ¶
type GitCodeRepoOptions ¶
type GitCodeRepoOptions struct { Gitlab *GitlabCodeRepoOptions Github interface{} }
type GitGroupOptions ¶
type GitGroupOptions struct { Github *GroupOptions Gitlab *GroupOptions }
type GitRepo ¶
type GitRepo interface { Commit(ctx context.Context, path string) error SaveConfig(ctx context.Context, path string) error Clone(ctx context.Context, param *CloneRepositoryParam) (string, error) Merge(ctx context.Context, path string) (string, error) Push(ctx context.Context, path string, command ...string) error Diff(ctx context.Context, path string, command ...string) (string, error) Fetch(ctx context.Context, path string, command ...string) (string, error) }
type GitlabCodeRepoOptions ¶
type GitlabCodeRepoOptions struct { // The name of the repository Name string `json:"name,omitempty"` // The path of the repository Path string `json:"path,omitempty"` // The visibility level of the repository Visibility string `json:"visibility,omitempty"` // The description of the repository Description string `json:"description,omitempty"` // The ID of the namespace to which the repository belongs NamespaceID int32 `json:"namespace_id,omitempty"` }
type Group ¶
type Group struct { ID int32 Name string Visibility string Description string Path string WebUrl string ParentId int32 }
func CreateGroup ¶
func UpdateGroup ¶
func UpdateGroup(ctx context.Context, codeRepo CodeRepo, configClient *nautesconfigs.Config, gid int, git *GitGroupOptions) (group *Group, err error)
type GroupAndProjectItem ¶
type GroupOptions ¶
type GroupOptions struct { // The name of the group Name string `json:"name,omitempty"` // The path of the group Path string `json:"path,omitempty"` // The visibility level of the group Visibility string `json:"visibility,omitempty"` // The description of the group Description string `json:"description,omitempty"` // The ID of the parent group ParentId int32 `json:"parent_id,omitempty"` }
type Kubernetes ¶ added in v0.3.0
type Kubernetes interface { ListCodeRepo(ctx context.Context) (*resourcev1alpha1.CodeRepoList, error) ListCodeRepoBindings(ctx context.Context) (*resourcev1alpha1.CodeRepoBindingList, error) }
type ListMatchOptions ¶ added in v0.3.0
type ListMatchOptions func(*resourcev1alpha1.CodeRepo) bool
type ListOptions ¶
type MockCodeRepo ¶
type MockCodeRepo struct {
// contains filtered or unexported fields
}
MockCodeRepo is a mock of CodeRepo interface.
func NewMockCodeRepo ¶
func NewMockCodeRepo(ctrl *gomock.Controller) *MockCodeRepo
NewMockCodeRepo creates a new mock instance.
func (*MockCodeRepo) CreateCodeRepo ¶
func (m *MockCodeRepo) CreateCodeRepo(ctx context.Context, gid int, options *GitCodeRepoOptions) (*Project, error)
CreateCodeRepo mocks base method.
func (*MockCodeRepo) CreateGroup ¶
func (m *MockCodeRepo) CreateGroup(ctx context.Context, gitOptions *GitGroupOptions) (*Group, error)
CreateGroup mocks base method.
func (*MockCodeRepo) CreateProjectAccessToken ¶ added in v0.3.0
func (m *MockCodeRepo) CreateProjectAccessToken(ctx context.Context, pid interface{}, opt *CreateProjectAccessTokenOptions) (*ProjectAccessToken, error)
CreateProjectAccessToken mocks base method.
func (*MockCodeRepo) DeleteCodeRepo ¶
func (m *MockCodeRepo) DeleteCodeRepo(ctx context.Context, pid interface{}) error
DeleteCodeRepo mocks base method.
func (*MockCodeRepo) DeleteDeployKey ¶
func (m *MockCodeRepo) DeleteDeployKey(ctx context.Context, pid interface{}, deployKey int) error
DeleteDeployKey mocks base method.
func (*MockCodeRepo) DeleteGroup ¶
func (m *MockCodeRepo) DeleteGroup(ctx context.Context, gid interface{}) error
DeleteGroup mocks base method.
func (*MockCodeRepo) DeleteProjectAccessToken ¶ added in v0.3.0
func (m *MockCodeRepo) DeleteProjectAccessToken(ctx context.Context, pid interface{}, id int) error
DeleteProjectAccessToken mocks base method.
func (*MockCodeRepo) EXPECT ¶
func (m *MockCodeRepo) EXPECT() *MockCodeRepoMockRecorder
EXPECT returns an object that allows the caller to indicate expected use.
func (*MockCodeRepo) EnableProjectDeployKey ¶ added in v0.3.0
func (m *MockCodeRepo) EnableProjectDeployKey(ctx context.Context, pid interface{}, deployKey int) (*ProjectDeployKey, error)
EnableProjectDeployKey mocks base method.
func (*MockCodeRepo) GetCodeRepo ¶
func (m *MockCodeRepo) GetCodeRepo(ctx context.Context, pid interface{}) (*Project, error)
GetCodeRepo mocks base method.
func (*MockCodeRepo) GetCurrentUser ¶
GetCurrentUser mocks base method.
func (*MockCodeRepo) GetDeployKey ¶
func (m *MockCodeRepo) GetDeployKey(ctx context.Context, pid interface{}, deployKeyID int) (*ProjectDeployKey, error)
GetDeployKey mocks base method.
func (*MockCodeRepo) GetGroup ¶
func (m *MockCodeRepo) GetGroup(ctx context.Context, gid interface{}) (*Group, error)
GetGroup mocks base method.
func (*MockCodeRepo) GetProjectAccessToken ¶ added in v0.3.0
func (m *MockCodeRepo) GetProjectAccessToken(ctx context.Context, pid interface{}, id int) (*ProjectAccessToken, error)
GetProjectAccessToken mocks base method.
func (*MockCodeRepo) ListAccessTokens ¶ added in v0.3.0
func (m *MockCodeRepo) ListAccessTokens(ctx context.Context, pid interface{}, opt *ListOptions) ([]*ProjectAccessToken, error)
ListAccessTokens mocks base method.
func (*MockCodeRepo) ListAllDeployKeys ¶ added in v0.3.0
func (m *MockCodeRepo) ListAllDeployKeys(ctx context.Context, opt *ListOptions) ([]*ProjectDeployKey, error)
ListAllDeployKeys mocks base method.
func (*MockCodeRepo) ListAllGroups ¶
func (m *MockCodeRepo) ListAllGroups(ctx context.Context) ([]*Group, error)
ListAllGroups mocks base method.
func (*MockCodeRepo) ListCodeRepos ¶ added in v0.3.4
ListCodeRepos mocks base method.
func (*MockCodeRepo) ListDeployKeys ¶
func (m *MockCodeRepo) ListDeployKeys(ctx context.Context, pid interface{}, opt *ListOptions) ([]*ProjectDeployKey, error)
ListDeployKeys mocks base method.
func (*MockCodeRepo) ListGroupCodeRepos ¶
func (m *MockCodeRepo) ListGroupCodeRepos(ctx context.Context, gid interface{}, opts ...string) ([]*Project, error)
ListGroupCodeRepos mocks base method.
func (*MockCodeRepo) SaveDeployKey ¶
func (m *MockCodeRepo) SaveDeployKey(ctx context.Context, pid interface{}, title string, canPush bool, publicKey []byte) (*ProjectDeployKey, error)
SaveDeployKey mocks base method.
func (*MockCodeRepo) UpdateCodeRepo ¶
func (m *MockCodeRepo) UpdateCodeRepo(ctx context.Context, pid interface{}, options *GitCodeRepoOptions) (*Project, error)
UpdateCodeRepo mocks base method.
func (*MockCodeRepo) UpdateDeployKey ¶ added in v0.3.0
func (m *MockCodeRepo) UpdateDeployKey(ctx context.Context, pid interface{}, deployKey int, title string, canPush bool) (*ProjectDeployKey, error)
UpdateDeployKey mocks base method.
func (*MockCodeRepo) UpdateGroup ¶
func (m *MockCodeRepo) UpdateGroup(ctx context.Context, gid interface{}, git *GitGroupOptions) (*Group, error)
UpdateGroup mocks base method.
type MockCodeRepoMockRecorder ¶
type MockCodeRepoMockRecorder struct {
// contains filtered or unexported fields
}
MockCodeRepoMockRecorder is the mock recorder for MockCodeRepo.
func (*MockCodeRepoMockRecorder) CreateCodeRepo ¶
func (mr *MockCodeRepoMockRecorder) CreateCodeRepo(ctx, gid, options interface{}) *gomock.Call
CreateCodeRepo indicates an expected call of CreateCodeRepo.
func (*MockCodeRepoMockRecorder) CreateGroup ¶
func (mr *MockCodeRepoMockRecorder) CreateGroup(ctx, gitOptions interface{}) *gomock.Call
CreateGroup indicates an expected call of CreateGroup.
func (*MockCodeRepoMockRecorder) CreateProjectAccessToken ¶ added in v0.3.0
func (mr *MockCodeRepoMockRecorder) CreateProjectAccessToken(ctx, pid, opt interface{}) *gomock.Call
CreateProjectAccessToken indicates an expected call of CreateProjectAccessToken.
func (*MockCodeRepoMockRecorder) DeleteCodeRepo ¶
func (mr *MockCodeRepoMockRecorder) DeleteCodeRepo(ctx, pid interface{}) *gomock.Call
DeleteCodeRepo indicates an expected call of DeleteCodeRepo.
func (*MockCodeRepoMockRecorder) DeleteDeployKey ¶
func (mr *MockCodeRepoMockRecorder) DeleteDeployKey(ctx, pid, deployKey interface{}) *gomock.Call
DeleteDeployKey indicates an expected call of DeleteDeployKey.
func (*MockCodeRepoMockRecorder) DeleteGroup ¶
func (mr *MockCodeRepoMockRecorder) DeleteGroup(ctx, gid interface{}) *gomock.Call
DeleteGroup indicates an expected call of DeleteGroup.
func (*MockCodeRepoMockRecorder) DeleteProjectAccessToken ¶ added in v0.3.0
func (mr *MockCodeRepoMockRecorder) DeleteProjectAccessToken(ctx, pid, id interface{}) *gomock.Call
DeleteProjectAccessToken indicates an expected call of DeleteProjectAccessToken.
func (*MockCodeRepoMockRecorder) EnableProjectDeployKey ¶ added in v0.3.0
func (mr *MockCodeRepoMockRecorder) EnableProjectDeployKey(ctx, pid, deployKey interface{}) *gomock.Call
EnableProjectDeployKey indicates an expected call of EnableProjectDeployKey.
func (*MockCodeRepoMockRecorder) GetCodeRepo ¶
func (mr *MockCodeRepoMockRecorder) GetCodeRepo(ctx, pid interface{}) *gomock.Call
GetCodeRepo indicates an expected call of GetCodeRepo.
func (*MockCodeRepoMockRecorder) GetCurrentUser ¶
func (mr *MockCodeRepoMockRecorder) GetCurrentUser(ctx interface{}) *gomock.Call
GetCurrentUser indicates an expected call of GetCurrentUser.
func (*MockCodeRepoMockRecorder) GetDeployKey ¶
func (mr *MockCodeRepoMockRecorder) GetDeployKey(ctx, pid, deployKeyID interface{}) *gomock.Call
GetDeployKey indicates an expected call of GetDeployKey.
func (*MockCodeRepoMockRecorder) GetGroup ¶
func (mr *MockCodeRepoMockRecorder) GetGroup(ctx, gid interface{}) *gomock.Call
GetGroup indicates an expected call of GetGroup.
func (*MockCodeRepoMockRecorder) GetProjectAccessToken ¶ added in v0.3.0
func (mr *MockCodeRepoMockRecorder) GetProjectAccessToken(ctx, pid, id interface{}) *gomock.Call
GetProjectAccessToken indicates an expected call of GetProjectAccessToken.
func (*MockCodeRepoMockRecorder) ListAccessTokens ¶ added in v0.3.0
func (mr *MockCodeRepoMockRecorder) ListAccessTokens(ctx, pid, opt interface{}) *gomock.Call
ListAccessTokens indicates an expected call of ListAccessTokens.
func (*MockCodeRepoMockRecorder) ListAllDeployKeys ¶ added in v0.3.0
func (mr *MockCodeRepoMockRecorder) ListAllDeployKeys(ctx, opt interface{}) *gomock.Call
ListAllDeployKeys indicates an expected call of ListAllDeployKeys.
func (*MockCodeRepoMockRecorder) ListAllGroups ¶
func (mr *MockCodeRepoMockRecorder) ListAllGroups(ctx interface{}) *gomock.Call
ListAllGroups indicates an expected call of ListAllGroups.
func (*MockCodeRepoMockRecorder) ListCodeRepos ¶ added in v0.3.4
func (mr *MockCodeRepoMockRecorder) ListCodeRepos(ctx, search interface{}) *gomock.Call
ListCodeRepos indicates an expected call of ListCodeRepos.
func (*MockCodeRepoMockRecorder) ListDeployKeys ¶
func (mr *MockCodeRepoMockRecorder) ListDeployKeys(ctx, pid, opt interface{}) *gomock.Call
ListDeployKeys indicates an expected call of ListDeployKeys.
func (*MockCodeRepoMockRecorder) ListGroupCodeRepos ¶
func (mr *MockCodeRepoMockRecorder) ListGroupCodeRepos(ctx, gid interface{}, opts ...interface{}) *gomock.Call
ListGroupCodeRepos indicates an expected call of ListGroupCodeRepos.
func (*MockCodeRepoMockRecorder) SaveDeployKey ¶
func (mr *MockCodeRepoMockRecorder) SaveDeployKey(ctx, pid, title, canPush, publicKey interface{}) *gomock.Call
SaveDeployKey indicates an expected call of SaveDeployKey.
func (*MockCodeRepoMockRecorder) UpdateCodeRepo ¶
func (mr *MockCodeRepoMockRecorder) UpdateCodeRepo(ctx, pid, options interface{}) *gomock.Call
UpdateCodeRepo indicates an expected call of UpdateCodeRepo.
func (*MockCodeRepoMockRecorder) UpdateDeployKey ¶ added in v0.3.0
func (mr *MockCodeRepoMockRecorder) UpdateDeployKey(ctx, pid, deployKey, title, canPush interface{}) *gomock.Call
UpdateDeployKey indicates an expected call of UpdateDeployKey.
func (*MockCodeRepoMockRecorder) UpdateGroup ¶
func (mr *MockCodeRepoMockRecorder) UpdateGroup(ctx, gid, git interface{}) *gomock.Call
UpdateGroup indicates an expected call of UpdateGroup.
type MockDexRepo ¶
type MockDexRepo struct {
// contains filtered or unexported fields
}
MockDexRepo is a mock of DexRepo interface.
func NewMockDexRepo ¶
func NewMockDexRepo(ctrl *gomock.Controller) *MockDexRepo
NewMockDexRepo creates a new mock instance.
func (*MockDexRepo) EXPECT ¶
func (m *MockDexRepo) EXPECT() *MockDexRepoMockRecorder
EXPECT returns an object that allows the caller to indicate expected use.
func (*MockDexRepo) RemoveRedirectURIs ¶
func (m *MockDexRepo) RemoveRedirectURIs(redirectURIs string) error
RemoveRedirectURIs mocks base method.
func (*MockDexRepo) UpdateRedirectURIs ¶
func (m *MockDexRepo) UpdateRedirectURIs(redirectURI string) error
UpdateRedirectURIs mocks base method.
type MockDexRepoMockRecorder ¶
type MockDexRepoMockRecorder struct {
// contains filtered or unexported fields
}
MockDexRepoMockRecorder is the mock recorder for MockDexRepo.
func (*MockDexRepoMockRecorder) RemoveRedirectURIs ¶
func (mr *MockDexRepoMockRecorder) RemoveRedirectURIs(redirectURIs interface{}) *gomock.Call
RemoveRedirectURIs indicates an expected call of RemoveRedirectURIs.
func (*MockDexRepoMockRecorder) UpdateRedirectURIs ¶
func (mr *MockDexRepoMockRecorder) UpdateRedirectURIs(redirectURI interface{}) *gomock.Call
UpdateRedirectURIs indicates an expected call of UpdateRedirectURIs.
type MockGitRepo ¶
type MockGitRepo struct {
// contains filtered or unexported fields
}
MockGitRepo is a mock of GitRepo interface.
func NewMockGitRepo ¶
func NewMockGitRepo(ctrl *gomock.Controller) *MockGitRepo
NewMockGitRepo creates a new mock instance.
func (*MockGitRepo) Clone ¶
func (m *MockGitRepo) Clone(ctx context.Context, param *CloneRepositoryParam) (string, error)
Clone mocks base method.
func (*MockGitRepo) Commit ¶
func (m *MockGitRepo) Commit(ctx context.Context, path string) error
Commit mocks base method.
func (*MockGitRepo) EXPECT ¶
func (m *MockGitRepo) EXPECT() *MockGitRepoMockRecorder
EXPECT returns an object that allows the caller to indicate expected use.
func (*MockGitRepo) SaveConfig ¶
func (m *MockGitRepo) SaveConfig(ctx context.Context, path string) error
SaveConfig mocks base method.
type MockGitRepoMockRecorder ¶
type MockGitRepoMockRecorder struct {
// contains filtered or unexported fields
}
MockGitRepoMockRecorder is the mock recorder for MockGitRepo.
func (*MockGitRepoMockRecorder) Clone ¶
func (mr *MockGitRepoMockRecorder) Clone(ctx, param interface{}) *gomock.Call
Clone indicates an expected call of Clone.
func (*MockGitRepoMockRecorder) Commit ¶
func (mr *MockGitRepoMockRecorder) Commit(ctx, path interface{}) *gomock.Call
Commit indicates an expected call of Commit.
func (*MockGitRepoMockRecorder) Diff ¶
func (mr *MockGitRepoMockRecorder) Diff(ctx, path interface{}, command ...interface{}) *gomock.Call
Diff indicates an expected call of Diff.
func (*MockGitRepoMockRecorder) Fetch ¶
func (mr *MockGitRepoMockRecorder) Fetch(ctx, path interface{}, command ...interface{}) *gomock.Call
Fetch indicates an expected call of Fetch.
func (*MockGitRepoMockRecorder) Merge ¶
func (mr *MockGitRepoMockRecorder) Merge(ctx, path interface{}) *gomock.Call
Merge indicates an expected call of Merge.
func (*MockGitRepoMockRecorder) Push ¶
func (mr *MockGitRepoMockRecorder) Push(ctx, path interface{}, command ...interface{}) *gomock.Call
Push indicates an expected call of Push.
func (*MockGitRepoMockRecorder) SaveConfig ¶
func (mr *MockGitRepoMockRecorder) SaveConfig(ctx, path interface{}) *gomock.Call
SaveConfig indicates an expected call of SaveConfig.
type MockKubernetes ¶ added in v0.3.0
type MockKubernetes struct {
// contains filtered or unexported fields
}
MockKubernetes is a mock of Kubernetes interface.
func NewMockKubernetes ¶ added in v0.3.0
func NewMockKubernetes(ctrl *gomock.Controller) *MockKubernetes
NewMockKubernetes creates a new mock instance.
func (*MockKubernetes) EXPECT ¶ added in v0.3.0
func (m *MockKubernetes) EXPECT() *MockKubernetesMockRecorder
EXPECT returns an object that allows the caller to indicate expected use.
func (*MockKubernetes) ListCodeRepo ¶ added in v0.3.0
func (m *MockKubernetes) ListCodeRepo(ctx context.Context) (*v1alpha1.CodeRepoList, error)
ListCodeRepo mocks base method.
func (*MockKubernetes) ListCodeRepoBindings ¶ added in v0.3.0
func (m *MockKubernetes) ListCodeRepoBindings(ctx context.Context) (*v1alpha1.CodeRepoBindingList, error)
ListCodeRepoBindings mocks base method.
type MockKubernetesMockRecorder ¶ added in v0.3.0
type MockKubernetesMockRecorder struct {
// contains filtered or unexported fields
}
MockKubernetesMockRecorder is the mock recorder for MockKubernetes.
func (*MockKubernetesMockRecorder) ListCodeRepo ¶ added in v0.3.0
func (mr *MockKubernetesMockRecorder) ListCodeRepo(ctx interface{}) *gomock.Call
ListCodeRepo indicates an expected call of ListCodeRepo.
func (*MockKubernetesMockRecorder) ListCodeRepoBindings ¶ added in v0.3.0
func (mr *MockKubernetesMockRecorder) ListCodeRepoBindings(ctx interface{}) *gomock.Call
ListCodeRepoBindings indicates an expected call of ListCodeRepoBindings.
type MockSecretrepo ¶
type MockSecretrepo struct {
// contains filtered or unexported fields
}
MockSecretrepo is a mock of Secretrepo interface.
func NewMockSecretrepo ¶
func NewMockSecretrepo(ctrl *gomock.Controller) *MockSecretrepo
NewMockSecretrepo creates a new mock instance.
func (*MockSecretrepo) AuthorizationSecret ¶
func (m *MockSecretrepo) AuthorizationSecret(ctx context.Context, id int, destUser, gitType, mountPath string) error
AuthorizationSecret mocks base method.
func (*MockSecretrepo) DeleteSecret ¶
DeleteSecret mocks base method.
func (*MockSecretrepo) EXPECT ¶
func (m *MockSecretrepo) EXPECT() *MockSecretrepoMockRecorder
EXPECT returns an object that allows the caller to indicate expected use.
func (*MockSecretrepo) GetDeployKey ¶
func (m *MockSecretrepo) GetDeployKey(ctx context.Context, secretOptions *SecretOptions) (*DeployKeySecretData, error)
GetDeployKey mocks base method.
func (*MockSecretrepo) GetProjectAccessToken ¶ added in v0.3.0
func (m *MockSecretrepo) GetProjectAccessToken(ctx context.Context, secretOptions *SecretOptions) (*AccessTokenSecretData, error)
GetProjectAccessToken mocks base method.
func (*MockSecretrepo) GetSecret ¶
func (m *MockSecretrepo) GetSecret(ctx context.Context, secretOptions *SecretOptions) (string, error)
GetSecret mocks base method.
func (*MockSecretrepo) SaveClusterConfig ¶
func (m *MockSecretrepo) SaveClusterConfig(ctx context.Context, id, config string) error
SaveClusterConfig mocks base method.
func (*MockSecretrepo) SaveDeployKey ¶
func (m *MockSecretrepo) SaveDeployKey(ctx context.Context, id, key, user, permission string, extendKVs map[string]string) error
SaveDeployKey mocks base method.
func (*MockSecretrepo) SaveProjectAccessToken ¶ added in v0.3.0
func (m *MockSecretrepo) SaveProjectAccessToken(ctx context.Context, id, token, user, permission string, extendKVs map[string]string) error
SaveProjectAccessToken mocks base method.
type MockSecretrepoMockRecorder ¶
type MockSecretrepoMockRecorder struct {
// contains filtered or unexported fields
}
MockSecretrepoMockRecorder is the mock recorder for MockSecretrepo.
func (*MockSecretrepoMockRecorder) AuthorizationSecret ¶
func (mr *MockSecretrepoMockRecorder) AuthorizationSecret(ctx, id, destUser, gitType, mountPath interface{}) *gomock.Call
AuthorizationSecret indicates an expected call of AuthorizationSecret.
func (*MockSecretrepoMockRecorder) DeleteSecret ¶
func (mr *MockSecretrepoMockRecorder) DeleteSecret(ctx, id, user, permission interface{}) *gomock.Call
DeleteSecret indicates an expected call of DeleteSecret.
func (*MockSecretrepoMockRecorder) GetDeployKey ¶
func (mr *MockSecretrepoMockRecorder) GetDeployKey(ctx, secretOptions interface{}) *gomock.Call
GetDeployKey indicates an expected call of GetDeployKey.
func (*MockSecretrepoMockRecorder) GetProjectAccessToken ¶ added in v0.3.0
func (mr *MockSecretrepoMockRecorder) GetProjectAccessToken(ctx, secretOptions interface{}) *gomock.Call
GetProjectAccessToken indicates an expected call of GetProjectAccessToken.
func (*MockSecretrepoMockRecorder) GetSecret ¶
func (mr *MockSecretrepoMockRecorder) GetSecret(ctx, secretOptions interface{}) *gomock.Call
GetSecret indicates an expected call of GetSecret.
func (*MockSecretrepoMockRecorder) SaveClusterConfig ¶
func (mr *MockSecretrepoMockRecorder) SaveClusterConfig(ctx, id, config interface{}) *gomock.Call
SaveClusterConfig indicates an expected call of SaveClusterConfig.
func (*MockSecretrepoMockRecorder) SaveDeployKey ¶
func (mr *MockSecretrepoMockRecorder) SaveDeployKey(ctx, id, key, user, permission, extendKVs interface{}) *gomock.Call
SaveDeployKey indicates an expected call of SaveDeployKey.
func (*MockSecretrepoMockRecorder) SaveProjectAccessToken ¶ added in v0.3.0
func (mr *MockSecretrepoMockRecorder) SaveProjectAccessToken(ctx, id, token, user, permission, extendKVs interface{}) *gomock.Call
SaveProjectAccessToken indicates an expected call of SaveProjectAccessToken.
type PipelineRuntimeValidateClient ¶ added in v0.3.0
type PipelineRuntimeValidateClient struct {
// contains filtered or unexported fields
}
func (*PipelineRuntimeValidateClient) GetCodeRepoBindingList ¶ added in v0.3.0
func (p *PipelineRuntimeValidateClient) GetCodeRepoBindingList(productName, repoName string) (*resourcev1alpha1.CodeRepoBindingList, error)
func (*PipelineRuntimeValidateClient) GetCodeRepoList ¶ added in v0.3.0
func (p *PipelineRuntimeValidateClient) GetCodeRepoList(repoName string) (*resourcev1alpha1.CodeRepoList, error)
type ProductAuthorization ¶ added in v0.3.0
type ProductUsecase ¶
type ProductUsecase struct {
// contains filtered or unexported fields
}
ProductUsecase is a Product usecase.
func NewProductUsecase ¶
func NewProductUsecase(logger log.Logger, codeRepo CodeRepo, secretRepo Secretrepo, gitRepo GitRepo, configs *nautesconfigs.Config, resourcesUsecase *ResourcesUsecase, codeRepoUsecase *CodeRepoUsecase) *ProductUsecase
func (*ProductUsecase) DeleteProduct ¶
func (p *ProductUsecase) DeleteProduct(ctx context.Context, productID string) error
func (*ProductUsecase) GetGroupAndDefaultProject ¶
func (p *ProductUsecase) GetGroupAndDefaultProject(ctx context.Context, productName string) (*GroupAndProjectItem, error)
func (*ProductUsecase) GetProduct ¶
func (p *ProductUsecase) GetProduct(ctx context.Context, productName string) (*GroupAndProjectItem, error)
func (*ProductUsecase) ListProducts ¶
func (p *ProductUsecase) ListProducts(ctx context.Context) ([]*GroupAndProjectItem, error)
func (*ProductUsecase) SaveProduct ¶
func (p *ProductUsecase) SaveProduct(ctx context.Context, productName string, gitOptions *GitGroupOptions) (group *Group, project *Project, err error)
type Project ¶
type ProjectAccessToken ¶ added in v0.3.0
type ProjectAccessToken struct { // ID represents the unique identifier of the project access token. ID int `json:"id"` // UserID represents the unique identifier of the user associated with the project access token. UserID int `json:"user_id"` // Name represents the name of the project access token. Name string `json:"name"` // Scopes represents the scopes granted to the project access token. Scopes []string `json:"scopes"` // CreatedAt represents the date and time when the project access token was created. CreatedAt *time.Time `json:"created_at"` // LastUsedAt represents the date and time when the project access token was last used. LastUsedAt *time.Time `json:"last_used_at"` // ExpiresAt represents the date and time when the project access token will expire. ExpiresAt *ISOTime `json:"expires_at"` // Active represents whether the project access token is active or not. Active bool `json:"active"` // Revoked represents whether the project access token has been revoked or not. Revoked bool `json:"revoked"` // Token represents the value of the project access token. Token string `json:"token"` // AccessLevel represents the access level granted to the project access token. AccessLevel AccessLevelValue `json:"access_level"` }
type ProjectData ¶
type ProjectDeployKey ¶
type ProjectDeployKey struct { // The ID of the deploy key ID int `json:"id"` // The title of the deploy key Title string `json:"title"` // The key value of the deploy key Key string `json:"key"` // The date and time when the deploy key was created CreatedAt *time.Time `json:"created_at"` // Whether the deploy key has push access CanPush bool `json:"can_push"` // The fingerprint of the deploy key Fingerprint string `json:"fingerprint"` // The projects that have write access to this deploy key ProjectsWithWriteAccess []*DeployKeyProject `json:"projects_with_write_access"` }
func GetAllDeployKeys ¶ added in v0.3.0
type ProjectNamespace ¶ added in v0.3.0
type ProjectPipelineRuntimeData ¶
type ProjectPipelineRuntimeData struct { Name string Spec resourcev1alpha1.ProjectPipelineRuntimeSpec }
type ProjectPipelineRuntimeUsecase ¶
type ProjectPipelineRuntimeUsecase struct {
// contains filtered or unexported fields
}
func NewProjectPipelineRuntimeUsecase ¶
func NewProjectPipelineRuntimeUsecase(logger log.Logger, codeRepo CodeRepo, nodestree nodestree.NodesTree, resourcesUsecase *ResourcesUsecase, client client.Client, config *nautesconfigs.Config) *ProjectPipelineRuntimeUsecase
func (*ProjectPipelineRuntimeUsecase) CheckReference ¶
func (p *ProjectPipelineRuntimeUsecase) CheckReference(options nodestree.CompareOptions, node *nodestree.Node, k8sClient client.Client) (bool, error)
func (*ProjectPipelineRuntimeUsecase) CreateNode ¶
func (p *ProjectPipelineRuntimeUsecase) CreateNode(path string, data interface{}) (*nodestree.Node, error)
func (*ProjectPipelineRuntimeUsecase) CreateResource ¶
func (p *ProjectPipelineRuntimeUsecase) CreateResource(kind string) interface{}
func (*ProjectPipelineRuntimeUsecase) DeleteProjectPipelineRuntime ¶
func (p *ProjectPipelineRuntimeUsecase) DeleteProjectPipelineRuntime(ctx context.Context, options *BizOptions) error
func (*ProjectPipelineRuntimeUsecase) GetProjectPipelineRuntime ¶
func (*ProjectPipelineRuntimeUsecase) IsRepositoryExist ¶ added in v0.3.0
func (*ProjectPipelineRuntimeUsecase) ListProjectPipelineRuntimes ¶
func (*ProjectPipelineRuntimeUsecase) SaveProjectPipelineRuntime ¶
func (p *ProjectPipelineRuntimeUsecase) SaveProjectPipelineRuntime(ctx context.Context, options *BizOptions, data *ProjectPipelineRuntimeData) error
func (*ProjectPipelineRuntimeUsecase) UpdateNode ¶
type ProjectUsecase ¶
type ProjectUsecase struct {
// contains filtered or unexported fields
}
func NewProjectUsecase ¶
func NewProjectUsecase(logger log.Logger, codeRepo CodeRepo, secretRepo Secretrepo, nodestree nodestree.NodesTree, configs *nautesconfigs.Config, resourcesUsecase *ResourcesUsecase) *ProjectUsecase
func (*ProjectUsecase) CheckReference ¶
func (p *ProjectUsecase) CheckReference(options nodestree.CompareOptions, node *nodestree.Node, k8sClient client.Client) (bool, error)
func (*ProjectUsecase) CreateNode ¶
func (p *ProjectUsecase) CreateNode(path string, data interface{}) (*nodestree.Node, error)
func (*ProjectUsecase) CreateResource ¶
func (p *ProjectUsecase) CreateResource(kind string) interface{}
func (*ProjectUsecase) DeleteProject ¶
func (p *ProjectUsecase) DeleteProject(ctx context.Context, options *BizOptions) error
func (*ProjectUsecase) GetProject ¶
func (p *ProjectUsecase) GetProject(ctx context.Context, projectName, productName string) (*resourcev1alpha1.Project, error)
func (*ProjectUsecase) ListProjects ¶
func (p *ProjectUsecase) ListProjects(ctx context.Context, productName string) ([]*resourcev1alpha1.Project, error)
func (*ProjectUsecase) SaveProject ¶
func (p *ProjectUsecase) SaveProject(ctx context.Context, options *BizOptions, data *ProjectData) error
func (*ProjectUsecase) UpdateNode ¶
type ResourceInfo ¶ added in v0.3.1
type ResourceInfo struct { // The product name to which the resource belongs ProductName string // Method of operating resources Method string // Parent class resource kind ParentResouceKind string // Parent class resource name ParentResourceName string // Current resource kind ResourceKind string // Current resource name ResourceName string }
type ResourcesUsecase ¶
type ResourcesUsecase struct {
// contains filtered or unexported fields
}
func NewResourcesUsecase ¶
func NewResourcesUsecase(log log.Logger, codeRepo CodeRepo, secretRepo Secretrepo, gitRepo GitRepo, nodestree nodestree.NodesTree, configs *nautesconfigs.Config) *ResourcesUsecase
func (*ResourcesUsecase) CloneCodeRepo ¶
func (*ResourcesUsecase) ConvertCodeRepoToRepoName ¶ added in v0.3.1
func (*ResourcesUsecase) ConvertGroupToProduct ¶ added in v0.3.1
func (*ResourcesUsecase) ConvertProductToGroupName ¶ added in v0.3.1
func (*ResourcesUsecase) ConvertRepoNameToCodeRepo ¶ added in v0.3.1
func (*ResourcesUsecase) Delete ¶
func (r *ResourcesUsecase) Delete(ctx context.Context, resourceOptions *resourceOptions, getResourceName getResouceName) error
func (*ResourcesUsecase) Get ¶
func (r *ResourcesUsecase) Get(ctx context.Context, resourceKind, productName string, operator nodestree.NodesOperator, getResourceName getResouceName) (*nodestree.Node, error)
func (*ResourcesUsecase) GetCodeRepo ¶
func (r *ResourcesUsecase) GetCodeRepo(ctx context.Context, ProductName, codeRepoName string) (*Project, error)
GetCodeRepoName The name of the codeRepo resource must be prefixed with repo-, eg: repo-1
func (*ResourcesUsecase) GetGroupAndProjectByGroupID ¶ added in v0.3.0
func (*ResourcesUsecase) GetNode ¶
func (r *ResourcesUsecase) GetNode(nodes *nodestree.Node, kind, resourceName string) *nodestree.Node
GetNode get specifial node accroding to resource kind and name
func (*ResourcesUsecase) GetNodes ¶ added in v0.3.0
func (r *ResourcesUsecase) GetNodes() (*nodestree.Node, error)
func (*ResourcesUsecase) InsertNodes ¶
func (*ResourcesUsecase) List ¶
func (r *ResourcesUsecase) List(ctx context.Context, gid interface{}, operator nodestree.NodesOperator) (*nodestree.Node, error)
func (*ResourcesUsecase) RemoveNode ¶
RemoveNode delete the specified node accroding to the path
func (*ResourcesUsecase) Save ¶
func (r *ResourcesUsecase) Save(ctx context.Context, resourceOptions *resourceOptions, data interface{}) error
Save create or update config to git platform
func (*ResourcesUsecase) SaveConfig ¶
func (r *ResourcesUsecase) SaveConfig(ctx context.Context, path string) error
SaveConfig Save project resource config to git platform If automatic merge fails will retry three times
func (*ResourcesUsecase) SaveDeployConfig ¶
func (r *ResourcesUsecase) SaveDeployConfig(nodes *nodestree.Node, path string) error
func (*ResourcesUsecase) WriteResource ¶
func (r *ResourcesUsecase) WriteResource(node *nodestree.Node) (err error)
WriteResource Write project resource content to a file
type RretryCountType ¶
type RretryCountType string
const ( // When pushing code configuration, there is a key with a context retry RretryCount RretryCountType = "RretryCount" )
type SecretData ¶
type SecretOptions ¶
type Secretrepo ¶
type Secretrepo interface { GetSecret(ctx context.Context, secretOptions *SecretOptions) (string, error) GetDeployKey(ctx context.Context, secretOptions *SecretOptions) (*DeployKeySecretData, error) SaveDeployKey(ctx context.Context, id, key, user, permission string, extendKVs map[string]string) error SaveProjectAccessToken(ctx context.Context, id, token, user, permission string, extendKVs map[string]string) error SaveClusterConfig(ctx context.Context, id, config string) error DeleteSecret(ctx context.Context, id int, user, permission string) error AuthorizationSecret(ctx context.Context, id int, destUser, gitType, mountPath string) error GetProjectAccessToken(ctx context.Context, secretOptions *SecretOptions) (*AccessTokenSecretData, error) }