Documentation
¶
Index ¶
- Constants
- type AccessInfo
- type AccessType
- type AdditionalResource
- type ArifactRepo
- type Auth
- type Cluster
- type CodeRepo
- type CodeRepoPermission
- type Deployment
- type DeploymentDeploymentResult
- type EnvManager
- type EnvironmentDeploymentResult
- type EventBus
- type EventBusDeploymentResult
- type Pipeline
- type Role
- type Runtime
- type RuntimeDeploymentResult
- type RuntimeSyncTask
- type RuntimeSyncer
- type RuntimeType
- type Secret
- type SecretClient
- type SecretInfo
- type SecretType
- type SelectedApp
Constants ¶
View Source
const ( CODE_REPO_NAME_PREFIX = "repo" PRODUCT_NAME_PREFIX = "product" )
View Source
const ( SECRET_TYPE_GIT = 1 SECRET_TYPE_ARTIFACT = 2 SECRET_TYPE_CLUSTER = 3 SECRET_TYPE_TENANT = 4 )
View Source
const ( CodeRepoPermissionReadOnly = "readonly" CodeRepoPermissionReadWrite = "readwrite" CodeRepoPermissionAccessToken = "accesstoken-api" )
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type AccessInfo ¶
type AccessInfo struct { Name string Type AccessType // TODO ssh type should replace to go package structure in the future SSH []*string Kubernetes *rest.Config }
type AdditionalResource ¶
type ArifactRepo ¶
type CodeRepo ¶
type CodeRepo struct { ProviderType string ID string User string Permission CodeRepoPermission }
type CodeRepoPermission ¶ added in v0.3.0
type CodeRepoPermission string
type Deployment ¶
type Deployment interface { Deploy(ctx context.Context, task RuntimeSyncTask) (*DeploymentDeploymentResult, error) UnDeploy(ctx context.Context, task RuntimeSyncTask) error }
type DeploymentDeploymentResult ¶ added in v0.3.1
type DeploymentDeploymentResult struct {
Source string
}
type EnvManager ¶
type EnvManager interface { GetAccessInfo(ctx context.Context, cluster nautescrd.Cluster) (*AccessInfo, error) Sync(ctx context.Context, task RuntimeSyncTask) (*EnvironmentDeploymentResult, error) Remove(ctx context.Context, task RuntimeSyncTask) error }
type EnvironmentDeploymentResult ¶ added in v0.3.1
type EnvironmentDeploymentResult struct { AdditionalResources []AdditionalResource Error error }
type EventBus ¶ added in v0.3.0
type EventBus interface { SyncEvents(ctx context.Context, task RuntimeSyncTask) (*EventBusDeploymentResult, error) RemoveEvents(ctx context.Context, task RuntimeSyncTask) error }
type EventBusDeploymentResult ¶ added in v0.3.1
type EventBusDeploymentResult struct{}
type Pipeline ¶ added in v0.3.0
type Pipeline interface { DeployPipelineRuntime(ctx context.Context, task RuntimeSyncTask) error UnDeployPipelineRuntime(ctx context.Context, task RuntimeSyncTask) error }
type RuntimeDeploymentResult ¶ added in v0.3.1
type RuntimeDeploymentResult struct { Cluster string App SelectedApp DeploymentDeploymentResult *DeploymentDeploymentResult EnvironmentDeploymentResult *EnvironmentDeploymentResult EventBusDeploymentResult *EventBusDeploymentResult }
type RuntimeSyncTask ¶ added in v0.3.0
type RuntimeSyncTask struct { // AccessInfo use to connect dest environment, like kubeconfig of kubernetes. AccessInfo AccessInfo // Product store the runtime's product resource. Product nautescrd.Product // Cluster store runtime's cluster resource. Cluster nautescrd.Cluster HostCluster *nautescrd.Cluster NautesCfg nautescfg.Config // Runtime is the runtime resource of this sync, it chould be pipeline runtime or deployment runtime. Runtime Runtime RuntimeType RuntimeType // ServiceAccountName is the authorized account name in k8s, it can get secrets from secret store, create resource in runtime namespace, etc. ServiceAccountName string }
RuntimeSyncTask stores all the information needed during the deployment processe.
func (*RuntimeSyncTask) GetLabel ¶ added in v0.3.0
func (t *RuntimeSyncTask) GetLabel() map[string]string
type RuntimeSyncer ¶ added in v0.3.0
type RuntimeSyncer interface { Sync(ctx context.Context, runtime Runtime) (*RuntimeDeploymentResult, error) Delete(ctx context.Context, runtime Runtime) error }
RuntimeSyncer is use to deploy or clean up runtime in dest environment. It can handle any type of runtime.
type RuntimeType ¶
type RuntimeType string
const ( RUNTIME_TYPE_DEPLOYMENT RuntimeType = "deployment" RUNTIME_TYPE_PIPELINE RuntimeType = "pipeline" )
type Secret ¶
type Secret interface { // find out secret database name by giving secret info GetSecretDatabaseName(ctx context.Context, repo SecretInfo) (string, error) GetSecretKey(ctx context.Context, repo SecretInfo) (string, error) GrantPermission(ctx context.Context, repo SecretInfo, destUser, destEnv string) error RevokePermission(ctx context.Context, repo SecretInfo, destUser, destEnv string) error }
type SecretClient ¶
type SecretInfo ¶
type SecretInfo struct { Type SecretType CodeRepo *CodeRepo AritifaceRepo *ArifactRepo }
type SecretType ¶
type SecretType int32
Click to show internal directories.
Click to hide internal directories.