Documentation
¶
Index ¶
- Constants
- type AppGroupUsecase
- func (u *AppGroupUsecase) Create(ctx context.Context, dto model.AppGroup) (id domain.AppGroupId, err error)
- func (u *AppGroupUsecase) Delete(ctx context.Context, id domain.AppGroupId) (err error)
- func (u *AppGroupUsecase) Fetch(ctx context.Context, clusterId domain.ClusterId, pg *pagination.Pagination) (out []model.AppGroup, err error)
- func (u *AppGroupUsecase) Get(ctx context.Context, id domain.AppGroupId) (out model.AppGroup, err error)
- func (u *AppGroupUsecase) GetApplications(ctx context.Context, id domain.AppGroupId, ...) (out []model.Application, err error)
- func (u *AppGroupUsecase) UpdateApplication(ctx context.Context, dto model.Application) (err error)
- type AppServeAppUsecase
- func (u *AppServeAppUsecase) AbortAppServeApp(ctx context.Context, appId string) (ret string, err error)
- func (u *AppServeAppUsecase) CreateAppServeApp(ctx context.Context, app *model.AppServeApp, task *model.AppServeAppTask) (string, string, error)
- func (u *AppServeAppUsecase) DeleteAppServeApp(ctx context.Context, appId string) (res string, err error)
- func (u *AppServeAppUsecase) GetAppServeAppById(ctx context.Context, appId string) (*model.AppServeApp, error)
- func (u *AppServeAppUsecase) GetAppServeAppLatestTask(ctx context.Context, appId string) (*model.AppServeAppTask, error)
- func (u *AppServeAppUsecase) GetAppServeAppLog(ctx context.Context, appId string) (string, string, error)
- func (u *AppServeAppUsecase) GetAppServeAppTaskById(ctx context.Context, taskId string) (*model.AppServeAppTask, error)
- func (u *AppServeAppUsecase) GetAppServeAppTasks(ctx context.Context, appId string, pg *pagination.Pagination) ([]model.AppServeAppTask, error)
- func (u *AppServeAppUsecase) GetAppServeApps(ctx context.Context, organizationId string, projectId string, showAll bool, ...) ([]model.AppServeApp, error)
- func (u *AppServeAppUsecase) GetNumOfAppsOnStack(ctx context.Context, organizationId string, clusterId string) (int64, error)
- func (u *AppServeAppUsecase) IsAppServeAppExist(ctx context.Context, appId string) (bool, error)
- func (u *AppServeAppUsecase) IsAppServeAppNameExist(ctx context.Context, orgId string, appName string) (bool, error)
- func (u *AppServeAppUsecase) IsAppServeAppNamespaceExist(ctx context.Context, clusterId string, new_ns string) (bool, error)
- func (u *AppServeAppUsecase) PromoteAppServeApp(ctx context.Context, appId string) (ret string, err error)
- func (u *AppServeAppUsecase) RollbackAppServeApp(ctx context.Context, appId string, taskId string) (ret string, err error)
- func (u *AppServeAppUsecase) UpdateAppServeApp(ctx context.Context, appId string, appTask *model.AppServeAppTask) (ret string, err error)
- func (u *AppServeAppUsecase) UpdateAppServeAppEndpoint(ctx context.Context, appId string, taskId string, endpoint string, ...) (string, error)
- func (u *AppServeAppUsecase) UpdateAppServeAppStatus(ctx context.Context, appId string, taskId string, status string, output string) (string, error)
- type AuditUsecase
- func (u *AuditUsecase) Create(ctx context.Context, dto model.Audit) (auditId uuid.UUID, err error)
- func (u *AuditUsecase) Delete(ctx context.Context, dto model.Audit) (err error)
- func (u *AuditUsecase) Fetch(ctx context.Context, pg *pagination.Pagination) (audits []model.Audit, err error)
- func (u *AuditUsecase) Get(ctx context.Context, auditId uuid.UUID) (res model.Audit, err error)
- type AuthUsecase
- func (u *AuthUsecase) FindId(ctx context.Context, code string, email string, userName string, ...) (string, error)
- func (u *AuthUsecase) FindPassword(ctx context.Context, code string, accountId string, email string, ...) error
- func (u *AuthUsecase) Login(ctx context.Context, accountId string, password string, organizationId string) (model.User, error)
- func (u *AuthUsecase) Logout(ctx context.Context, sessionId string, organizationName string) error
- func (u *AuthUsecase) SingleSignIn(ctx context.Context, organizationId, accountId, password string) ([]*http.Cookie, error)
- func (u *AuthUsecase) SingleSignOut(ctx context.Context, organizationId string) (string, []*http.Cookie, error)
- func (u *AuthUsecase) UpdateExpiredTimeOnToken(ctx context.Context, organizationId string, userId string) error
- func (u *AuthUsecase) VerifyIdentity(ctx context.Context, accountId string, email string, userName string, ...) error
- func (u *AuthUsecase) VerifyToken(ctx context.Context, token string) (bool, error)
- type CloudAccountUsecase
- func (u *CloudAccountUsecase) Create(ctx context.Context, dto model.CloudAccount) (cloudAccountId uuid.UUID, err error)
- func (u *CloudAccountUsecase) Delete(ctx context.Context, dto model.CloudAccount) (out model.CloudAccount, err error)
- func (u *CloudAccountUsecase) DeleteForce(ctx context.Context, cloudAccountId uuid.UUID) (out model.CloudAccount, err error)
- func (u *CloudAccountUsecase) Fetch(ctx context.Context, organizationId string, pg *pagination.Pagination) (cloudAccounts []model.CloudAccount, err error)
- func (u *CloudAccountUsecase) Get(ctx context.Context, cloudAccountId uuid.UUID) (res model.CloudAccount, err error)
- func (u *CloudAccountUsecase) GetByAwsAccountId(ctx context.Context, awsAccountId string) (res model.CloudAccount, err error)
- func (u *CloudAccountUsecase) GetByName(ctx context.Context, organizationId string, name string) (res model.CloudAccount, err error)
- func (u *CloudAccountUsecase) GetResourceQuota(ctx context.Context, cloudAccountId uuid.UUID) (available bool, out domain.ResourceQuota, err error)
- func (u *CloudAccountUsecase) Update(ctx context.Context, dto model.CloudAccount) error
- type ClusterUsecase
- func (u *ClusterUsecase) Bootstrap(ctx context.Context, dto model.Cluster) (clusterId domain.ClusterId, err error)
- func (u *ClusterUsecase) Create(ctx context.Context, dto model.Cluster) (clusterId domain.ClusterId, err error)
- func (u *ClusterUsecase) CreateBootstrapKubeconfig(ctx context.Context, clusterId domain.ClusterId) (out domain.BootstrapKubeconfig, err error)
- func (u *ClusterUsecase) Delete(ctx context.Context, clusterId domain.ClusterId) (err error)
- func (u *ClusterUsecase) Fetch(ctx context.Context, organizationId string, pg *pagination.Pagination) (out []model.Cluster, err error)
- func (u *ClusterUsecase) FetchByCloudAccountId(ctx context.Context, cloudAccountId uuid.UUID, pg *pagination.Pagination) (out []model.Cluster, err error)
- func (u *ClusterUsecase) Get(ctx context.Context, clusterId domain.ClusterId) (out model.Cluster, err error)
- func (u *ClusterUsecase) GetBootstrapKubeconfig(ctx context.Context, clusterId domain.ClusterId) (out domain.BootstrapKubeconfig, err error)
- func (u *ClusterUsecase) GetClusterSiteValues(ctx context.Context, clusterId domain.ClusterId) (out domain.ClusterSiteValuesResponse, err error)
- func (u *ClusterUsecase) GetNodes(ctx context.Context, clusterId domain.ClusterId) (out []domain.ClusterNode, err error)
- func (u *ClusterUsecase) Import(ctx context.Context, dto model.Cluster) (clusterId domain.ClusterId, err error)
- func (u *ClusterUsecase) Install(ctx context.Context, clusterId domain.ClusterId) (err error)
- func (u *ClusterUsecase) Resume(ctx context.Context, clusterId domain.ClusterId) (err error)
- func (u *ClusterUsecase) WithTrx(trxHandle *gorm.DB) IClusterUsecase
- type DashboardUsecase
- func (u *DashboardUsecase) CreateDashboard(ctx context.Context, dashboard *model.Dashboard) (string, error)
- func (u *DashboardUsecase) GetCharts(ctx context.Context, organizationId string, chartType domain.ChartType, ...) (out []domain.DashboardChart, err error)
- func (u *DashboardUsecase) GetDashboard(ctx context.Context, organizationId string, userId string, dashboardKey string) (*model.Dashboard, error)
- func (u *DashboardUsecase) GetFlatClusterIds(ctx context.Context, organizationId string) (string, error)
- func (u *DashboardUsecase) GetPolicyEnforcement(ctx context.Context, organizationId string, primaryClusterId string) (*domain.BarChartData, error)
- func (u *DashboardUsecase) GetPolicyUpdate(ctx context.Context, policyTemplates []policytemplate.TKSPolicyTemplate, ...) (domain.DashboardPolicyUpdate, error)
- func (u *DashboardUsecase) GetPolicyViolation(ctx context.Context, organizationId string, duration string, interval string) (*domain.BarChartData, error)
- func (u *DashboardUsecase) GetPolicyViolationLog(ctx context.Context, organizationId string) (*domain.GetDashboardPolicyViolationLogResponse, error)
- func (u *DashboardUsecase) GetPolicyViolationTop5(ctx context.Context, organizationId string, duration string, interval string) (*domain.BarChartData, error)
- func (u *DashboardUsecase) GetResources(ctx context.Context, organizationId string) (out domain.DashboardResource, err error)
- func (u *DashboardUsecase) GetStacks(ctx context.Context, organizationId string) (out []domain.DashboardStack, err error)
- func (u *DashboardUsecase) GetThanosClient(ctx context.Context, organizationId string) (thanos.ThanosClient, error)
- func (u *DashboardUsecase) GetWorkload(ctx context.Context, organizationId string) (*domain.GetDashboardWorkloadResponse, error)
- func (u *DashboardUsecase) UpdateDashboard(ctx context.Context, dashboard *model.Dashboard) error
- type IAppGroupUsecase
- type IAppServeAppUsecase
- type IAuditUsecase
- type IAuthUsecase
- type ICloudAccountUsecase
- type IClusterUsecase
- type IDashboardUsecase
- type IOrganizationUsecase
- type IPermissionUsecase
- type IPolicyTemplateUsecase
- type IPolicyUsecase
- type IProjectUsecase
- type IRoleUsecase
- type IStackTemplateUsecase
- type IStackUsecase
- type ISystemNotificationRuleUsecase
- type ISystemNotificationTemplateUsecase
- type ISystemNotificationUsecase
- type IUserUsecase
- type OrganizationUsecase
- func (u *OrganizationUsecase) ChangeAdminId(ctx context.Context, organizationId string, adminId uuid.UUID) error
- func (u *OrganizationUsecase) Create(ctx context.Context, in *model.Organization) (organizationId string, err error)
- func (u *OrganizationUsecase) Delete(ctx context.Context, organizationId string, accessToken string) (err error)
- func (u *OrganizationUsecase) Fetch(ctx context.Context, pg *pagination.Pagination) (out *[]model.Organization, err error)
- func (u *OrganizationUsecase) Get(ctx context.Context, organizationId string) (out model.Organization, err error)
- func (u *OrganizationUsecase) Update(ctx context.Context, organizationId string, in model.Organization) (model.Organization, error)
- func (u *OrganizationUsecase) UpdatePrimaryClusterId(ctx context.Context, organizationId string, clusterId string) (err error)
- type PermissionUsecase
- func (p PermissionUsecase) CreatePermissionSet(ctx context.Context, permissionSet *model.PermissionSet) error
- func (p PermissionUsecase) DeletePermission(ctx context.Context, id uuid.UUID) error
- func (p PermissionUsecase) GetAllowedPermissionSet(ctx context.Context) *model.PermissionSet
- func (p PermissionUsecase) GetPermission(ctx context.Context, id uuid.UUID) (*model.Permission, error)
- func (p PermissionUsecase) GetPermissionSetByRoleId(ctx context.Context, roleId string) (*model.PermissionSet, error)
- func (p PermissionUsecase) GetUserPermissionSet(ctx context.Context) *model.PermissionSet
- func (p PermissionUsecase) ListPermissions(ctx context.Context, roleId string) ([]*model.Permission, error)
- func (p PermissionUsecase) MergePermissionWithOrOperator(ctx context.Context, permissionSet ...*model.PermissionSet) *model.PermissionSet
- func (p PermissionUsecase) SetRoleIdToPermissionSet(ctx context.Context, roleId string, permissionSet *model.PermissionSet)
- func (p PermissionUsecase) SyncKeycloakWithClusterAdminPermission(ctx context.Context, organizationId string, clientName string, userId string, ...) error
- func (p PermissionUsecase) UpdatePermission(ctx context.Context, permission *model.Permission) error
- type PolicyTemplateUsecase
- func (u *PolicyTemplateUsecase) AddPermittedPolicyTemplatesForOrganization(ctx context.Context, organizationId string, policyTemplateIds []uuid.UUID) (err error)
- func (u *PolicyTemplateUsecase) Create(ctx context.Context, dto model.PolicyTemplate) (policyTemplateId uuid.UUID, err error)
- func (u *PolicyTemplateUsecase) CreatePolicyTemplateVersion(ctx context.Context, organizationId *string, policyTemplateId uuid.UUID, ...) (version string, err error)
- func (u *PolicyTemplateUsecase) Delete(ctx context.Context, organizationId *string, policyTemplateId uuid.UUID) (err error)
- func (u *PolicyTemplateUsecase) DeletePermittedPolicyTemplatesForOrganization(ctx context.Context, organizationId string, policyTemplateIds []uuid.UUID) (err error)
- func (u *PolicyTemplateUsecase) DeletePolicyTemplateVersion(ctx context.Context, organizationId *string, policyTemplateId uuid.UUID, ...) (err error)
- func (u *PolicyTemplateUsecase) ExtractPolicyParameters(ctx context.Context, organizationId *string, policyTemplateId uuid.UUID, ...) (response *domain.RegoCompileResponse, err error)
- func (u *PolicyTemplateUsecase) Fetch(ctx context.Context, organizationId *string, pg *pagination.Pagination) (policyTemplates []model.PolicyTemplate, err error)
- func (u *PolicyTemplateUsecase) Get(ctx context.Context, organizationId *string, policyTemplateID uuid.UUID) (policyTemplates *model.PolicyTemplate, err error)
- func (u *PolicyTemplateUsecase) GetPolicyTemplateDeploy(ctx context.Context, organizationId *string, policyTemplateId uuid.UUID) (deployVersions domain.GetPolicyTemplateDeployResponse, err error)
- func (u *PolicyTemplateUsecase) GetPolicyTemplateVersion(ctx context.Context, organizationId *string, policyTemplateId uuid.UUID, ...) (policyTemplateVersionsReponse *model.PolicyTemplate, err error)
- func (u *PolicyTemplateUsecase) IsPolicyTemplateKindExist(ctx context.Context, organizationId *string, policyTemplateKind string) (bool, error)
- func (u *PolicyTemplateUsecase) IsPolicyTemplateNameExist(ctx context.Context, organizationId *string, policyTemplateName string) (bool, error)
- func (u *PolicyTemplateUsecase) ListPolicyTemplateStatistics(ctx context.Context, organizationId *string, policyTemplateId uuid.UUID) (statistics []model.UsageCount, err error)
- func (u *PolicyTemplateUsecase) ListPolicyTemplateVersions(ctx context.Context, organizationId *string, policyTemplateId uuid.UUID) (policyTemplateVersionsReponse *domain.ListPolicyTemplateVersionsResponse, ...)
- func (u *PolicyTemplateUsecase) RegoCompile(request *domain.RegoCompileRequest, parseParameter bool) (response *domain.RegoCompileResponse, err error)
- func (u *PolicyTemplateUsecase) Update(ctx context.Context, organizationId *string, policyTemplateId uuid.UUID, ...) (err error)
- func (u *PolicyTemplateUsecase) UpdatePermittedPolicyTemplatesForOrganization(ctx context.Context, organizationId string, policyTemplateIds []uuid.UUID) (err error)
- type PolicyUsecase
- func (u *PolicyUsecase) AddPoliciesForClusterID(ctx context.Context, organizationId string, clusterId domain.ClusterId, ...) (err error)
- func (u *PolicyUsecase) Create(ctx context.Context, organizationId string, dto model.Policy) (policyId uuid.UUID, err error)
- func (u *PolicyUsecase) Delete(ctx context.Context, organizationId string, policyId uuid.UUID) (err error)
- func (u *PolicyUsecase) DeletePoliciesForClusterID(ctx context.Context, organizationId string, clusterId domain.ClusterId, ...) (err error)
- func (u *PolicyUsecase) Fetch(ctx context.Context, organizationId string, pg *pagination.Pagination, ...) (*[]model.Policy, error)
- func (u *PolicyUsecase) Get(ctx context.Context, organizationId string, policyId uuid.UUID) (policy *model.Policy, err error)
- func (u *PolicyUsecase) GetForEdit(ctx context.Context, organizationId string, policyId uuid.UUID) (policy *model.Policy, err error)
- func (u *PolicyUsecase) GetMandatoryPolicies(ctx context.Context, organizationId string) (response *domain.GetMandatoryPoliciesResponse, err error)
- func (u *PolicyUsecase) GetPolicyIDsByClusterID(ctx context.Context, clusterId domain.ClusterId) (out *[]uuid.UUID, err error)
- func (u *PolicyUsecase) GetPolicyStatistics(ctx context.Context, organizationId string) (response *domain.PolicyStatisticsResponse, err error)
- func (u *PolicyUsecase) GetStackPolicyStatistics(ctx context.Context, organizationId string, clusterId domain.ClusterId) (statistics *domain.StackPolicyStatistics, err error)
- func (u *PolicyUsecase) GetStackPolicyTemplateStatus(ctx context.Context, clusterId string, policyTemplateId uuid.UUID) (stackPolicyTemplateStatusResponse *domain.GetStackPolicyTemplateStatusResponse, ...)
- func (u *PolicyUsecase) IsPolicyIdExist(ctx context.Context, organizationId string, policyId uuid.UUID) (exists bool, err error)
- func (u *PolicyUsecase) IsPolicyNameExist(ctx context.Context, organizationId string, policyName string) (exists bool, err error)
- func (u *PolicyUsecase) IsPolicyResourceNameExist(ctx context.Context, organizationId string, policyResoName string) (exists bool, err error)
- func (u *PolicyUsecase) ListStackPolicyStatus(ctx context.Context, clusterId string, pg *pagination.Pagination) (policyStatuses []domain.StackPolicyStatusResponse, err error)
- func (u *PolicyUsecase) SetMandatoryPolicies(ctx context.Context, organizationId string, mandatoryPolicyIds []uuid.UUID, ...) (err error)
- func (u *PolicyUsecase) Update(ctx context.Context, organizationId string, policyId uuid.UUID, ...) (err error)
- func (u *PolicyUsecase) UpdatePoliciesForClusterID(ctx context.Context, organizationId string, clusterId domain.ClusterId, ...) (err error)
- func (u *PolicyUsecase) UpdatePolicyTargetClusters(ctx context.Context, organizationId string, policyId uuid.UUID, ...) (err error)
- func (u *PolicyUsecase) UpdateStackPolicyTemplateStatus(ctx context.Context, clusterId string, policyTemplateId uuid.UUID, ...) (err error)
- type ProjectUsecase
- func (u *ProjectUsecase) AddProjectMember(ctx context.Context, organizationId string, pm *model.ProjectMember) (string, error)
- func (u *ProjectUsecase) AssignKeycloakClientRoleToMember(ctx context.Context, organizationId string, projectId string, clientId string, ...) error
- func (u *ProjectUsecase) CreateK8SNSRoleBinding(ctx context.Context, organizationId string, projectId string, stackId string, ...) error
- func (u *ProjectUsecase) CreateProject(ctx context.Context, p *model.Project) (string, error)
- func (u *ProjectUsecase) CreateProjectNamespace(ctx context.Context, organizationId string, pn *model.ProjectNamespace) error
- func (u *ProjectUsecase) DeleteK8SNSRoleBinding(ctx context.Context, organizationId string, projectId string, stackId string, ...) error
- func (u *ProjectUsecase) DeleteProjectNamespace(ctx context.Context, organizationId string, projectId string, stackId string, ...) error
- func (u *ProjectUsecase) EnsureNamespaceForCluster(ctx context.Context, organizationId string, stackId string, ...) error
- func (u *ProjectUsecase) EnsureRequiredSetupForCluster(ctx context.Context, organizationId string, projectId string, stackId string) error
- func (u *ProjectUsecase) GetAppCount(ctx context.Context, organizationId string, projectId string, namespace string) (appCount int, err error)
- func (u *ProjectUsecase) GetK8sResources(ctx context.Context, organizationId string, projectId string, namespace string, ...) (out domain.ProjectNamespaceK8sResources, err error)
- func (u *ProjectUsecase) GetProject(ctx context.Context, organizationId string, projectId string) (*model.Project, error)
- func (u *ProjectUsecase) GetProjectKubeconfig(ctx context.Context, organizationId string, projectId string) (string, error)
- func (u *ProjectUsecase) GetProjectMember(ctx context.Context, projectMemberId string) (pm *model.ProjectMember, err error)
- func (u *ProjectUsecase) GetProjectMemberByUserId(ctx context.Context, projectId string, userId string) (pm *model.ProjectMember, err error)
- func (u *ProjectUsecase) GetProjectMemberCount(ctx context.Context, projectMemberId string) (pmcr *domain.GetProjectMemberCountResponse, err error)
- func (u *ProjectUsecase) GetProjectMembers(ctx context.Context, projectId string, query int, pg *pagination.Pagination) (pms []model.ProjectMember, err error)
- func (u *ProjectUsecase) GetProjectNamespace(ctx context.Context, organizationId string, projectId string, ...) (*model.ProjectNamespace, error)
- func (u *ProjectUsecase) GetProjectNamespaceKubeconfig(ctx context.Context, organizationId string, projectId string, namespace string, ...) (string, error)
- func (u *ProjectUsecase) GetProjectNamespaces(ctx context.Context, organizationId string, projectId string, ...) ([]model.ProjectNamespace, error)
- func (u *ProjectUsecase) GetProjectRole(ctx context.Context, id string) (*model.ProjectRole, error)
- func (u *ProjectUsecase) GetProjectRoles(ctx context.Context, query int) (prs []model.ProjectRole, err error)
- func (u *ProjectUsecase) GetProjectUser(ctx context.Context, projectUserId string) (*model.ProjectUser, error)
- func (u *ProjectUsecase) GetProjectWithLeader(ctx context.Context, organizationId string, projectId string) (*model.Project, error)
- func (u *ProjectUsecase) GetProjects(ctx context.Context, organizationId string, userId string, onlyMyProject bool, ...) (pr []domain.ProjectResponse, err error)
- func (u *ProjectUsecase) GetResourcesUsage(ctx context.Context, thanosClient thanos.ThanosClient, organizationId string, ...) (out domain.ProjectNamespaceResourcesUsage, err error)
- func (u *ProjectUsecase) IsProjectNameExist(ctx context.Context, organizationId string, projectName string) (bool, error)
- func (u *ProjectUsecase) IsProjectNamespaceExist(ctx context.Context, organizationId string, projectId string, stackId string, ...) (bool, error)
- func (u *ProjectUsecase) MayRemoveRequiredSetupForCluster(ctx context.Context, organizationId string, projectId string, stackId string) error
- func (u *ProjectUsecase) RemoveProjectMember(ctx context.Context, organizationId string, projectMemberId string) error
- func (u *ProjectUsecase) UnassignKeycloakClientRoleToMember(ctx context.Context, organizationId string, projectId string, clientId string, ...) error
- func (u *ProjectUsecase) UpdateProject(ctx context.Context, p *model.Project, newLeaderId string) error
- func (u *ProjectUsecase) UpdateProjectMemberRole(ctx context.Context, pm *model.ProjectMember) error
- func (u *ProjectUsecase) UpdateProjectNamespace(ctx context.Context, pn *model.ProjectNamespace) error
- type RoleUsecase
- func (r RoleUsecase) CreateTksRole(ctx context.Context, role *model.Role) (string, error)
- func (r RoleUsecase) DeleteTksRole(ctx context.Context, organizationId string, id string) error
- func (r RoleUsecase) GetTksRole(ctx context.Context, organizationId string, id string) (*model.Role, error)
- func (r RoleUsecase) IsRoleNameExisted(ctx context.Context, organizationId string, roleName string) (bool, error)
- func (r RoleUsecase) ListTksRoles(ctx context.Context, organizationId string, pg *pagination.Pagination) ([]*model.Role, error)
- func (r RoleUsecase) UpdateTksRole(ctx context.Context, newRole *model.Role) error
- type StackTemplateUsecase
- func (u *StackTemplateUsecase) AddOrganizationStackTemplates(ctx context.Context, organizationId string, stackTemplateIds []string) error
- func (u *StackTemplateUsecase) Create(ctx context.Context, dto model.StackTemplate) (stackTemplateId uuid.UUID, err error)
- func (u *StackTemplateUsecase) Delete(ctx context.Context, stackTemplateId uuid.UUID) (err error)
- func (u *StackTemplateUsecase) Fetch(ctx context.Context, pg *pagination.Pagination) (res []model.StackTemplate, err error)
- func (u *StackTemplateUsecase) FetchWithOrganization(ctx context.Context, organizationId string, pg *pagination.Pagination) (res []model.StackTemplate, err error)
- func (u *StackTemplateUsecase) Get(ctx context.Context, stackTemplateId uuid.UUID) (res model.StackTemplate, err error)
- func (u *StackTemplateUsecase) GetByName(ctx context.Context, name string) (out model.StackTemplate, err error)
- func (u *StackTemplateUsecase) GetCloudServices(ctx context.Context, organizationId string) (out []string, err error)
- func (u *StackTemplateUsecase) GetTemplateIds(ctx context.Context) (out []string, err error)
- func (u *StackTemplateUsecase) RemoveOrganizationStackTemplates(ctx context.Context, organizationId string, stackTemplateIds []string) error
- func (u *StackTemplateUsecase) Update(ctx context.Context, dto model.StackTemplate) error
- func (u *StackTemplateUsecase) UpdateOrganizations(ctx context.Context, dto model.StackTemplate) error
- type StackUsecase
- func (u *StackUsecase) Create(ctx context.Context, dto model.Stack) (stackId domain.StackId, err error)
- func (u *StackUsecase) Delete(ctx context.Context, dto model.Stack) (err error)
- func (u *StackUsecase) DeleteFavorite(ctx context.Context, stackId domain.StackId) error
- func (u *StackUsecase) Fetch(ctx context.Context, organizationId string, pg *pagination.Pagination) (out []model.Stack, err error)
- func (u *StackUsecase) Get(ctx context.Context, stackId domain.StackId) (out model.Stack, err error)
- func (u *StackUsecase) GetByName(ctx context.Context, organizationId string, name string) (out model.Stack, err error)
- func (u *StackUsecase) GetKubeconfig(ctx context.Context, stackId domain.StackId) (kubeconfig string, err error)
- func (u *StackUsecase) GetStepStatus(ctx context.Context, stackId domain.StackId) (out []domain.StackStepStatus, stackStatus string, err error)
- func (u *StackUsecase) Import(ctx context.Context, dto model.Stack) (stackId domain.StackId, err error)
- func (u *StackUsecase) Install(ctx context.Context, stackId domain.StackId) (err error)
- func (u *StackUsecase) SetFavorite(ctx context.Context, stackId domain.StackId) error
- func (u *StackUsecase) Update(ctx context.Context, dto model.Stack) (err error)
- type SystemNotificationRuleUsecase
- func (u *SystemNotificationRuleUsecase) Create(ctx context.Context, dto model.SystemNotificationRule) (systemNotificationRuleId uuid.UUID, err error)
- func (u *SystemNotificationRuleUsecase) Delete(ctx context.Context, systemNotificationRuleId uuid.UUID) (out model.SystemNotificationRule, err error)
- func (u *SystemNotificationRuleUsecase) Fetch(ctx context.Context, organizationId string, pg *pagination.Pagination) (res []model.SystemNotificationRule, err error)
- func (u *SystemNotificationRuleUsecase) Get(ctx context.Context, systemNotificationRuleId uuid.UUID) (res model.SystemNotificationRule, err error)
- func (u *SystemNotificationRuleUsecase) GetByName(ctx context.Context, name string) (out model.SystemNotificationRule, err error)
- func (u *SystemNotificationRuleUsecase) MakeDefaultSystemNotificationRules(ctx context.Context, organizationId string, dto *model.Organization) error
- func (u *SystemNotificationRuleUsecase) Update(ctx context.Context, dto model.SystemNotificationRule) error
- type SystemNotificationTemplateUsecase
- func (u *SystemNotificationTemplateUsecase) AddOrganizationSystemNotificationTemplates(ctx context.Context, organizationId string, ...) error
- func (u *SystemNotificationTemplateUsecase) Create(ctx context.Context, dto model.SystemNotificationTemplate) (systemNotificationTemplate uuid.UUID, err error)
- func (u *SystemNotificationTemplateUsecase) Delete(ctx context.Context, systemNotificationTemplateId uuid.UUID) (err error)
- func (u *SystemNotificationTemplateUsecase) Fetch(ctx context.Context, pg *pagination.Pagination) (alerts []model.SystemNotificationTemplate, err error)
- func (u *SystemNotificationTemplateUsecase) FetchWithOrganization(ctx context.Context, organizationId string, pg *pagination.Pagination) (res []model.SystemNotificationTemplate, err error)
- func (u *SystemNotificationTemplateUsecase) Get(ctx context.Context, systemNotificationTemplateId uuid.UUID) (systemNotificationTemplate model.SystemNotificationTemplate, err error)
- func (u *SystemNotificationTemplateUsecase) GetByName(ctx context.Context, name string) (out model.SystemNotificationTemplate, err error)
- func (u *SystemNotificationTemplateUsecase) RemoveOrganizationSystemNotificationTemplates(ctx context.Context, organizationId string, ...) error
- func (u *SystemNotificationTemplateUsecase) Update(ctx context.Context, dto model.SystemNotificationTemplate) error
- func (u *SystemNotificationTemplateUsecase) UpdateOrganizations(ctx context.Context, dto model.SystemNotificationTemplate) error
- type SystemNotificationUsecase
- func (u *SystemNotificationUsecase) Create(ctx context.Context, input domain.CreateSystemNotificationRequest) (err error)
- func (u *SystemNotificationUsecase) CreateSystemNotificationAction(ctx context.Context, dto model.SystemNotificationAction) (systemNotificationActionId uuid.UUID, err error)
- func (u *SystemNotificationUsecase) Delete(ctx context.Context, dto model.SystemNotification) (err error)
- func (u *SystemNotificationUsecase) FetchPolicyNotifications(ctx context.Context, organizationId string, pg *pagination.Pagination) (systemNotifications []model.SystemNotification, err error)
- func (u *SystemNotificationUsecase) FetchSystemNotifications(ctx context.Context, organizationId string, pg *pagination.Pagination) (systemNotifications []model.SystemNotification, err error)
- func (u *SystemNotificationUsecase) Get(ctx context.Context, systemNotificationId uuid.UUID) (systemNotification model.SystemNotification, err error)
- func (u *SystemNotificationUsecase) GetByName(ctx context.Context, organizationId string, name string) (out model.SystemNotification, err error)
- func (u *SystemNotificationUsecase) Update(ctx context.Context, dto model.SystemNotification) error
- type Usecase
- type UserUsecase
- func (u *UserUsecase) Create(ctx context.Context, user *model.User) (*model.User, error)
- func (u *UserUsecase) CreateAdmin(ctx context.Context, user *model.User) (*model.User, error)
- func (u *UserUsecase) Delete(ctx context.Context, userId uuid.UUID, organizationId string) error
- func (u *UserUsecase) DeleteAdmin(ctx context.Context, organizationId string) error
- func (u *UserUsecase) DeleteAll(ctx context.Context, organizationId string) error
- func (u *UserUsecase) DeleteByAccountId(ctx context.Context, accountId string, organizationId string) error
- func (u *UserUsecase) ExpirePassword(ctx context.Context, userId uuid.UUID) error
- func (u *UserUsecase) GenerateRandomPassword(ctx context.Context) string
- func (u *UserUsecase) Get(ctx context.Context, userId uuid.UUID) (*model.User, error)
- func (u *UserUsecase) GetByAccountId(ctx context.Context, accountId string, organizationId string) (*model.User, error)
- func (u *UserUsecase) GetByEmail(ctx context.Context, email string, organizationId string) (*model.User, error)
- func (u *UserUsecase) List(ctx context.Context, organizationId string) (users *[]model.User, err error)
- func (u *UserUsecase) ListUsersByRole(ctx context.Context, organizationId string, roleId string, ...) (*[]model.User, error)
- func (u *UserUsecase) ListWithPagination(ctx context.Context, organizationId string, pg *pagination.Pagination) (users *[]model.User, err error)
- func (u *UserUsecase) RenewalPasswordExpiredTime(ctx context.Context, userId uuid.UUID) error
- func (u *UserUsecase) RenewalPasswordExpiredTimeByAccountId(ctx context.Context, accountId string, organizationId string) error
- func (u *UserUsecase) ResetPassword(ctx context.Context, userId uuid.UUID) error
- func (u *UserUsecase) ResetPasswordByAccountId(ctx context.Context, accountId string, organizationId string) error
- func (u *UserUsecase) SendEmailForTemporaryPassword(ctx context.Context, accountId string, organizationId string, password string) error
- func (u *UserUsecase) Update(ctx context.Context, user *model.User) (*model.User, error)
- func (u *UserUsecase) UpdateByAccountId(ctx context.Context, user *model.User) (*model.User, error)
- func (u *UserUsecase) UpdateByAccountIdByAdmin(ctx context.Context, newUser *model.User) (*model.User, error)
- func (u *UserUsecase) UpdatePasswordByAccountId(ctx context.Context, accountId string, originPassword string, ...) error
- func (u *UserUsecase) ValidateAccount(ctx context.Context, userId uuid.UUID, password string, organizationId string) error
- func (u *UserUsecase) ValidateAccountByAccountId(ctx context.Context, accountId string, password string, organizationId string) error
Constants ¶
View Source
const ( KEYCLOAK_IDENTITY_COOKIE = "KEYCLOAK_IDENTITY" KEYCLOAK_IDENTITY_LEGACY_COOKIE = "KEYCLOAK_IDENTITY_LEGACY" )
View Source
const ( ProjectAll int = iota ProjectLeader ProjectMember ProjectViewer )
View Source
const MAX_WORKFLOW_TIME = 30
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type AppGroupUsecase ¶
type AppGroupUsecase struct {
// contains filtered or unexported fields
}
func (*AppGroupUsecase) Create ¶
func (u *AppGroupUsecase) Create(ctx context.Context, dto model.AppGroup) (id domain.AppGroupId, err error)
func (*AppGroupUsecase) Delete ¶
func (u *AppGroupUsecase) Delete(ctx context.Context, id domain.AppGroupId) (err error)
func (*AppGroupUsecase) Fetch ¶
func (u *AppGroupUsecase) Fetch(ctx context.Context, clusterId domain.ClusterId, pg *pagination.Pagination) (out []model.AppGroup, err error)
func (*AppGroupUsecase) Get ¶
func (u *AppGroupUsecase) Get(ctx context.Context, id domain.AppGroupId) (out model.AppGroup, err error)
func (*AppGroupUsecase) GetApplications ¶
func (u *AppGroupUsecase) GetApplications(ctx context.Context, id domain.AppGroupId, applicationType domain.ApplicationType) (out []model.Application, err error)
func (*AppGroupUsecase) UpdateApplication ¶
func (u *AppGroupUsecase) UpdateApplication(ctx context.Context, dto model.Application) (err error)
type AppServeAppUsecase ¶
type AppServeAppUsecase struct {
// contains filtered or unexported fields
}
func (*AppServeAppUsecase) AbortAppServeApp ¶
func (*AppServeAppUsecase) CreateAppServeApp ¶
func (u *AppServeAppUsecase) CreateAppServeApp(ctx context.Context, app *model.AppServeApp, task *model.AppServeAppTask) (string, string, error)
func (*AppServeAppUsecase) DeleteAppServeApp ¶
func (*AppServeAppUsecase) GetAppServeAppById ¶
func (u *AppServeAppUsecase) GetAppServeAppById(ctx context.Context, appId string) (*model.AppServeApp, error)
func (*AppServeAppUsecase) GetAppServeAppLatestTask ¶
func (u *AppServeAppUsecase) GetAppServeAppLatestTask(ctx context.Context, appId string) (*model.AppServeAppTask, error)
func (*AppServeAppUsecase) GetAppServeAppLog ¶
func (*AppServeAppUsecase) GetAppServeAppTaskById ¶
func (u *AppServeAppUsecase) GetAppServeAppTaskById(ctx context.Context, taskId string) (*model.AppServeAppTask, error)
func (*AppServeAppUsecase) GetAppServeAppTasks ¶
func (u *AppServeAppUsecase) GetAppServeAppTasks(ctx context.Context, appId string, pg *pagination.Pagination) ([]model.AppServeAppTask, error)
func (*AppServeAppUsecase) GetAppServeApps ¶
func (u *AppServeAppUsecase) GetAppServeApps(ctx context.Context, organizationId string, projectId string, showAll bool, pg *pagination.Pagination) ([]model.AppServeApp, error)
func (*AppServeAppUsecase) GetNumOfAppsOnStack ¶
func (*AppServeAppUsecase) IsAppServeAppExist ¶
func (*AppServeAppUsecase) IsAppServeAppNameExist ¶
func (*AppServeAppUsecase) IsAppServeAppNamespaceExist ¶
func (*AppServeAppUsecase) PromoteAppServeApp ¶
func (*AppServeAppUsecase) RollbackAppServeApp ¶
func (*AppServeAppUsecase) UpdateAppServeApp ¶
func (u *AppServeAppUsecase) UpdateAppServeApp(ctx context.Context, appId string, appTask *model.AppServeAppTask) (ret string, err error)
func (*AppServeAppUsecase) UpdateAppServeAppEndpoint ¶
type AuditUsecase ¶
type AuditUsecase struct {
// contains filtered or unexported fields
}
func (*AuditUsecase) Fetch ¶
func (u *AuditUsecase) Fetch(ctx context.Context, pg *pagination.Pagination) (audits []model.Audit, err error)
type AuthUsecase ¶
type AuthUsecase struct {
// contains filtered or unexported fields
}
func (*AuthUsecase) FindPassword ¶
func (*AuthUsecase) SingleSignIn ¶
func (*AuthUsecase) SingleSignOut ¶
func (*AuthUsecase) UpdateExpiredTimeOnToken ¶
func (*AuthUsecase) VerifyIdentity ¶
func (*AuthUsecase) VerifyToken ¶
type CloudAccountUsecase ¶
type CloudAccountUsecase struct {
// contains filtered or unexported fields
}
func (*CloudAccountUsecase) Create ¶
func (u *CloudAccountUsecase) Create(ctx context.Context, dto model.CloudAccount) (cloudAccountId uuid.UUID, err error)
func (*CloudAccountUsecase) Delete ¶
func (u *CloudAccountUsecase) Delete(ctx context.Context, dto model.CloudAccount) (out model.CloudAccount, err error)
func (*CloudAccountUsecase) DeleteForce ¶
func (u *CloudAccountUsecase) DeleteForce(ctx context.Context, cloudAccountId uuid.UUID) (out model.CloudAccount, err error)
func (*CloudAccountUsecase) Fetch ¶
func (u *CloudAccountUsecase) Fetch(ctx context.Context, organizationId string, pg *pagination.Pagination) (cloudAccounts []model.CloudAccount, err error)
func (*CloudAccountUsecase) Get ¶
func (u *CloudAccountUsecase) Get(ctx context.Context, cloudAccountId uuid.UUID) (res model.CloudAccount, err error)
func (*CloudAccountUsecase) GetByAwsAccountId ¶
func (u *CloudAccountUsecase) GetByAwsAccountId(ctx context.Context, awsAccountId string) (res model.CloudAccount, err error)
func (*CloudAccountUsecase) GetByName ¶
func (u *CloudAccountUsecase) GetByName(ctx context.Context, organizationId string, name string) (res model.CloudAccount, err error)
func (*CloudAccountUsecase) GetResourceQuota ¶
func (u *CloudAccountUsecase) GetResourceQuota(ctx context.Context, cloudAccountId uuid.UUID) (available bool, out domain.ResourceQuota, err error)
func (*CloudAccountUsecase) Update ¶
func (u *CloudAccountUsecase) Update(ctx context.Context, dto model.CloudAccount) error
type ClusterUsecase ¶
type ClusterUsecase struct {
// contains filtered or unexported fields
}
func (*ClusterUsecase) CreateBootstrapKubeconfig ¶
func (u *ClusterUsecase) CreateBootstrapKubeconfig(ctx context.Context, clusterId domain.ClusterId) (out domain.BootstrapKubeconfig, err error)
func (*ClusterUsecase) Fetch ¶
func (u *ClusterUsecase) Fetch(ctx context.Context, organizationId string, pg *pagination.Pagination) (out []model.Cluster, err error)
func (*ClusterUsecase) FetchByCloudAccountId ¶
func (u *ClusterUsecase) FetchByCloudAccountId(ctx context.Context, cloudAccountId uuid.UUID, pg *pagination.Pagination) (out []model.Cluster, err error)
func (*ClusterUsecase) GetBootstrapKubeconfig ¶
func (u *ClusterUsecase) GetBootstrapKubeconfig(ctx context.Context, clusterId domain.ClusterId) (out domain.BootstrapKubeconfig, err error)
func (*ClusterUsecase) GetClusterSiteValues ¶
func (u *ClusterUsecase) GetClusterSiteValues(ctx context.Context, clusterId domain.ClusterId) (out domain.ClusterSiteValuesResponse, err error)
func (*ClusterUsecase) GetNodes ¶
func (u *ClusterUsecase) GetNodes(ctx context.Context, clusterId domain.ClusterId) (out []domain.ClusterNode, err error)
func (*ClusterUsecase) WithTrx ¶
func (u *ClusterUsecase) WithTrx(trxHandle *gorm.DB) IClusterUsecase
type DashboardUsecase ¶
type DashboardUsecase struct {
// contains filtered or unexported fields
}
func (*DashboardUsecase) CreateDashboard ¶
func (*DashboardUsecase) GetDashboard ¶
func (*DashboardUsecase) GetFlatClusterIds ¶
func (*DashboardUsecase) GetPolicyEnforcement ¶
func (u *DashboardUsecase) GetPolicyEnforcement(ctx context.Context, organizationId string, primaryClusterId string) (*domain.BarChartData, error)
func (*DashboardUsecase) GetPolicyUpdate ¶
func (u *DashboardUsecase) GetPolicyUpdate(ctx context.Context, policyTemplates []policytemplate.TKSPolicyTemplate, policies []policytemplate.TKSPolicy) (domain.DashboardPolicyUpdate, error)
func (*DashboardUsecase) GetPolicyViolation ¶
func (u *DashboardUsecase) GetPolicyViolation(ctx context.Context, organizationId string, duration string, interval string) (*domain.BarChartData, error)
func (*DashboardUsecase) GetPolicyViolationLog ¶
func (u *DashboardUsecase) GetPolicyViolationLog(ctx context.Context, organizationId string) (*domain.GetDashboardPolicyViolationLogResponse, error)
func (*DashboardUsecase) GetPolicyViolationTop5 ¶
func (u *DashboardUsecase) GetPolicyViolationTop5(ctx context.Context, organizationId string, duration string, interval string) (*domain.BarChartData, error)
func (*DashboardUsecase) GetResources ¶
func (u *DashboardUsecase) GetResources(ctx context.Context, organizationId string) (out domain.DashboardResource, err error)
func (*DashboardUsecase) GetStacks ¶
func (u *DashboardUsecase) GetStacks(ctx context.Context, organizationId string) (out []domain.DashboardStack, err error)
func (*DashboardUsecase) GetThanosClient ¶
func (u *DashboardUsecase) GetThanosClient(ctx context.Context, organizationId string) (thanos.ThanosClient, error)
func (*DashboardUsecase) GetWorkload ¶
func (u *DashboardUsecase) GetWorkload(ctx context.Context, organizationId string) (*domain.GetDashboardWorkloadResponse, error)
func (*DashboardUsecase) UpdateDashboard ¶
type IAppGroupUsecase ¶
type IAppGroupUsecase interface { Fetch(ctx context.Context, clusterId domain.ClusterId, pg *pagination.Pagination) ([]model.AppGroup, error) Create(ctx context.Context, dto model.AppGroup) (id domain.AppGroupId, err error) Get(ctx context.Context, id domain.AppGroupId) (out model.AppGroup, err error) Delete(ctx context.Context, id domain.AppGroupId) (err error) GetApplications(ctx context.Context, id domain.AppGroupId, applicationType domain.ApplicationType) (out []model.Application, err error) UpdateApplication(ctx context.Context, dto model.Application) (err error) }
func NewAppGroupUsecase ¶
func NewAppGroupUsecase(r repository.Repository, argoClient argowf.ArgoClient) IAppGroupUsecase
type IAppServeAppUsecase ¶
type IAppServeAppUsecase interface { CreateAppServeApp(ctx context.Context, app *model.AppServeApp, task *model.AppServeAppTask) (appId string, taskId string, err error) GetAppServeApps(ctx context.Context, organizationId string, projectId string, showAll bool, pg *pagination.Pagination) ([]model.AppServeApp, error) GetAppServeAppById(ctx context.Context, appId string) (*model.AppServeApp, error) GetAppServeAppLog(ctx context.Context, appId string) (string, string, error) GetAppServeAppTasks(ctx context.Context, appId string, pg *pagination.Pagination) ([]model.AppServeAppTask, error) GetAppServeAppTaskById(ctx context.Context, taskId string) (*model.AppServeAppTask, error) GetAppServeAppLatestTask(ctx context.Context, appId string) (*model.AppServeAppTask, error) GetNumOfAppsOnStack(ctx context.Context, organizationId string, clusterId string) (int64, error) IsAppServeAppExist(ctx context.Context, appId string) (bool, error) IsAppServeAppNameExist(ctx context.Context, orgId string, appName string) (bool, error) IsAppServeAppNamespaceExist(ctx context.Context, clusterId string, namespace string) (bool, error) UpdateAppServeAppStatus(ctx context.Context, appId string, taskId string, status string, output string) (ret string, err error) DeleteAppServeApp(ctx context.Context, appId string) (res string, err error) UpdateAppServeApp(ctx context.Context, appId string, appTask *model.AppServeAppTask) (ret string, err error) UpdateAppServeAppEndpoint(ctx context.Context, appId string, taskId string, endpoint string, previewEndpoint string, helmRevision int32) (string, error) PromoteAppServeApp(ctx context.Context, appId string) (ret string, err error) AbortAppServeApp(ctx context.Context, appId string) (ret string, err error) RollbackAppServeApp(ctx context.Context, appId string, taskId string) (ret string, err error) }
func NewAppServeAppUsecase ¶
func NewAppServeAppUsecase(r repository.Repository, argoClient argowf.ArgoClient) IAppServeAppUsecase
type IAuditUsecase ¶
type IAuditUsecase interface { Get(ctx context.Context, auditId uuid.UUID) (model.Audit, error) Fetch(ctx context.Context, pg *pagination.Pagination) ([]model.Audit, error) Create(ctx context.Context, dto model.Audit) (auditId uuid.UUID, err error) Delete(ctx context.Context, dto model.Audit) error }
func NewAuditUsecase ¶
func NewAuditUsecase(r repository.Repository) IAuditUsecase
type IAuthUsecase ¶
type IAuthUsecase interface { Login(ctx context.Context, accountId string, password string, organizationId string) (model.User, error) Logout(ctx context.Context, sessionId string, organizationId string) error FindId(ctx context.Context, code string, email string, userName string, organizationId string) (string, error) FindPassword(ctx context.Context, code string, accountId string, email string, userName string, organizationId string) error VerifyIdentity(ctx context.Context, accountId string, email string, userName string, organizationId string) error SingleSignIn(ctx context.Context, organizationId, accountId, password string) ([]*http.Cookie, error) SingleSignOut(ctx context.Context, organizationId string) (string, []*http.Cookie, error) VerifyToken(ctx context.Context, token string) (bool, error) UpdateExpiredTimeOnToken(ctx context.Context, organizationId string, userId string) error }
func NewAuthUsecase ¶
func NewAuthUsecase(r repository.Repository, kc keycloak.IKeycloak) IAuthUsecase
type ICloudAccountUsecase ¶
type ICloudAccountUsecase interface { Get(ctx context.Context, cloudAccountId uuid.UUID) (model.CloudAccount, error) GetByName(ctx context.Context, organizationId string, name string) (model.CloudAccount, error) GetByAwsAccountId(ctx context.Context, awsAccountId string) (model.CloudAccount, error) GetResourceQuota(ctx context.Context, cloudAccountId uuid.UUID) (available bool, out domain.ResourceQuota, err error) Fetch(ctx context.Context, organizationId string, pg *pagination.Pagination) ([]model.CloudAccount, error) Create(ctx context.Context, dto model.CloudAccount) (cloudAccountId uuid.UUID, err error) Update(ctx context.Context, dto model.CloudAccount) error Delete(ctx context.Context, dto model.CloudAccount) (model.CloudAccount, error) DeleteForce(ctx context.Context, cloudAccountId uuid.UUID) (model.CloudAccount, error) }
func NewCloudAccountUsecase ¶
func NewCloudAccountUsecase(r repository.Repository, argoClient argowf.ArgoClient) ICloudAccountUsecase
type IClusterUsecase ¶
type IClusterUsecase interface { WithTrx(*gorm.DB) IClusterUsecase Fetch(ctx context.Context, organizationId string, pg *pagination.Pagination) ([]model.Cluster, error) FetchByCloudAccountId(ctx context.Context, cloudAccountId uuid.UUID, pg *pagination.Pagination) (out []model.Cluster, err error) Create(ctx context.Context, dto model.Cluster) (clusterId domain.ClusterId, err error) Import(ctx context.Context, dto model.Cluster) (clusterId domain.ClusterId, err error) Bootstrap(ctx context.Context, dto model.Cluster) (clusterId domain.ClusterId, err error) Install(ctx context.Context, clusterId domain.ClusterId) (err error) Resume(ctx context.Context, clusterId domain.ClusterId) (err error) Get(ctx context.Context, clusterId domain.ClusterId) (out model.Cluster, err error) GetClusterSiteValues(ctx context.Context, clusterId domain.ClusterId) (out domain.ClusterSiteValuesResponse, err error) Delete(ctx context.Context, clusterId domain.ClusterId) (err error) CreateBootstrapKubeconfig(ctx context.Context, clusterId domain.ClusterId) (out domain.BootstrapKubeconfig, err error) GetBootstrapKubeconfig(ctx context.Context, clusterId domain.ClusterId) (out domain.BootstrapKubeconfig, err error) GetNodes(ctx context.Context, clusterId domain.ClusterId) (out []domain.ClusterNode, err error) }
func NewClusterUsecase ¶
func NewClusterUsecase(r repository.Repository, argoClient argowf.ArgoClient, cache *gcache.Cache, kc keycloak.IKeycloak) IClusterUsecase
type IDashboardUsecase ¶
type IDashboardUsecase interface { CreateDashboard(ctx context.Context, dashboard *model.Dashboard) (string, error) GetDashboard(ctx context.Context, organizationId string, userId string, dashboardKey string) (*model.Dashboard, error) UpdateDashboard(ctx context.Context, dashboard *model.Dashboard) error GetCharts(ctx context.Context, organizationId string, chartType domain.ChartType, duration string, interval string, year string, month string) (res []domain.DashboardChart, err error) GetStacks(ctx context.Context, organizationId string) (out []domain.DashboardStack, err error) GetResources(ctx context.Context, organizationId string) (out domain.DashboardResource, err error) GetPolicyUpdate(ctx context.Context, policyTemplates []policytemplate.TKSPolicyTemplate, policies []policytemplate.TKSPolicy) (domain.DashboardPolicyUpdate, error) GetPolicyEnforcement(ctx context.Context, organizationId string, primaryClusterId string) (*domain.BarChartData, error) GetPolicyViolation(ctx context.Context, organizationId string, duration string, interval string) (*domain.BarChartData, error) GetPolicyViolationLog(ctx context.Context, organizationId string) (*domain.GetDashboardPolicyViolationLogResponse, error) GetWorkload(ctx context.Context, organizationId string) (*domain.GetDashboardWorkloadResponse, error) GetPolicyViolationTop5(ctx context.Context, organizationId string, duration string, interval string) (*domain.BarChartData, error) GetThanosClient(ctx context.Context, organizationId string) (thanos.ThanosClient, error) }
func NewDashboardUsecase ¶
func NewDashboardUsecase(r repository.Repository, cache *gcache.Cache) IDashboardUsecase
type IOrganizationUsecase ¶
type IOrganizationUsecase interface { Create(context.Context, *model.Organization) (organizationId string, err error) Fetch(ctx context.Context, pg *pagination.Pagination) (*[]model.Organization, error) Get(ctx context.Context, organizationId string) (model.Organization, error) Update(ctx context.Context, organizationId string, dto model.Organization) (model.Organization, error) UpdatePrimaryClusterId(ctx context.Context, organizationId string, clusterId string) (err error) ChangeAdminId(ctx context.Context, organizationId string, adminId uuid.UUID) error Delete(ctx context.Context, organizationId string, accessToken string) error }
func NewOrganizationUsecase ¶
func NewOrganizationUsecase(r repository.Repository, argoClient argowf.ArgoClient, kc keycloak.IKeycloak) IOrganizationUsecase
type IPermissionUsecase ¶
type IPermissionUsecase interface { CreatePermissionSet(ctx context.Context, permissionSet *model.PermissionSet) error GetPermission(ctx context.Context, id uuid.UUID) (*model.Permission, error) GetPermissionSetByRoleId(ctx context.Context, roleId string) (*model.PermissionSet, error) ListPermissions(ctx context.Context, roleId string) ([]*model.Permission, error) SetRoleIdToPermissionSet(ctx context.Context, roleId string, permissionSet *model.PermissionSet) GetAllowedPermissionSet(ctx context.Context) *model.PermissionSet GetUserPermissionSet(ctx context.Context) *model.PermissionSet UpdatePermission(ctx context.Context, permission *model.Permission) error MergePermissionWithOrOperator(ctx context.Context, permissionSet ...*model.PermissionSet) *model.PermissionSet SyncKeycloakWithClusterAdminPermission(ctx context.Context, organizationId string, clientName string, userId string, roleName string, boolean bool) error }
type IPolicyTemplateUsecase ¶
type IPolicyTemplateUsecase interface { Create(ctx context.Context, policyTemplate model.PolicyTemplate) (policyTemplateId uuid.UUID, err error) Fetch(ctx context.Context, organizationId *string, pg *pagination.Pagination) (policyTemplates []model.PolicyTemplate, err error) Update(ctx context.Context, organizationId *string, policyTemplateId uuid.UUID, templateName *string, description *string, severity *string, deorecated *bool, permittedOrganizationIds *[]string) (err error) Get(ctx context.Context, organizationId *string, policyTemplateId uuid.UUID) (policyTemplates *model.PolicyTemplate, err error) Delete(ctx context.Context, organizationId *string, policyTemplateId uuid.UUID) (err error) IsPolicyTemplateNameExist(ctx context.Context, organizationId *string, policyTemplateName string) (bool, error) IsPolicyTemplateKindExist(ctx context.Context, organizationId *string, policyTemplateKind string) (bool, error) GetPolicyTemplateVersion(ctx context.Context, organizationId *string, policyTemplateId uuid.UUID, version string) (policyTemplateVersionsReponse *model.PolicyTemplate, err error) ListPolicyTemplateVersions(ctx context.Context, organizationId *string, policyTemplateId uuid.UUID) (policyTemplateVersionsReponse *domain.ListPolicyTemplateVersionsResponse, err error) DeletePolicyTemplateVersion(ctx context.Context, organizationId *string, policyTemplateId uuid.UUID, version string) (err error) CreatePolicyTemplateVersion(ctx context.Context, organizationId *string, policyTemplateId uuid.UUID, newVersion string, schema []*domain.ParameterDef, rego string, libs []string, syncKinds *[]string, syncJson *string) (version string, err error) RegoCompile(request *domain.RegoCompileRequest, parseParameter bool) (response *domain.RegoCompileResponse, err error) ListPolicyTemplateStatistics(ctx context.Context, organizationId *string, policyTemplateId uuid.UUID) (statistics []model.UsageCount, err error) GetPolicyTemplateDeploy(ctx context.Context, organizationId *string, policyTemplateId uuid.UUID) (deployInfo domain.GetPolicyTemplateDeployResponse, err error) ExtractPolicyParameters(ctx context.Context, organizationId *string, policyTemplateId uuid.UUID, version string, rego string, libs []string) (response *domain.RegoCompileResponse, err error) AddPermittedPolicyTemplatesForOrganization(ctx context.Context, organizationId string, policyTemplateIds []uuid.UUID) (err error) UpdatePermittedPolicyTemplatesForOrganization(ctx context.Context, organizationId string, policyTemplateIds []uuid.UUID) (err error) DeletePermittedPolicyTemplatesForOrganization(ctx context.Context, organizationId string, policyTemplateIds []uuid.UUID) (err error) }
func NewPolicyTemplateUsecase ¶
func NewPolicyTemplateUsecase(r repository.Repository) IPolicyTemplateUsecase
type IPolicyUsecase ¶
type IPolicyUsecase interface { Create(ctx context.Context, organizationId string, dto model.Policy) (policyId uuid.UUID, err error) Update(ctx context.Context, organizationId string, policyId uuid.UUID, mandatory *bool, policyName *string, description *string, templateId *uuid.UUID, enforcementAction *string, parameters *string, match *domain.Match, matchYaml *string, targetClusterIds *[]string) (err error) Delete(ctx context.Context, organizationId string, policyId uuid.UUID) (err error) Get(ctx context.Context, organizationId string, policyId uuid.UUID) (policy *model.Policy, err error) GetForEdit(ctx context.Context, organizationId string, policyId uuid.UUID) (policy *model.Policy, err error) Fetch(ctx context.Context, organizationId string, pg *pagination.Pagination, filledParameter bool) (*[]model.Policy, error) IsPolicyIdExist(ctx context.Context, organizationId string, policyId uuid.UUID) (exists bool, err error) IsPolicyNameExist(ctx context.Context, organizationId string, policyName string) (exists bool, err error) IsPolicyResourceNameExist(ctx context.Context, organizationId string, policyResourceName string) (exists bool, err error) UpdatePolicyTargetClusters(ctx context.Context, organizationId string, policyId uuid.UUID, currentClusterIds []string, targetClusterIds []string) (err error) SetMandatoryPolicies(ctx context.Context, organizationId string, mandatoryPolicyIds []uuid.UUID, nonMandatoryPolicyIds []uuid.UUID) (err error) GetMandatoryPolicies(ctx context.Context, organizationId string) (response *domain.GetMandatoryPoliciesResponse, err error) ListStackPolicyStatus(ctx context.Context, clusterId string, pg *pagination.Pagination) (policyStatuses []domain.StackPolicyStatusResponse, err error) GetStackPolicyTemplateStatus(ctx context.Context, clusterId string, policyTemplateId uuid.UUID) (clusterPolicyTemplateStatusResponse *domain.GetStackPolicyTemplateStatusResponse, err error) UpdateStackPolicyTemplateStatus(ctx context.Context, clusterId string, policyTemplateId uuid.UUID, currentVersion string, targetVerson string) (err error) GetPolicyStatistics(ctx context.Context, organizationId string) (response *domain.PolicyStatisticsResponse, err error) AddPoliciesForClusterID(ctx context.Context, organizationId string, clusterId domain.ClusterId, policyIds []uuid.UUID) (err error) UpdatePoliciesForClusterID(ctx context.Context, organizationId string, clusterId domain.ClusterId, policyIds []uuid.UUID) (err error) DeletePoliciesForClusterID(ctx context.Context, organizationId string, clusterId domain.ClusterId, policyIds []uuid.UUID) (err error) GetStackPolicyStatistics(ctx context.Context, organizationId string, clusterId domain.ClusterId) (statistics *domain.StackPolicyStatistics, err error) GetPolicyIDsByClusterID(ctx context.Context, clusterId domain.ClusterId) (out *[]uuid.UUID, err error) }
func NewPolicyUsecase ¶
func NewPolicyUsecase(r repository.Repository) IPolicyUsecase
type IProjectUsecase ¶
type IProjectUsecase interface { CreateProject(ctx context.Context, p *model.Project) (string, error) GetProjects(ctx context.Context, organizationId string, userId string, onlyMyProject bool, projectName string, pg *pagination.Pagination) ([]domain.ProjectResponse, error) GetProject(ctx context.Context, organizationId string, projectId string) (*model.Project, error) GetProjectWithLeader(ctx context.Context, organizationId string, projectId string) (*model.Project, error) IsProjectNameExist(ctx context.Context, organizationId string, projectName string) (bool, error) UpdateProject(ctx context.Context, p *model.Project, newLeaderId string) error GetProjectRole(ctx context.Context, id string) (*model.ProjectRole, error) GetProjectRoles(ctx context.Context, query int) ([]model.ProjectRole, error) AddProjectMember(ctx context.Context, organizationId string, pm *model.ProjectMember) (string, error) GetProjectUser(ctx context.Context, projectUserId string) (*model.ProjectUser, error) GetProjectMember(ctx context.Context, projectMemberId string) (*model.ProjectMember, error) GetProjectMemberByUserId(ctx context.Context, projectId string, userId string) (*model.ProjectMember, error) GetProjectMembers(ctx context.Context, projectId string, query int, pg *pagination.Pagination) ([]model.ProjectMember, error) GetProjectMemberCount(ctx context.Context, projectMemberId string) (*domain.GetProjectMemberCountResponse, error) RemoveProjectMember(ctx context.Context, organizationId string, projectMemberId string) error UpdateProjectMemberRole(ctx context.Context, pm *model.ProjectMember) error CreateProjectNamespace(ctx context.Context, organizationId string, pn *model.ProjectNamespace) error IsProjectNamespaceExist(ctx context.Context, organizationId string, projectId string, stackId string, projectNamespace string) (bool, error) GetProjectNamespaces(ctx context.Context, organizationId string, projectId string, pg *pagination.Pagination) ([]model.ProjectNamespace, error) GetProjectNamespace(ctx context.Context, organizationId string, projectId string, projectNamespace string, stackId string) (*model.ProjectNamespace, error) UpdateProjectNamespace(ctx context.Context, pn *model.ProjectNamespace) error DeleteProjectNamespace(ctx context.Context, organizationId string, projectId string, projectNamespace string, stackId string) error GetAppCount(ctx context.Context, organizationId string, projectId string, namespace string) (appCount int, err error) EnsureNamespaceForCluster(ctx context.Context, organizationId string, stackId string, namespaceName string) error EnsureRequiredSetupForCluster(ctx context.Context, organizationId string, projectId string, stackId string) error MayRemoveRequiredSetupForCluster(ctx context.Context, organizationId string, projectId string, stackId string) error CreateK8SNSRoleBinding(ctx context.Context, organizationId string, projectId string, stackId string, namespace string) error DeleteK8SNSRoleBinding(ctx context.Context, organizationId string, projectId string, stackId string, namespace string) error GetProjectNamespaceKubeconfig(ctx context.Context, organizationId string, projectId string, namespace string, stackId domain.StackId) (string, error) GetProjectKubeconfig(ctx context.Context, organizationId string, projectId string) (string, error) GetK8sResources(ctx context.Context, organizationId string, projectId string, namespace string, stackId domain.StackId) (out domain.ProjectNamespaceK8sResources, err error) GetResourcesUsage(ctx context.Context, thanosClient thanos.ThanosClient, organizationId string, projectId string, namespace string, stackId domain.StackId) (out domain.ProjectNamespaceResourcesUsage, err error) AssignKeycloakClientRoleToMember(ctx context.Context, organizationId string, projectId string, clientId string, projectMemberId string) error UnassignKeycloakClientRoleToMember(ctx context.Context, organizationId string, projectId string, clientId string, projectMemberId string) error }
func NewProjectUsecase ¶
func NewProjectUsecase(r repository.Repository, kc keycloak.IKeycloak, argoClient argowf.ArgoClient) IProjectUsecase
type IRoleUsecase ¶
type IRoleUsecase interface { CreateTksRole(ctx context.Context, role *model.Role) (string, error) ListTksRoles(ctx context.Context, organizationId string, pg *pagination.Pagination) ([]*model.Role, error) GetTksRole(ctx context.Context, orgainzationId string, id string) (*model.Role, error) DeleteTksRole(ctx context.Context, organizationId string, id string) error UpdateTksRole(ctx context.Context, role *model.Role) error IsRoleNameExisted(ctx context.Context, organizationId string, roleName string) (bool, error) }
type IStackTemplateUsecase ¶
type IStackTemplateUsecase interface { Get(ctx context.Context, stackTemplateId uuid.UUID) (model.StackTemplate, error) Fetch(ctx context.Context, pg *pagination.Pagination) ([]model.StackTemplate, error) FetchWithOrganization(ctx context.Context, organizationId string, pg *pagination.Pagination) ([]model.StackTemplate, error) Create(ctx context.Context, dto model.StackTemplate) (stackTemplate uuid.UUID, err error) Update(ctx context.Context, dto model.StackTemplate) error Delete(ctx context.Context, stackTemplateId uuid.UUID) error UpdateOrganizations(ctx context.Context, dto model.StackTemplate) error GetByName(ctx context.Context, name string) (model.StackTemplate, error) AddOrganizationStackTemplates(ctx context.Context, organizationId string, stackTemplateIds []string) error RemoveOrganizationStackTemplates(ctx context.Context, organizationId string, stackTemplateIds []string) error GetTemplateIds(ctx context.Context) ([]string, error) GetCloudServices(ctx context.Context, organizationId string) ([]string, error) }
func NewStackTemplateUsecase ¶
func NewStackTemplateUsecase(r repository.Repository) IStackTemplateUsecase
type IStackUsecase ¶
type IStackUsecase interface { Get(ctx context.Context, stackId domain.StackId) (model.Stack, error) GetByName(ctx context.Context, organizationId string, name string) (model.Stack, error) Fetch(ctx context.Context, organizationId string, pg *pagination.Pagination) ([]model.Stack, error) Create(ctx context.Context, dto model.Stack) (stackId domain.StackId, err error) Import(ctx context.Context, dto model.Stack) (stackId domain.StackId, err error) Install(ctx context.Context, stackId domain.StackId) (err error) Update(ctx context.Context, dto model.Stack) error Delete(ctx context.Context, dto model.Stack) error GetKubeconfig(ctx context.Context, stackId domain.StackId) (kubeconfig string, err error) GetStepStatus(ctx context.Context, stackId domain.StackId) (out []domain.StackStepStatus, stackStatus string, err error) SetFavorite(ctx context.Context, stackId domain.StackId) error DeleteFavorite(ctx context.Context, stackId domain.StackId) error }
func NewStackUsecase ¶
func NewStackUsecase(r repository.Repository, argoClient argowf.ArgoClient, dashbordUsecase IDashboardUsecase, kc keycloak.IKeycloak) IStackUsecase
type ISystemNotificationRuleUsecase ¶
type ISystemNotificationRuleUsecase interface { Get(ctx context.Context, systemNotificationRuleId uuid.UUID) (model.SystemNotificationRule, error) Fetch(ctx context.Context, organizationId string, pg *pagination.Pagination) ([]model.SystemNotificationRule, error) Create(ctx context.Context, dto model.SystemNotificationRule) (systemNotificationRule uuid.UUID, err error) Update(ctx context.Context, dto model.SystemNotificationRule) error Delete(ctx context.Context, systemNotificationRuleId uuid.UUID) (model.SystemNotificationRule, error) GetByName(ctx context.Context, name string) (model.SystemNotificationRule, error) MakeDefaultSystemNotificationRules(ctx context.Context, organizationId string, dto *model.Organization) error }
func NewSystemNotificationRuleUsecase ¶
func NewSystemNotificationRuleUsecase(r repository.Repository) ISystemNotificationRuleUsecase
type ISystemNotificationTemplateUsecase ¶
type ISystemNotificationTemplateUsecase interface { Get(ctx context.Context, alertId uuid.UUID) (model.SystemNotificationTemplate, error) GetByName(ctx context.Context, name string) (model.SystemNotificationTemplate, error) Fetch(ctx context.Context, pg *pagination.Pagination) ([]model.SystemNotificationTemplate, error) FetchWithOrganization(ctx context.Context, organizationId string, pg *pagination.Pagination) ([]model.SystemNotificationTemplate, error) Create(ctx context.Context, dto model.SystemNotificationTemplate) (systemNotificationTemplate uuid.UUID, err error) Update(ctx context.Context, dto model.SystemNotificationTemplate) error Delete(ctx context.Context, systemNotificationTemplateId uuid.UUID) error AddOrganizationSystemNotificationTemplates(ctx context.Context, organizationId string, systemNotificationTemplateIds []string) error RemoveOrganizationSystemNotificationTemplates(ctx context.Context, organizationId string, systemNotificationTemplateIds []string) error }
func NewSystemNotificationTemplateUsecase ¶
func NewSystemNotificationTemplateUsecase(r repository.Repository) ISystemNotificationTemplateUsecase
type ISystemNotificationUsecase ¶
type ISystemNotificationUsecase interface { Get(ctx context.Context, systemNotificationId uuid.UUID) (model.SystemNotification, error) GetByName(ctx context.Context, organizationId string, name string) (model.SystemNotification, error) FetchSystemNotifications(ctx context.Context, organizationId string, pg *pagination.Pagination) ([]model.SystemNotification, error) FetchPolicyNotifications(ctx context.Context, organizationId string, pg *pagination.Pagination) ([]model.SystemNotification, error) Create(ctx context.Context, dto domain.CreateSystemNotificationRequest) (err error) Update(ctx context.Context, dto model.SystemNotification) error Delete(ctx context.Context, dto model.SystemNotification) error CreateSystemNotificationAction(ctx context.Context, dto model.SystemNotificationAction) (systemNotificationActionId uuid.UUID, err error) }
func NewSystemNotificationUsecase ¶
func NewSystemNotificationUsecase(r repository.Repository) ISystemNotificationUsecase
type IUserUsecase ¶
type IUserUsecase interface { CreateAdmin(ctx context.Context, user *model.User) (*model.User, error) DeleteAdmin(ctx context.Context, organizationId string) error DeleteAll(ctx context.Context, organizationId string) error Create(ctx context.Context, user *model.User) (*model.User, error) List(ctx context.Context, organizationId string) (*[]model.User, error) ListWithPagination(ctx context.Context, organizationId string, pg *pagination.Pagination) (*[]model.User, error) Get(ctx context.Context, userId uuid.UUID) (*model.User, error) Update(ctx context.Context, user *model.User) (*model.User, error) ResetPassword(ctx context.Context, userId uuid.UUID) error ResetPasswordByAccountId(ctx context.Context, accountId string, organizationId string) error GenerateRandomPassword(ctx context.Context) string Delete(ctx context.Context, userId uuid.UUID, organizationId string) error GetByAccountId(ctx context.Context, accountId string, organizationId string) (*model.User, error) GetByEmail(ctx context.Context, email string, organizationId string) (*model.User, error) SendEmailForTemporaryPassword(ctx context.Context, accountId string, organizationId string, password string) error ExpirePassword(ctx context.Context, userId uuid.UUID) error UpdateByAccountId(ctx context.Context, user *model.User) (*model.User, error) UpdatePasswordByAccountId(ctx context.Context, accountId string, originPassword string, newPassword string, organizationId string) error RenewalPasswordExpiredTime(ctx context.Context, userId uuid.UUID) error RenewalPasswordExpiredTimeByAccountId(ctx context.Context, accountId string, organizationId string) error DeleteByAccountId(ctx context.Context, accountId string, organizationId string) error ValidateAccount(ctx context.Context, userId uuid.UUID, password string, organizationId string) error ValidateAccountByAccountId(ctx context.Context, accountId string, password string, organizationId string) error UpdateByAccountIdByAdmin(ctx context.Context, user *model.User) (*model.User, error) ListUsersByRole(ctx context.Context, organizationId string, roleId string, pg *pagination.Pagination) (*[]model.User, error) }
func NewUserUsecase ¶
func NewUserUsecase(r repository.Repository, kc keycloak.IKeycloak) IUserUsecase
type OrganizationUsecase ¶
type OrganizationUsecase struct {
// contains filtered or unexported fields
}
func (*OrganizationUsecase) ChangeAdminId ¶
func (*OrganizationUsecase) Create ¶
func (u *OrganizationUsecase) Create(ctx context.Context, in *model.Organization) (organizationId string, err error)
func (*OrganizationUsecase) Fetch ¶
func (u *OrganizationUsecase) Fetch(ctx context.Context, pg *pagination.Pagination) (out *[]model.Organization, err error)
func (*OrganizationUsecase) Get ¶
func (u *OrganizationUsecase) Get(ctx context.Context, organizationId string) (out model.Organization, err error)
func (*OrganizationUsecase) Update ¶
func (u *OrganizationUsecase) Update(ctx context.Context, organizationId string, in model.Organization) (model.Organization, error)
func (*OrganizationUsecase) UpdatePrimaryClusterId ¶
type PermissionUsecase ¶
type PermissionUsecase struct {
// contains filtered or unexported fields
}
func NewPermissionUsecase ¶
func NewPermissionUsecase(repo repository.Repository, kc keycloak.IKeycloak) *PermissionUsecase
func (PermissionUsecase) CreatePermissionSet ¶
func (p PermissionUsecase) CreatePermissionSet(ctx context.Context, permissionSet *model.PermissionSet) error
func (PermissionUsecase) DeletePermission ¶
func (PermissionUsecase) GetAllowedPermissionSet ¶
func (p PermissionUsecase) GetAllowedPermissionSet(ctx context.Context) *model.PermissionSet
func (PermissionUsecase) GetPermission ¶
func (p PermissionUsecase) GetPermission(ctx context.Context, id uuid.UUID) (*model.Permission, error)
func (PermissionUsecase) GetPermissionSetByRoleId ¶
func (p PermissionUsecase) GetPermissionSetByRoleId(ctx context.Context, roleId string) (*model.PermissionSet, error)
func (PermissionUsecase) GetUserPermissionSet ¶
func (p PermissionUsecase) GetUserPermissionSet(ctx context.Context) *model.PermissionSet
func (PermissionUsecase) ListPermissions ¶
func (p PermissionUsecase) ListPermissions(ctx context.Context, roleId string) ([]*model.Permission, error)
func (PermissionUsecase) MergePermissionWithOrOperator ¶
func (p PermissionUsecase) MergePermissionWithOrOperator(ctx context.Context, permissionSet ...*model.PermissionSet) *model.PermissionSet
func (PermissionUsecase) SetRoleIdToPermissionSet ¶
func (p PermissionUsecase) SetRoleIdToPermissionSet(ctx context.Context, roleId string, permissionSet *model.PermissionSet)
func (PermissionUsecase) SyncKeycloakWithClusterAdminPermission ¶
func (PermissionUsecase) UpdatePermission ¶
func (p PermissionUsecase) UpdatePermission(ctx context.Context, permission *model.Permission) error
type PolicyTemplateUsecase ¶
type PolicyTemplateUsecase struct {
// contains filtered or unexported fields
}
func (*PolicyTemplateUsecase) AddPermittedPolicyTemplatesForOrganization ¶
func (*PolicyTemplateUsecase) Create ¶
func (u *PolicyTemplateUsecase) Create(ctx context.Context, dto model.PolicyTemplate) (policyTemplateId uuid.UUID, err error)
func (*PolicyTemplateUsecase) CreatePolicyTemplateVersion ¶
func (*PolicyTemplateUsecase) DeletePermittedPolicyTemplatesForOrganization ¶
func (*PolicyTemplateUsecase) DeletePolicyTemplateVersion ¶
func (*PolicyTemplateUsecase) ExtractPolicyParameters ¶
func (*PolicyTemplateUsecase) Fetch ¶
func (u *PolicyTemplateUsecase) Fetch(ctx context.Context, organizationId *string, pg *pagination.Pagination) (policyTemplates []model.PolicyTemplate, err error)
func (*PolicyTemplateUsecase) Get ¶
func (u *PolicyTemplateUsecase) Get(ctx context.Context, organizationId *string, policyTemplateID uuid.UUID) (policyTemplates *model.PolicyTemplate, err error)
func (*PolicyTemplateUsecase) GetPolicyTemplateDeploy ¶
func (u *PolicyTemplateUsecase) GetPolicyTemplateDeploy(ctx context.Context, organizationId *string, policyTemplateId uuid.UUID) (deployVersions domain.GetPolicyTemplateDeployResponse, err error)
func (*PolicyTemplateUsecase) GetPolicyTemplateVersion ¶
func (u *PolicyTemplateUsecase) GetPolicyTemplateVersion(ctx context.Context, organizationId *string, policyTemplateId uuid.UUID, version string) (policyTemplateVersionsReponse *model.PolicyTemplate, err error)
func (*PolicyTemplateUsecase) IsPolicyTemplateKindExist ¶
func (*PolicyTemplateUsecase) IsPolicyTemplateNameExist ¶
func (*PolicyTemplateUsecase) ListPolicyTemplateStatistics ¶
func (u *PolicyTemplateUsecase) ListPolicyTemplateStatistics(ctx context.Context, organizationId *string, policyTemplateId uuid.UUID) (statistics []model.UsageCount, err error)
func (*PolicyTemplateUsecase) ListPolicyTemplateVersions ¶
func (u *PolicyTemplateUsecase) ListPolicyTemplateVersions(ctx context.Context, organizationId *string, policyTemplateId uuid.UUID) (policyTemplateVersionsReponse *domain.ListPolicyTemplateVersionsResponse, err error)
func (*PolicyTemplateUsecase) RegoCompile ¶
func (u *PolicyTemplateUsecase) RegoCompile(request *domain.RegoCompileRequest, parseParameter bool) (response *domain.RegoCompileResponse, err error)
func (*PolicyTemplateUsecase) UpdatePermittedPolicyTemplatesForOrganization ¶
type PolicyUsecase ¶
type PolicyUsecase struct {
// contains filtered or unexported fields
}
func (*PolicyUsecase) AddPoliciesForClusterID ¶
func (*PolicyUsecase) DeletePoliciesForClusterID ¶
func (*PolicyUsecase) Fetch ¶
func (u *PolicyUsecase) Fetch(ctx context.Context, organizationId string, pg *pagination.Pagination, filledParameter bool) (*[]model.Policy, error)
func (*PolicyUsecase) GetForEdit ¶
func (*PolicyUsecase) GetMandatoryPolicies ¶
func (u *PolicyUsecase) GetMandatoryPolicies(ctx context.Context, organizationId string) (response *domain.GetMandatoryPoliciesResponse, err error)
func (*PolicyUsecase) GetPolicyIDsByClusterID ¶
func (*PolicyUsecase) GetPolicyStatistics ¶
func (u *PolicyUsecase) GetPolicyStatistics(ctx context.Context, organizationId string) (response *domain.PolicyStatisticsResponse, err error)
func (*PolicyUsecase) GetStackPolicyStatistics ¶
func (u *PolicyUsecase) GetStackPolicyStatistics(ctx context.Context, organizationId string, clusterId domain.ClusterId) (statistics *domain.StackPolicyStatistics, err error)
func (*PolicyUsecase) GetStackPolicyTemplateStatus ¶
func (u *PolicyUsecase) GetStackPolicyTemplateStatus(ctx context.Context, clusterId string, policyTemplateId uuid.UUID) (stackPolicyTemplateStatusResponse *domain.GetStackPolicyTemplateStatusResponse, err error)
func (*PolicyUsecase) IsPolicyIdExist ¶
func (*PolicyUsecase) IsPolicyNameExist ¶
func (*PolicyUsecase) IsPolicyResourceNameExist ¶
func (*PolicyUsecase) ListStackPolicyStatus ¶
func (u *PolicyUsecase) ListStackPolicyStatus(ctx context.Context, clusterId string, pg *pagination.Pagination) (policyStatuses []domain.StackPolicyStatusResponse, err error)
func (*PolicyUsecase) SetMandatoryPolicies ¶
func (*PolicyUsecase) Update ¶
func (u *PolicyUsecase) Update(ctx context.Context, organizationId string, policyId uuid.UUID, mandatory *bool, policyName *string, description *string, templateId *uuid.UUID, enforcementAction *string, parameters *string, match *domain.Match, matchYaml *string, targetClusterIds *[]string) (err error)
func (*PolicyUsecase) UpdatePoliciesForClusterID ¶
func (*PolicyUsecase) UpdatePolicyTargetClusters ¶
type ProjectUsecase ¶
type ProjectUsecase struct {
// contains filtered or unexported fields
}
func (*ProjectUsecase) AddProjectMember ¶
func (u *ProjectUsecase) AddProjectMember(ctx context.Context, organizationId string, pm *model.ProjectMember) (string, error)
func (*ProjectUsecase) AssignKeycloakClientRoleToMember ¶
func (*ProjectUsecase) CreateK8SNSRoleBinding ¶
func (*ProjectUsecase) CreateProject ¶
func (*ProjectUsecase) CreateProjectNamespace ¶
func (u *ProjectUsecase) CreateProjectNamespace(ctx context.Context, organizationId string, pn *model.ProjectNamespace) error
func (*ProjectUsecase) DeleteK8SNSRoleBinding ¶
func (*ProjectUsecase) DeleteProjectNamespace ¶
func (*ProjectUsecase) EnsureNamespaceForCluster ¶
func (*ProjectUsecase) EnsureRequiredSetupForCluster ¶
func (*ProjectUsecase) GetAppCount ¶
func (*ProjectUsecase) GetK8sResources ¶
func (*ProjectUsecase) GetProject ¶
func (*ProjectUsecase) GetProjectKubeconfig ¶
func (*ProjectUsecase) GetProjectMember ¶
func (u *ProjectUsecase) GetProjectMember(ctx context.Context, projectMemberId string) (pm *model.ProjectMember, err error)
func (*ProjectUsecase) GetProjectMemberByUserId ¶
func (u *ProjectUsecase) GetProjectMemberByUserId(ctx context.Context, projectId string, userId string) (pm *model.ProjectMember, err error)
func (*ProjectUsecase) GetProjectMemberCount ¶
func (u *ProjectUsecase) GetProjectMemberCount(ctx context.Context, projectMemberId string) (pmcr *domain.GetProjectMemberCountResponse, err error)
func (*ProjectUsecase) GetProjectMembers ¶
func (u *ProjectUsecase) GetProjectMembers(ctx context.Context, projectId string, query int, pg *pagination.Pagination) (pms []model.ProjectMember, err error)
func (*ProjectUsecase) GetProjectNamespace ¶
func (u *ProjectUsecase) GetProjectNamespace(ctx context.Context, organizationId string, projectId string, projectNamespace string, stackId string) (*model.ProjectNamespace, error)
func (*ProjectUsecase) GetProjectNamespaceKubeconfig ¶
func (*ProjectUsecase) GetProjectNamespaces ¶
func (u *ProjectUsecase) GetProjectNamespaces(ctx context.Context, organizationId string, projectId string, pg *pagination.Pagination) ([]model.ProjectNamespace, error)
func (*ProjectUsecase) GetProjectRole ¶
func (u *ProjectUsecase) GetProjectRole(ctx context.Context, id string) (*model.ProjectRole, error)
func (*ProjectUsecase) GetProjectRoles ¶
func (u *ProjectUsecase) GetProjectRoles(ctx context.Context, query int) (prs []model.ProjectRole, err error)
func (*ProjectUsecase) GetProjectUser ¶
func (u *ProjectUsecase) GetProjectUser(ctx context.Context, projectUserId string) (*model.ProjectUser, error)
func (*ProjectUsecase) GetProjectWithLeader ¶
func (*ProjectUsecase) GetProjects ¶
func (u *ProjectUsecase) GetProjects(ctx context.Context, organizationId string, userId string, onlyMyProject bool, projectName string, pg *pagination.Pagination) (pr []domain.ProjectResponse, err error)
func (*ProjectUsecase) GetResourcesUsage ¶
func (u *ProjectUsecase) GetResourcesUsage(ctx context.Context, thanosClient thanos.ThanosClient, organizationId string, projectId string, namespace string, stackId domain.StackId) (out domain.ProjectNamespaceResourcesUsage, err error)
func (*ProjectUsecase) IsProjectNameExist ¶
func (*ProjectUsecase) IsProjectNamespaceExist ¶
func (*ProjectUsecase) MayRemoveRequiredSetupForCluster ¶
func (*ProjectUsecase) RemoveProjectMember ¶
func (*ProjectUsecase) UnassignKeycloakClientRoleToMember ¶
func (*ProjectUsecase) UpdateProject ¶
func (*ProjectUsecase) UpdateProjectMemberRole ¶
func (u *ProjectUsecase) UpdateProjectMemberRole(ctx context.Context, pm *model.ProjectMember) error
func (*ProjectUsecase) UpdateProjectNamespace ¶
func (u *ProjectUsecase) UpdateProjectNamespace(ctx context.Context, pn *model.ProjectNamespace) error
type RoleUsecase ¶
type RoleUsecase struct {
// contains filtered or unexported fields
}
func NewRoleUsecase ¶
func NewRoleUsecase(repo repository.Repository, kc keycloak.IKeycloak) *RoleUsecase
func (RoleUsecase) CreateTksRole ¶
func (RoleUsecase) DeleteTksRole ¶
func (RoleUsecase) GetTksRole ¶
func (RoleUsecase) IsRoleNameExisted ¶
func (RoleUsecase) ListTksRoles ¶
func (r RoleUsecase) ListTksRoles(ctx context.Context, organizationId string, pg *pagination.Pagination) ([]*model.Role, error)
func (RoleUsecase) UpdateTksRole ¶
type StackTemplateUsecase ¶
type StackTemplateUsecase struct {
// contains filtered or unexported fields
}
func (*StackTemplateUsecase) AddOrganizationStackTemplates ¶
func (*StackTemplateUsecase) Create ¶
func (u *StackTemplateUsecase) Create(ctx context.Context, dto model.StackTemplate) (stackTemplateId uuid.UUID, err error)
func (*StackTemplateUsecase) Fetch ¶
func (u *StackTemplateUsecase) Fetch(ctx context.Context, pg *pagination.Pagination) (res []model.StackTemplate, err error)
func (*StackTemplateUsecase) FetchWithOrganization ¶
func (u *StackTemplateUsecase) FetchWithOrganization(ctx context.Context, organizationId string, pg *pagination.Pagination) (res []model.StackTemplate, err error)
func (*StackTemplateUsecase) Get ¶
func (u *StackTemplateUsecase) Get(ctx context.Context, stackTemplateId uuid.UUID) (res model.StackTemplate, err error)
func (*StackTemplateUsecase) GetByName ¶
func (u *StackTemplateUsecase) GetByName(ctx context.Context, name string) (out model.StackTemplate, err error)
func (*StackTemplateUsecase) GetCloudServices ¶
func (*StackTemplateUsecase) GetTemplateIds ¶
func (u *StackTemplateUsecase) GetTemplateIds(ctx context.Context) (out []string, err error)
func (*StackTemplateUsecase) RemoveOrganizationStackTemplates ¶
func (*StackTemplateUsecase) Update ¶
func (u *StackTemplateUsecase) Update(ctx context.Context, dto model.StackTemplate) error
func (*StackTemplateUsecase) UpdateOrganizations ¶
func (u *StackTemplateUsecase) UpdateOrganizations(ctx context.Context, dto model.StackTemplate) error
type StackUsecase ¶
type StackUsecase struct {
// contains filtered or unexported fields
}
func (*StackUsecase) DeleteFavorite ¶
func (*StackUsecase) Fetch ¶
func (u *StackUsecase) Fetch(ctx context.Context, organizationId string, pg *pagination.Pagination) (out []model.Stack, err error)
func (*StackUsecase) GetKubeconfig ¶
func (*StackUsecase) GetStepStatus ¶
func (u *StackUsecase) GetStepStatus(ctx context.Context, stackId domain.StackId) (out []domain.StackStepStatus, stackStatus string, err error)
[TODO] need more pretty...
func (*StackUsecase) SetFavorite ¶
type SystemNotificationRuleUsecase ¶
type SystemNotificationRuleUsecase struct {
// contains filtered or unexported fields
}
func (*SystemNotificationRuleUsecase) Create ¶
func (u *SystemNotificationRuleUsecase) Create(ctx context.Context, dto model.SystemNotificationRule) (systemNotificationRuleId uuid.UUID, err error)
func (*SystemNotificationRuleUsecase) Delete ¶
func (u *SystemNotificationRuleUsecase) Delete(ctx context.Context, systemNotificationRuleId uuid.UUID) (out model.SystemNotificationRule, err error)
func (*SystemNotificationRuleUsecase) Fetch ¶
func (u *SystemNotificationRuleUsecase) Fetch(ctx context.Context, organizationId string, pg *pagination.Pagination) (res []model.SystemNotificationRule, err error)
func (*SystemNotificationRuleUsecase) Get ¶
func (u *SystemNotificationRuleUsecase) Get(ctx context.Context, systemNotificationRuleId uuid.UUID) (res model.SystemNotificationRule, err error)
func (*SystemNotificationRuleUsecase) GetByName ¶
func (u *SystemNotificationRuleUsecase) GetByName(ctx context.Context, name string) (out model.SystemNotificationRule, err error)
func (*SystemNotificationRuleUsecase) MakeDefaultSystemNotificationRules ¶
func (u *SystemNotificationRuleUsecase) MakeDefaultSystemNotificationRules(ctx context.Context, organizationId string, dto *model.Organization) error
func (*SystemNotificationRuleUsecase) Update ¶
func (u *SystemNotificationRuleUsecase) Update(ctx context.Context, dto model.SystemNotificationRule) error
type SystemNotificationTemplateUsecase ¶
type SystemNotificationTemplateUsecase struct {
// contains filtered or unexported fields
}
func (*SystemNotificationTemplateUsecase) AddOrganizationSystemNotificationTemplates ¶
func (*SystemNotificationTemplateUsecase) Create ¶
func (u *SystemNotificationTemplateUsecase) Create(ctx context.Context, dto model.SystemNotificationTemplate) (systemNotificationTemplate uuid.UUID, err error)
func (*SystemNotificationTemplateUsecase) Fetch ¶
func (u *SystemNotificationTemplateUsecase) Fetch(ctx context.Context, pg *pagination.Pagination) (alerts []model.SystemNotificationTemplate, err error)
func (*SystemNotificationTemplateUsecase) FetchWithOrganization ¶
func (u *SystemNotificationTemplateUsecase) FetchWithOrganization(ctx context.Context, organizationId string, pg *pagination.Pagination) (res []model.SystemNotificationTemplate, err error)
func (*SystemNotificationTemplateUsecase) Get ¶
func (u *SystemNotificationTemplateUsecase) Get(ctx context.Context, systemNotificationTemplateId uuid.UUID) (systemNotificationTemplate model.SystemNotificationTemplate, err error)
func (*SystemNotificationTemplateUsecase) GetByName ¶
func (u *SystemNotificationTemplateUsecase) GetByName(ctx context.Context, name string) (out model.SystemNotificationTemplate, err error)
func (*SystemNotificationTemplateUsecase) RemoveOrganizationSystemNotificationTemplates ¶
func (*SystemNotificationTemplateUsecase) Update ¶
func (u *SystemNotificationTemplateUsecase) Update(ctx context.Context, dto model.SystemNotificationTemplate) error
func (*SystemNotificationTemplateUsecase) UpdateOrganizations ¶
func (u *SystemNotificationTemplateUsecase) UpdateOrganizations(ctx context.Context, dto model.SystemNotificationTemplate) error
type SystemNotificationUsecase ¶
type SystemNotificationUsecase struct {
// contains filtered or unexported fields
}
func (*SystemNotificationUsecase) Create ¶
func (u *SystemNotificationUsecase) Create(ctx context.Context, input domain.CreateSystemNotificationRequest) (err error)
func (*SystemNotificationUsecase) CreateSystemNotificationAction ¶
func (u *SystemNotificationUsecase) CreateSystemNotificationAction(ctx context.Context, dto model.SystemNotificationAction) (systemNotificationActionId uuid.UUID, err error)
func (*SystemNotificationUsecase) Delete ¶
func (u *SystemNotificationUsecase) Delete(ctx context.Context, dto model.SystemNotification) (err error)
func (*SystemNotificationUsecase) FetchPolicyNotifications ¶
func (u *SystemNotificationUsecase) FetchPolicyNotifications(ctx context.Context, organizationId string, pg *pagination.Pagination) (systemNotifications []model.SystemNotification, err error)
func (*SystemNotificationUsecase) FetchSystemNotifications ¶
func (u *SystemNotificationUsecase) FetchSystemNotifications(ctx context.Context, organizationId string, pg *pagination.Pagination) (systemNotifications []model.SystemNotification, err error)
func (*SystemNotificationUsecase) Get ¶
func (u *SystemNotificationUsecase) Get(ctx context.Context, systemNotificationId uuid.UUID) (systemNotification model.SystemNotification, err error)
func (*SystemNotificationUsecase) GetByName ¶
func (u *SystemNotificationUsecase) GetByName(ctx context.Context, organizationId string, name string) (out model.SystemNotification, err error)
func (*SystemNotificationUsecase) Update ¶
func (u *SystemNotificationUsecase) Update(ctx context.Context, dto model.SystemNotification) error
type Usecase ¶
type Usecase struct { Auth IAuthUsecase User IUserUsecase Cluster IClusterUsecase Organization IOrganizationUsecase AppGroup IAppGroupUsecase AppServeApp IAppServeAppUsecase CloudAccount ICloudAccountUsecase StackTemplate IStackTemplateUsecase Dashboard IDashboardUsecase SystemNotification ISystemNotificationUsecase SystemNotificationTemplate ISystemNotificationTemplateUsecase SystemNotificationRule ISystemNotificationRuleUsecase Stack IStackUsecase Project IProjectUsecase Role IRoleUsecase Permission IPermissionUsecase Audit IAuditUsecase PolicyTemplate IPolicyTemplateUsecase Policy IPolicyUsecase }
type UserUsecase ¶
type UserUsecase struct {
// contains filtered or unexported fields
}
func (*UserUsecase) CreateAdmin ¶
func (*UserUsecase) DeleteAdmin ¶
func (u *UserUsecase) DeleteAdmin(ctx context.Context, organizationId string) error
func (*UserUsecase) DeleteAll ¶
func (u *UserUsecase) DeleteAll(ctx context.Context, organizationId string) error
func (*UserUsecase) DeleteByAccountId ¶
func (*UserUsecase) ExpirePassword ¶
func (*UserUsecase) GenerateRandomPassword ¶
func (u *UserUsecase) GenerateRandomPassword(ctx context.Context) string
func (*UserUsecase) GetByAccountId ¶
func (*UserUsecase) GetByEmail ¶
func (*UserUsecase) ListUsersByRole ¶
func (u *UserUsecase) ListUsersByRole(ctx context.Context, organizationId string, roleId string, pg *pagination.Pagination) (*[]model.User, error)
func (*UserUsecase) ListWithPagination ¶
func (u *UserUsecase) ListWithPagination(ctx context.Context, organizationId string, pg *pagination.Pagination) (users *[]model.User, err error)
func (*UserUsecase) RenewalPasswordExpiredTime ¶
func (*UserUsecase) RenewalPasswordExpiredTimeByAccountId ¶
func (*UserUsecase) ResetPassword ¶
func (*UserUsecase) ResetPasswordByAccountId ¶
func (*UserUsecase) SendEmailForTemporaryPassword ¶
func (*UserUsecase) UpdateByAccountId ¶
func (*UserUsecase) UpdateByAccountIdByAdmin ¶
func (*UserUsecase) UpdatePasswordByAccountId ¶
func (*UserUsecase) ValidateAccount ¶
func (*UserUsecase) ValidateAccountByAccountId ¶
Source Files
¶
Click to show internal directories.
Click to hide internal directories.