{"modulePath":"github.com/Stackdome/stackdome","version":"v0.0.7-alpha","isLatest":true,"isStandardLibrary":false,"goos":"all","goarch":"all","docs":"# package clusterresource\n\nPackage clusterresource is a generated GoMock package.\n\nPackage clusterresource is a generated GoMock package.\n\nPackage clusterresource is a generated GoMock package.\n\n## Constants\n\n```go\nconst (\n\tDefaultLogStreamBufferSize     = 1000\n\tDefaultStreamTimeoutDuration   = 20 * time.Minute\n\tDefaultLogStreamRateLimit      = 200 * time.Millisecond\n\tDefaultLogStreamRateLimitBurst = 100\n\tMaxLogStreamErrors             = 50\n)\n```\n\n```go\nconst (\n\tMetricsServerPollingInterval = 15 * time.Second\n\n\tStackResourceTargetType = \"stack_resource\"\n\tStackTargetType         = \"stack\"\n)\n```\n\n## Variables\n\n```go\nvar ErrBuildPodNotFound = stderrors.New(\"no build pod found\")\n```\nErrBuildPodNotFound is returned by GetLogsForBuildPod when no pod matches the build Job — the build has not started yet or its pod has been pruned.\n\n```go\nvar ErrBuildPodNotReady = stderrors.New(\"build pod not ready\")\n```\nErrBuildPodNotReady is returned by GetLogsForBuildPod when the build pod exists but has not started yet — logs are not available until it runs.\n\n```go\nvar ErrNoWorkload = stderrors.New(\"no workload found\")\n```\nErrNoWorkload is returned when none of the requested resources has a pod to read logs from — never scheduled, or already gone. Callers map it to a 404.\n\n## Functions\n\n```go\nfunc WrapErrAsServiceError(err error) *errors.ServiceError\n```\n\n## Types\n\n```go\ntype BackgroundJobEnqueuerDep struct {\n\tBackgroundJobEnqueuer workermanager.BackgroundJobEnqueuer\n}\n```\n\n```go\nfunc (s *BackgroundJobEnqueuerDep) InjectBackgroundJobEnqueuer(dep BackgroundJobEnqueuerDep)\n```\n\n```go\ntype BackgroundJobEnqueuerInjectable interface {\n\tInjectBackgroundJobEnqueuer(dep BackgroundJobEnqueuerDep)\n}\n```\n\n```go\ntype ClusterImageRegistryService interface {\n\tEnsureImageRegistryInCluster(ctx context.Context, registry *models.ClusterImageRegistry) *ClusterResourceError\n\tDeleteImageRegistryInCluster(ctx context.Context, registry *models.ClusterImageRegistry) (bool, *ClusterResourceError)\n}\n```\n\n```go\nfunc NewClusterImageRegistryService(spec ClusterImageRegistryServiceSpec) ClusterImageRegistryService\n```\n\n```go\ntype ClusterImageRegistryServiceSpec struct {\n\tClusterManager clustermanager.ClusterManager\n\tLogger         logger.Logger\n}\n```\n\n```go\ntype ClusterLoggingService interface {\n\t// GetLogsForResources retrieves logs for the specified resources in the cluster.\n\tGetLogsForResources(ctx context.Context, orgID string, resources []*models.StackResource, options LoggingParams) (interfaces.ServerSideStreamable, error)\n\t// GetLogsForBuildPod streams logs from the build pod of the named ImageBuild.\n\tGetLogsForBuildPod(ctx context.Context, orgID string, namespace string, buildName string, options LoggingParams) (interfaces.ServerSideStreamable, error)\n}\n```\n\n```go\nfunc NewLoggingService(spec LoggingServiceSpec) ClusterLoggingService\n```\n\n```go\ntype ClusterMetricsService interface {\n\tGetMetricsForResource(ctx context.Context, orgID string, stackResource *models.StackResource) (*models.ResourceMetrics, error)\n\tGetMetricsForStack(ctx context.Context, orgID string, stack *models.Stack) (*models.ResourceMetrics, error)\n\tStreamMetricsForResource(ctx context.Context, orgID string, stackResource *models.StackResource) (interfaces.ServerSideStreamable, error)\n\tStreamMetricsForStack(ctx context.Context, orgID string, stack *models.Stack) (interfaces.ServerSideStreamable, error)\n}\n```\n\n```go\nfunc NewClusterMetricsService(spec ClusterMetricsServiceSpec) ClusterMetricsService\n```\n\n```go\ntype ClusterMetricsServiceSpec struct {\n\tClusterService DBClusterService\n\tClusterManager clustermanager.ClusterManager\n\tLogger         logger.Logger\n}\n```\n\n```go\ntype ClusterResourceError struct {\n\tMessage string\n\tErr     error\n}\n```\n\n```go\nfunc (e *ClusterResourceError) Error() string\n```\n\n```go\ntype ClusterResourceServiceDeps struct {\n\tClusterNamespaceService NamespaceClusterResourceService\n\tClusterVolumeService    VolumeClusterResourceService\n\tClusterLoggingService   ClusterLoggingService\n\tClusterMetricsService   ClusterMetricsService\n}\n```\nClusterResourceServiceDeps is embedded in services that require cluster resource service dependencies.\n\n```go\nfunc (s *ClusterResourceServiceDeps) InjectClusterResourceServiceDeps(deps ClusterResourceServiceDeps)\n```\n\n```go\ntype ClusterResourceServiceInjectable interface {\n\tInjectClusterResourceServiceDeps(deps ClusterResourceServiceDeps)\n}\n```\nClusterResourceServiceInjectable is implemented (by embedding ClusterResourceServiceDeps) by services that need cluster resource service dependencies injected. It lives in this leaf package — not pkg/services — so that mocks of services interfaces embedding it (pkg/mocks) never import pkg/services, which would close an import cycle through the in-package tests of pkg/services and its dependents.\n\n```go\ntype DBClusterService interface {\n\tGetClusterForOrg(ctx context.Context, orgID string) (*models.Cluster, *errors.ServiceError)\n}\n```\n\n```go\ntype DBOrganisationService interface {\n\tGet(ctx context.Context, ID string) (*models.Organisation, *errors.ServiceError)\n}\n```\n\n```go\ntype DBSecretService interface {\n\tInternalGetByID(ctx context.Context, secretID string) (*models.Secret, *errors.ServiceError)\n}\n```\n\n```go\ntype DBStackResourceService interface {\n\tGetByStackResourceID(ctx context.Context, stackResourceID string) (*models.StackResource, *errors.ServiceError)\n\tGetByStackID(ctx context.Context, stackID string) ([]*models.StackResource, *errors.ServiceError)\n}\n```\n\n```go\ntype KubernetesClientFactory func(clients.KubernetesClientSpec) (clients.KubernetesClient, error)\n```\nKubernetesClientFactory constructs a Kubernetes client from a spec. Tests inject a factory returning a mock; production uses clients.NewKubernetesClient.\n\n```go\ntype LogStreamConfig struct {\n\t// contains filtered or unexported fields\n}\n```\n\n```go\nfunc (s *LogStreamConfig) Follow() bool\n```\n\n```go\nfunc (s *LogStreamConfig) MaxErrors() int\n```\n\n```go\nfunc (s *LogStreamConfig) Previous() bool\n```\n\n```go\nfunc (s *LogStreamConfig) Since() string\n```\n\n```go\nfunc (s *LogStreamConfig) TailLines() int\n```\n\n```go\ntype LogStreamer struct {\n\tLogger logger.Logger\n\t// contains filtered or unexported fields\n}\n```\n\n```go\nfunc (s *LogStreamer) Stream(ctx context.Context) (\u003c-chan interfaces.StreamObject, error)\n```\n\n```go\ntype LoggingParams interface {\n\t// Follow indicates whether to follow the log stream.\n\tFollow() bool\n\t// TailLines specifies the number of lines to tail from the end of the log.\n\tTailLines() int\n\t// Since specifies the time from which to start streaming logs.\n\tSince() string\n}\n```\n\n```go\ntype LoggingServiceSpec struct {\n\tClusterService DBClusterService\n\tClusterManager clustermanager.ClusterManager\n\tLogger         logger.Logger\n\t// NewK8sClient overrides the Kubernetes client constructor; nil uses the real client.\n\tNewK8sClient KubernetesClientFactory\n}\n```\n\n```go\ntype MockClusterManager struct {\n\t// contains filtered or unexported fields\n}\n```\nMockClusterManager is a mock of ClusterManager interface.\n\n```go\nfunc NewMockClusterManager(ctrl *gomock.Controller) *MockClusterManager\n```\nNewMockClusterManager creates a new mock instance.\n\n```go\nfunc (m *MockClusterManager) EXPECT() *MockClusterManagerMockRecorder\n```\nEXPECT returns an object that allows the caller to indicate expected use.\n\n```go\nfunc (m *MockClusterManager) GetClient(clusterID string) (client.Client, error)\n```\nGetClient mocks base method.\n\n```go\nfunc (m *MockClusterManager) GetRestConfig(clusterID string) (*rest.Config, error)\n```\nGetRestConfig mocks base method.\n\n```go\nfunc (m *MockClusterManager) IsClusterRegistered(clusterID string) bool\n```\nIsClusterRegistered mocks base method.\n\n```go\nfunc (m *MockClusterManager) IsRunning() bool\n```\nIsRunning mocks base method.\n\n```go\nfunc (m *MockClusterManager) ReRegisterCluster(cluster *models.Cluster) error\n```\nReRegisterCluster mocks base method.\n\n```go\nfunc (m *MockClusterManager) RegisterCluster(cluster *models.Cluster) error\n```\nRegisterCluster mocks base method.\n\n```go\nfunc (m *MockClusterManager) Start(ctx context.Context)\n```\nStart mocks base method.\n\n```go\nfunc (m *MockClusterManager) Stop(ctx context.Context) error\n```\nStop mocks base method.\n\n```go\nfunc (m *MockClusterManager) UnregisterCluster(clusterID string) error\n```\nUnregisterCluster mocks base method.\n\n```go\ntype MockClusterManagerMockRecorder struct {\n\t// contains filtered or unexported fields\n}\n```\nMockClusterManagerMockRecorder is the mock recorder for MockClusterManager.\n\n```go\nfunc (mr *MockClusterManagerMockRecorder) GetClient(clusterID any) *gomock.Call\n```\nGetClient indicates an expected call of GetClient.\n\n```go\nfunc (mr *MockClusterManagerMockRecorder) GetRestConfig(clusterID any) *gomock.Call\n```\nGetRestConfig indicates an expected call of GetRestConfig.\n\n```go\nfunc (mr *MockClusterManagerMockRecorder) IsClusterRegistered(clusterID any) *gomock.Call\n```\nIsClusterRegistered indicates an expected call of IsClusterRegistered.\n\n```go\nfunc (mr *MockClusterManagerMockRecorder) IsRunning() *gomock.Call\n```\nIsRunning indicates an expected call of IsRunning.\n\n```go\nfunc (mr *MockClusterManagerMockRecorder) ReRegisterCluster(cluster any) *gomock.Call\n```\nReRegisterCluster indicates an expected call of ReRegisterCluster.\n\n```go\nfunc (mr *MockClusterManagerMockRecorder) RegisterCluster(cluster any) *gomock.Call\n```\nRegisterCluster indicates an expected call of RegisterCluster.\n\n```go\nfunc (mr *MockClusterManagerMockRecorder) Start(ctx any) *gomock.Call\n```\nStart indicates an expected call of Start.\n\n```go\nfunc (mr *MockClusterManagerMockRecorder) Stop(ctx any) *gomock.Call\n```\nStop indicates an expected call of Stop.\n\n```go\nfunc (mr *MockClusterManagerMockRecorder) UnregisterCluster(clusterID any) *gomock.Call\n```\nUnregisterCluster indicates an expected call of UnregisterCluster.\n\n```go\ntype MockDBClusterService struct {\n\t// contains filtered or unexported fields\n}\n```\nMockDBClusterService is a mock of DBClusterService interface.\n\n```go\nfunc NewMockDBClusterService(ctrl *gomock.Controller) *MockDBClusterService\n```\nNewMockDBClusterService creates a new mock instance.\n\n```go\nfunc (m *MockDBClusterService) EXPECT() *MockDBClusterServiceMockRecorder\n```\nEXPECT returns an object that allows the caller to indicate expected use.\n\n```go\nfunc (m *MockDBClusterService) GetClusterForOrg(ctx context.Context, orgID string) (*models.Cluster, *errors.ServiceError)\n```\nGetClusterForOrg mocks base method.\n\n```go\ntype MockDBClusterServiceMockRecorder struct {\n\t// contains filtered or unexported fields\n}\n```\nMockDBClusterServiceMockRecorder is the mock recorder for MockDBClusterService.\n\n```go\nfunc (mr *MockDBClusterServiceMockRecorder) GetClusterForOrg(ctx, orgID any) *gomock.Call\n```\nGetClusterForOrg indicates an expected call of GetClusterForOrg.\n\n```go\ntype MockKubernetesClient struct {\n\t// contains filtered or unexported fields\n}\n```\nMockKubernetesClient is a mock of KubernetesClient interface.\n\n```go\nfunc NewMockKubernetesClient(ctrl *gomock.Controller) *MockKubernetesClient\n```\nNewMockKubernetesClient creates a new mock instance.\n\n```go\nfunc (m *MockKubernetesClient) AttachablePodFromService(ctx context.Context, svcKey types.NamespacedName) (*v1.Pod, error)\n```\nAttachablePodFromService mocks base method.\n\n```go\nfunc (m *MockKubernetesClient) BuildPodForJob(ctx context.Context, namespace, jobName string) (*v1.Pod, error)\n```\nBuildPodForJob mocks base method.\n\n```go\nfunc (m *MockKubernetesClient) EXPECT() *MockKubernetesClientMockRecorder\n```\nEXPECT returns an object that allows the caller to indicate expected use.\n\n```go\nfunc (m *MockKubernetesClient) GetNamespaceMetrics(ctx context.Context, namespace string) (*clients.MetricsStreamObject, error)\n```\nGetNamespaceMetrics mocks base method.\n\n```go\nfunc (m *MockKubernetesClient) StreamNamespaceMetrics(ctx context.Context, namespace string, metricsStreamOpts clients.MetricsStreamOptions) (\u003c-chan *clients.MetricsStreamObject, error)\n```\nStreamNamespaceMetrics mocks base method.\n\n```go\nfunc (m *MockKubernetesClient) StreamPodLogs(ctx context.Context, pod *v1.Pod, logOpts clients.PodLogStreamOptions) (\u003c-chan *clients.LogStreamObject, error)\n```\nStreamPodLogs mocks base method.\n\n```go\ntype MockKubernetesClientMockRecorder struct {\n\t// contains filtered or unexported fields\n}\n```\nMockKubernetesClientMockRecorder is the mock recorder for MockKubernetesClient.\n\n```go\nfunc (mr *MockKubernetesClientMockRecorder) AttachablePodFromService(ctx, svcKey any) *gomock.Call\n```\nAttachablePodFromService indicates an expected call of AttachablePodFromService.\n\n```go\nfunc (mr *MockKubernetesClientMockRecorder) BuildPodForJob(ctx, namespace, jobName any) *gomock.Call\n```\nBuildPodForJob indicates an expected call of BuildPodForJob.\n\n```go\nfunc (mr *MockKubernetesClientMockRecorder) GetNamespaceMetrics(ctx, namespace any) *gomock.Call\n```\nGetNamespaceMetrics indicates an expected call of GetNamespaceMetrics.\n\n```go\nfunc (mr *MockKubernetesClientMockRecorder) StreamNamespaceMetrics(ctx, namespace, metricsStreamOpts any) *gomock.Call\n```\nStreamNamespaceMetrics indicates an expected call of StreamNamespaceMetrics.\n\n```go\nfunc (mr *MockKubernetesClientMockRecorder) StreamPodLogs(ctx, pod, logOpts any) *gomock.Call\n```\nStreamPodLogs indicates an expected call of StreamPodLogs.\n\n```go\ntype NamespaceClusterResourceService interface {\n\tCreateNamespaceInCluster(ctx context.Context, ns *models.Namespace) *ClusterResourceError\n\tDeleteNamespaceInCluster(ctx context.Context, ns *models.Namespace) *ClusterResourceError\n}\n```\nNamespaceClusterResourceService is an interface for managing namespace resources in a cluster.\n\n```go\nfunc NewNamespaceClusterResourceService(spec NamespaceClusterResourceServiceSpec) NamespaceClusterResourceService\n```\nNewNamespaceClusterResourceService creates a new NamespaceClusterResourceService\n\n```go\ntype NamespaceClusterResourceServiceSpec struct {\n\tClusterService DBClusterService\n\tClusterManager clustermanager.ClusterManager\n\tLogger         logger.Logger\n}\n```\n\n```go\ntype ResourceError struct {\n\tResourceName string\n\tError        error\n}\n```\n\n```go\ntype StackStorageClusterResourceService interface {\n\tUpsertStorageInCluster(ctx context.Context, stackStorage *models.StackStorage) *ClusterResourceError\n\tDeleteStorageInCluster(ctx context.Context, stackStorage *models.StackStorage) *ClusterResourceError\n}\n```\n\n```go\ntype StreamedLog struct {\n\t// contains filtered or unexported fields\n}\n```\n\n```go\nfunc (s *StreamedLog) Data() string\n```\n\n```go\nfunc (s *StreamedLog) Error() error\n```\n\n```go\ntype StreamedMetrics struct {\n\t// contains filtered or unexported fields\n}\n```\n\n```go\nfunc (s *StreamedMetrics) Data() string\n```\n\n```go\nfunc (s *StreamedMetrics) Error() error\n```\n\n```go\ntype VolumeClusterResourceService interface {\n\tUpdateVolumeRemoteDirRevisionInCluster(ctx context.Context, volume *models.Volume) *ClusterResourceError\n\tUpdateVolumeGitRevisionInCluster(ctx context.Context, volume *models.Volume) *ClusterResourceError\n\tCreateVolumeInCluster(ctx context.Context, volume *models.Volume) *ClusterResourceError\n\tDeleteVolumeInCluster(ctx context.Context, volume *models.Volume) *ClusterResourceError\n}\n```\nVolumeClusterResourceService is an interface for managing volume resources in a cluster.\n\n```go\nfunc NewVolumeClusterResourceService(spec VolumeClusterResourceServiceSpec) VolumeClusterResourceService\n```\n\n```go\ntype VolumeClusterResourceServiceSpec struct {\n\tClusterService DBClusterService\n\tClusterManager clustermanager.ClusterManager\n\tLogger         logger.Logger\n}\n```\n\n","path":"github.com/Stackdome/stackdome/pkg/services/clusterresource","name":"clusterresource","synopsis":"Package clusterresource is a generated GoMock package.","isRedistributable":true}
