Documentation ¶
Index ¶
- Variables
- type AccountsSvc
- type ApplyK8sResourceArgs
- type CheckNameAvailabilityOutput
- type CloneEnvironmentArgs
- type CloneEnvironmentTemplateArgs
- type CloneManagedServiceArgs
- type ClusterManagedService
- type ConfigKeyRef
- type ConfigKeyValueRef
- type ConsoleCacheStore
- type ConsoleContext
- type CreateAndApplyImportedManagedResourceArgs
- type Domain
- type ImageHookPayload
- type K8sContext
- type ManagedResourceContext
- type ManagedResourceKeyRef
- type ManagedResourceKeyValueRef
- type MessageDispatcher
- type PublishMsg
- type ResType
- type ResourceContext
- type ResourceDispatcher
- type ResourceEventPublisher
- type SecretKeyRef
- type SecretKeyValueRef
- type ServiceBinding
- type ServiceBindingDomain
- type UpdateAndDeleteOpts
- type UserAndAccountsContext
Constants ¶
This section is empty.
Variables ¶
View Source
var ErrNoClusterAttached = errors.New("cluster not attached")
View Source
var Module = fx.Module("domain", fx.Provide(func( k8sClient k8s.Client, producer MessageDispatcher, iamClient iam.IAMClient, infraSvc ports.InfraService, platformEdgeClient platform_edge.PlatformEdgeClient, accountsSvc AccountsSvc, environmentRepo repos.DbRepo[*entities.Environment], registryImageRepo repos.DbRepo[*entities.RegistryImage], appRepo repos.DbRepo[*entities.App], externalAppRepo repos.DbRepo[*entities.ExternalApp], configRepo repos.DbRepo[*entities.Config], secretRepo repos.DbRepo[*entities.Secret], routerRepo repos.DbRepo[*entities.Router], mresRepo repos.DbRepo[*entities.ManagedResource], importedMresRepo repos.DbRepo[*entities.ImportedManagedResource], ipsRepo repos.DbRepo[*entities.ImagePullSecret], resourceMappingRepo repos.DbRepo[*entities.ResourceMapping], serviceBindingRepo repos.DbRepo[*entities.ServiceBinding], clusterManagedServiceRepo repos.DbRepo[*entities.ClusterManagedService], logger logging.Logger, resourceEventPublisher ResourceEventPublisher, ev *env.Env, consoleCacheStore ConsoleCacheStore, ) Domain { return &domain{ k8sClient: k8sClient, producer: producer, iamClient: iamClient, infraSvc: infraSvc, platformEdgeClient: platformEdgeClient, AccountsSvc: accountsSvc, logger: logger, environmentRepo: environmentRepo, appRepo: appRepo, externalAppRepo: externalAppRepo, configRepo: configRepo, routerRepo: routerRepo, secretRepo: secretRepo, mresRepo: mresRepo, importedMresRepo: importedMresRepo, pullSecretsRepo: ipsRepo, resourceMappingRepo: resourceMappingRepo, serviceBindingRepo: serviceBindingRepo, clusterManagedServiceRepo: clusterManagedServiceRepo, registryImageRepo: registryImageRepo, envVars: ev, resourceEventPublisher: resourceEventPublisher, consoleCacheStore: consoleCacheStore, } }))
Functions ¶
This section is empty.
Types ¶
type AccountsSvc ¶
type ApplyK8sResourceArgs ¶
type ApplyK8sResourceArgs struct { ClusterName string Object client.Object RecordVersion int Dispatcher MessageDispatcher }
type CloneEnvironmentArgs ¶
type CloneManagedServiceArgs ¶
type ClusterManagedService ¶
type ClusterManagedService interface { ListClusterManagedServices(ctx ConsoleContext, search map[string]repos.MatchFilter, pagination repos.CursorPagination) (*repos.PaginatedRecord[*entities.ClusterManagedService], error) GetClusterManagedService(ctx ConsoleContext, serviceName string) (*entities.ClusterManagedService, error) CreateClusterManagedService(ctx ConsoleContext, cmsvc entities.ClusterManagedService) (*entities.ClusterManagedService, error) // CloneClusterManagedService(ctx ConsoleContext, args CloneManagedServiceArgs) (*entities.ClusterManagedService, error) UpdateClusterManagedService(ctx ConsoleContext, cmsvc entities.ClusterManagedService) (*entities.ClusterManagedService, error) DeleteClusterManagedService(ctx ConsoleContext, name string) error ArchiveClusterManagedServicesForCluster(ctx ConsoleContext, clusterName string) (bool, error) OnClusterManagedServiceApplyError(ctx ConsoleContext, clusterName, name, errMsg string, opts UpdateAndDeleteOpts) error OnClusterManagedServiceDeleteMessage(ctx ConsoleContext, clusterName string, service entities.ClusterManagedService) error OnClusterManagedServiceUpdateMessage(ctx ConsoleContext, clusterName string, service entities.ClusterManagedService, status types.ResourceStatus, opts UpdateAndDeleteOpts) error }
type ConfigKeyRef ¶
type ConfigKeyValueRef ¶
type ConsoleCacheStore ¶
type ConsoleCacheStore kv.BinaryDataRepo
type ConsoleContext ¶
type ConsoleContext struct { context.Context AccountName string UserId repos.ID UserEmail string UserName string }
func NewConsoleContext ¶
func (ConsoleContext) GetAccountName ¶
func (c ConsoleContext) GetAccountName() string
func (ConsoleContext) GetUserEmail ¶
func (c ConsoleContext) GetUserEmail() string
func (ConsoleContext) GetUserId ¶
func (c ConsoleContext) GetUserId() repos.ID
func (ConsoleContext) GetUserName ¶
func (c ConsoleContext) GetUserName() string
type Domain ¶
type Domain interface { AccountsSvc CheckNameAvailability(ctx context.Context, accountName string, environmentName *string, msvcName *string, resType entities.ResourceType, name string) (*CheckNameAvailabilityOutput, error) ListEnvironments(ctx ConsoleContext, search map[string]repos.MatchFilter, pq repos.CursorPagination) (*repos.PaginatedRecord[*entities.Environment], error) GetEnvironment(ctx ConsoleContext, name string) (*entities.Environment, error) SetupDefaultEnvTemplate(ctx ConsoleContext) error CreateEnvironment(ctx ConsoleContext, env entities.Environment) (*entities.Environment, error) CloneEnvironment(ctx ConsoleContext, args CloneEnvironmentArgs) (*entities.Environment, error) UpdateEnvironment(ctx ConsoleContext, env entities.Environment) (*entities.Environment, error) DeleteEnvironment(ctx ConsoleContext, name string) error ArchiveEnvironmentsForCluster(ctx ConsoleContext, clusterName string) (bool, error) OnEnvironmentApplyError(ctx ConsoleContext, errMsg, namespace, name string, opts UpdateAndDeleteOpts) error OnEnvironmentDeleteMessage(ctx ConsoleContext, env entities.Environment) error OnEnvironmentUpdateMessage(ctx ConsoleContext, env entities.Environment, status types.ResourceStatus, opts UpdateAndDeleteOpts) error ResyncEnvironment(ctx ConsoleContext, name string) error GetRegistryImageURL(ctx ConsoleContext) (*entities.RegistryImageURL, error) GetRegistryImage(ctx ConsoleContext, image string) (*entities.RegistryImage, error) DeleteRegistryImage(ctx ConsoleContext, image string) error UpsertRegistryImage(ctx context.Context, accountName string, image string, meta map[string]any) (*entities.RegistryImage, error) ListRegistryImages(ctx ConsoleContext, pq repos.CursorPagination) (*repos.PaginatedRecord[*entities.RegistryImage], error) SearchRegistryImages(ctx ConsoleContext, query string) ([]*entities.RegistryImage, error) ListApps(ctx ResourceContext, search map[string]repos.MatchFilter, pq repos.CursorPagination) (*repos.PaginatedRecord[*entities.App], error) GetApp(ctx ResourceContext, name string) (*entities.App, error) CreateApp(ctx ResourceContext, app entities.App) (*entities.App, error) UpdateApp(ctx ResourceContext, app entities.App) (*entities.App, error) DeleteApp(ctx ResourceContext, name string) error InterceptApp(ctx ResourceContext, appName string, deviceName string, intercept bool, portMappings []crdsv1.AppInterceptPortMappings) (bool, error) InterceptAppOnLocalCluster(ctx ResourceContext, appName string, clusterName string, ipAddr string, intercept bool, portMappings []crdsv1.AppInterceptPortMappings) (bool, error) RestartApp(ctx ResourceContext, appName string) error RemoveDeviceIntercepts(ctx ResourceContext, deviceName string) error OnAppApplyError(ctx ResourceContext, errMsg string, name string, opts UpdateAndDeleteOpts) error OnAppDeleteMessage(ctx ResourceContext, app entities.App) error OnAppUpdateMessage(ctx ResourceContext, app entities.App, status types.ResourceStatus, opts UpdateAndDeleteOpts) error ResyncApp(ctx ResourceContext, name string) error RolloutAppsByImage(ctx ConsoleContext, imageName string) error ListConfigs(ctx ResourceContext, search map[string]repos.MatchFilter, pq repos.CursorPagination) (*repos.PaginatedRecord[*entities.Config], error) GetConfig(ctx ResourceContext, name string) (*entities.Config, error) GetConfigEntries(ctx ResourceContext, keyrefs []ConfigKeyRef) ([]*ConfigKeyValueRef, error) CreateConfig(ctx ResourceContext, config entities.Config) (*entities.Config, error) UpdateConfig(ctx ResourceContext, config entities.Config) (*entities.Config, error) DeleteConfig(ctx ResourceContext, name string) error OnConfigApplyError(ctx ResourceContext, errMsg, name string, opts UpdateAndDeleteOpts) error OnConfigDeleteMessage(ctx ResourceContext, config entities.Config) error OnConfigUpdateMessage(ctx ResourceContext, config entities.Config, status types.ResourceStatus, opts UpdateAndDeleteOpts) error ResyncConfig(ctx ResourceContext, name string) error ListSecrets(ctx ResourceContext, search map[string]repos.MatchFilter, pq repos.CursorPagination) (*repos.PaginatedRecord[*entities.Secret], error) GetSecret(ctx ResourceContext, name string) (*entities.Secret, error) GetSecretEntries(ctx ResourceContext, keyrefs []SecretKeyRef) ([]*SecretKeyValueRef, error) CreateSecret(ctx ResourceContext, secret entities.Secret) (*entities.Secret, error) UpdateSecret(ctx ResourceContext, secret entities.Secret) (*entities.Secret, error) DeleteSecret(ctx ResourceContext, name string) error OnSecretApplyError(ctx ResourceContext, errMsg, name string, opts UpdateAndDeleteOpts) error OnSecretDeleteMessage(ctx ResourceContext, secret entities.Secret) error OnSecretUpdateMessage(ctx ResourceContext, secret entities.Secret, status types.ResourceStatus, opts UpdateAndDeleteOpts) error ResyncSecret(ctx ResourceContext, name string) error ListRouters(ctx ResourceContext, search map[string]repos.MatchFilter, pq repos.CursorPagination) (*repos.PaginatedRecord[*entities.Router], error) GetRouter(ctx ResourceContext, name string) (*entities.Router, error) CreateRouter(ctx ResourceContext, router entities.Router) (*entities.Router, error) UpdateRouter(ctx ResourceContext, router entities.Router) (*entities.Router, error) DeleteRouter(ctx ResourceContext, name string) error OnRouterApplyError(ctx ResourceContext, errMsg string, name string, opts UpdateAndDeleteOpts) error OnRouterDeleteMessage(ctx ResourceContext, router entities.Router) error OnRouterUpdateMessage(ctx ResourceContext, router entities.Router, status types.ResourceStatus, opts UpdateAndDeleteOpts) error ResyncRouter(ctx ResourceContext, name string) error ListManagedResources(ctx ConsoleContext, search map[string]repos.MatchFilter, pq repos.CursorPagination) (*repos.PaginatedRecord[*entities.ManagedResource], error) GetManagedResource(ctx ManagedResourceContext, name string) (*entities.ManagedResource, error) GetManagedResourceByID(ctx ConsoleContext, id repos.ID) (*entities.ManagedResource, error) GetManagedResourceOutputKeys(ctx ManagedResourceContext, name string) ([]string, error) GetImportedManagedResourceOutputKeys(ctx ResourceContext, name string) ([]string, error) GetManagedResourceOutputKVs(ctx ManagedResourceContext, keyrefs []ManagedResourceKeyRef) ([]*ManagedResourceKeyValueRef, error) GetImportedManagedResourceOutputKVs(ctx ResourceContext, keyrefs []ManagedResourceKeyRef) ([]*ManagedResourceKeyValueRef, error) CreateManagedResource(ctx ManagedResourceContext, mres entities.ManagedResource) (*entities.ManagedResource, error) UpdateManagedResource(ctx ManagedResourceContext, mres entities.ManagedResource) (*entities.ManagedResource, error) DeleteManagedResource(ctx ManagedResourceContext, name string) error // ImportManagedResource(ctx ManagedResourceContext, mresName string, importName string) (*entities.ManagedResource, error) ImportManagedResource(ctx ManagedResourceContext, mresName string, importName string) (*entities.ImportedManagedResource, error) // ListImportedManagedResources(ctx ConsoleContext, search map[string]repos.MatchFilter, pq repos.CursorPagination) (*repos.PaginatedRecord[*entities.ManagedResource], error) ListImportedManagedResources(ctx ConsoleContext, envName string, search map[string]repos.MatchFilter, pq repos.CursorPagination) (*repos.PaginatedRecord[*entities.ImportedManagedResource], error) DeleteImportedManagedResource(ctx ResourceContext, importName string) error OnManagedResourceApplyError(ctx ConsoleContext, errMsg string, msvcName string, name string, opts UpdateAndDeleteOpts) error OnManagedResourceDeleteMessage(ctx ConsoleContext, msvcName string, mres crdsv1.ManagedResource) error OnManagedResourceUpdateMessage(ctx ConsoleContext, msvcName string, mres crdsv1.ManagedResource, outputSecret *corev1.Secret, status types.ResourceStatus, opts UpdateAndDeleteOpts) error ResyncManagedResource(ctx ConsoleContext, msvcName string, name string) error /// External Apps ListExternalApps(ctx ResourceContext, search map[string]repos.MatchFilter, pq repos.CursorPagination) (*repos.PaginatedRecord[*entities.ExternalApp], error) GetExternalApp(ctx ResourceContext, name string) (*entities.ExternalApp, error) CreateExternalApp(ctx ResourceContext, externalApp entities.ExternalApp) (*entities.ExternalApp, error) UpdateExternalApp(ctx ResourceContext, externalAppIn entities.ExternalApp) (*entities.ExternalApp, error) DeleteExternalApp(ctx ResourceContext, name string) error InterceptExternalApp(ctx ResourceContext, externalAppName string, deviceName string, intercept bool, portMappings []crdsv1.AppInterceptPortMappings) (bool, error) OnExternalAppApplyError(ctx ResourceContext, errMsg string, name string, opts UpdateAndDeleteOpts) error OnExternalAppDeleteMessage(ctx ResourceContext, externalApp entities.ExternalApp) error OnExternalAppUpdateMessage(ctx ResourceContext, externalApp entities.ExternalApp, status types.ResourceStatus, opts UpdateAndDeleteOpts) error ResyncExternalApp(ctx ResourceContext, name string) error // image pull secrets ListImagePullSecrets(ctx ConsoleContext, search map[string]repos.MatchFilter, pagination repos.CursorPagination) (*repos.PaginatedRecord[*entities.ImagePullSecret], error) GetImagePullSecret(ctx ConsoleContext, name string) (*entities.ImagePullSecret, error) CreateImagePullSecret(ctx ConsoleContext, secret entities.ImagePullSecret) (*entities.ImagePullSecret, error) UpdateImagePullSecret(ctx ConsoleContext, secret entities.ImagePullSecret) (*entities.ImagePullSecret, error) DeleteImagePullSecret(ctx ConsoleContext, name string) error OnImagePullSecretApplyError(ctx ConsoleContext, errMsg string, name string, opts UpdateAndDeleteOpts) error OnImagePullSecretDeleteMessage(ctx ConsoleContext, ips entities.ImagePullSecret) error OnImagePullSecretUpdateMessage(ctx ConsoleContext, ips entities.ImagePullSecret, status types.ResourceStatus, opts UpdateAndDeleteOpts) error ResyncImagePullSecret(ctx ConsoleContext, name string) error GetEnvironmentResourceMapping(ctx ConsoleContext, resType entities.ResourceType, clusterName string, namespace string, name string) (*entities.ResourceMapping, error) ServiceBinding ClusterManagedService }
type ImageHookPayload ¶
type K8sContext ¶
type ManagedResourceContext ¶
type ManagedResourceContext struct { ConsoleContext ManagedServiceName *string EnvironmentName *string }
func NewManagedResourceContext ¶
func NewManagedResourceContext(ctx ConsoleContext, msvcName string) ManagedResourceContext
func (ManagedResourceContext) MresDBFilters ¶
func (m ManagedResourceContext) MresDBFilters() (*repos.Filter, error)
type ManagedResourceKeyRef ¶
type MessageDispatcher ¶
type PublishMsg ¶
type PublishMsg string
const ( PublishAdd PublishMsg = "added" PublishDelete PublishMsg = "deleted" PublishUpdate PublishMsg = "updated" )
type ResourceContext ¶
type ResourceContext struct { ConsoleContext EnvironmentName string }
func (ResourceContext) DBFilters ¶
func (r ResourceContext) DBFilters() repos.Filter
type ResourceDispatcher ¶
type ResourceDispatcher interface { ApplyResource() DeleteResource() RestartResource() }
type ResourceEventPublisher ¶
type ResourceEventPublisher interface { PublishConsoleEvent(ctx ConsoleContext, resourceType entities.ResourceType, name string, update PublishMsg) PublishEnvironmentResourceEvent(ctx ConsoleContext, envName string, resourceType entities.ResourceType, name string, update PublishMsg) PublishResourceEvent(ctx ResourceContext, resourceType entities.ResourceType, name string, update PublishMsg) PublishClusterManagedServiceEvent(ctx ConsoleContext, msvcName string, resourceType entities.ResourceType, name string, update PublishMsg) }
type SecretKeyRef ¶
type SecretKeyValueRef ¶
type ServiceBinding ¶
type ServiceBinding interface { OnServiceBindingUpdateMessage(ctx ConsoleContext, svcb *networkingv1.ServiceBinding, status types.ResourceStatus, opts UpdateAndDeleteOpts) error OnServiceBindingDeleteMessage(ctx ConsoleContext, svcb *networkingv1.ServiceBinding) error }
type ServiceBindingDomain ¶
type ServiceBindingDomain interface {
FindServiceBindingByHostname(ctx context.Context, accountName string, hostname string) (*entities.ServiceBinding, error)
}
func NewSvcBindingDomain ¶
func NewSvcBindingDomain(svcBindingRepo repos.DbRepo[*entities.ServiceBinding]) ServiceBindingDomain
type UpdateAndDeleteOpts ¶
Source Files ¶
- api.go
- app.go
- clone-env-template.go
- cluster-managed-service.go
- config.go
- domain-service-binding.go
- domain.go
- environment.go
- external-app.go
- image-pull-secret.go
- imported-managed-resource.go
- mres.go
- names.go
- project-managed-service.go
- project.go
- registry-image.go
- resource-mapping.go
- router.go
- secret.go
- service-binding.go
Click to show internal directories.
Click to hide internal directories.