Documentation
¶
Index ¶
- func NewHelmfileService(logger *slog.Logger, stackService stackService, stackFolder string, ...) helmfileService
- func NewKubernetesService(config model.Cluster) (*kubernetesService, error)
- func NewRepository(db *gorm.DB, instanceParameterEncryptionKey string) *repository
- func Routes(r *gin.Engine, authenticator gin.HandlerFunc, handler Handler)
- type BackupObject
- type BackupService
- type BackupSource
- type BackupStats
- type Category
- type ClusterResources
- type GroupWithDeployments
- type GroupWithPublicInstances
- type Handler
- func (h Handler) DeleteDeployment(c *gin.Context)
- func (h Handler) DeleteDeploymentInstance(c *gin.Context)
- func (h Handler) DeployDeployment(c *gin.Context)
- func (h Handler) FindDeploymentById(c *gin.Context)
- func (h Handler) FindDeployments(c *gin.Context)
- func (h Handler) FindPublicInstances(c *gin.Context)
- func (h Handler) InstanceWithDetails(c *gin.Context)
- func (h Handler) Logs(c *gin.Context)
- func (h Handler) Pause(c *gin.Context)
- func (h Handler) Reset(c *gin.Context)
- func (h Handler) Restart(c *gin.Context)
- func (h Handler) Resume(c *gin.Context)
- func (h Handler) SaveDeployment(c *gin.Context)
- func (h Handler) SaveInstance(c *gin.Context)
- func (h Handler) Status(c *gin.Context)
- func (h Handler) UpdateDeployment(c *gin.Context)
- func (h Handler) UpdateInstance(c *gin.Context)
- type InstanceStatus
- type MinioBackupSource
- type MinioClient
- type MinioRestoreClient
- type PublicInstance
- type RestoreService
- type RestoreStats
- type S3BackupClient
- type S3RestoreClient
- type SaveDeploymentRequest
- type SaveInstanceRequest
- type Service
- func (s Service) Delete(ctx context.Context, deploymentInstanceId uint) error
- func (s Service) DeleteDeployment(ctx context.Context, deployment *model.Deployment) error
- func (s Service) DeleteInstance(ctx context.Context, deploymentId, instanceId uint) error
- func (s Service) DeployDeployment(ctx context.Context, token string, deployment *model.Deployment) error
- func (s Service) FilestoreBackup(ctx context.Context, instance *model.DeploymentInstance, name string, ...) error
- func (s Service) FindAllDeployments(ctx context.Context) ([]model.Deployment, error)
- func (s Service) FindDecryptedDeploymentById(ctx context.Context, id uint) (*model.Deployment, error)
- func (s Service) FindDecryptedDeploymentInstanceById(ctx context.Context, id uint) (*model.DeploymentInstance, error)
- func (s Service) FindDeploymentById(ctx context.Context, id uint) (*model.Deployment, error)
- func (s Service) FindDeploymentInstanceById(ctx context.Context, id uint) (*model.DeploymentInstance, error)
- func (s Service) FindDeployments(ctx context.Context, user *model.User) ([]GroupWithDeployments, error)
- func (s Service) FindPublicInstances(ctx context.Context) ([]GroupWithPublicInstances, error)
- func (s Service) GetStatus(instance *model.DeploymentInstance) (InstanceStatus, error)
- func (s Service) Logs(instance *model.DeploymentInstance, group *model.Group, typeSelector string) (io.ReadCloser, error)
- func (s Service) Pause(ctx context.Context, instance *model.DeploymentInstance) error
- func (s Service) Reset(ctx context.Context, token string, instance *model.DeploymentInstance, ...) error
- func (s Service) Restart(ctx context.Context, instance *model.DeploymentInstance, typeSelector string) error
- func (s Service) Resume(ctx context.Context, instance *model.DeploymentInstance) error
- func (s Service) SaveDeployment(ctx context.Context, deployment *model.Deployment) error
- func (s Service) SaveInstance(ctx context.Context, instance *model.DeploymentInstance) error
- func (s Service) UpdateDeployment(ctx context.Context, token string, deploymentId uint, ttl uint, ...) (*model.Deployment, error)
- func (s Service) UpdateInstance(ctx context.Context, token string, deploymentId, instanceId uint, ...) (*model.DeploymentInstance, error)
- type UpdateDeploymentRequest
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func NewHelmfileService ¶
func NewKubernetesService ¶
func NewRepository ¶
Types ¶
type BackupObject ¶
BackupObject represents an object to be backed up
type BackupService ¶
type BackupService struct {
// contains filtered or unexported fields
}
BackupService handles the backup operation
func NewBackupService ¶
func NewBackupService(logger *slog.Logger, source BackupSource, s3Client S3BackupClient) *BackupService
NewBackupService creates a new backup service instance
func (*BackupService) PerformBackup ¶
func (s *BackupService) PerformBackup(ctx context.Context, s3Bucket, key string) error
PerformBackup executes the backup operation
type BackupSource ¶
type BackupSource interface {
// List returns a channel of objects to back up
List(ctx context.Context) (<-chan BackupObject, error)
// Get returns a reader for a specific object
Get(ctx context.Context, path string) (io.ReadCloser, error)
}
BackupSource defines a generic interface for backup sources
type BackupStats ¶
type BackupStats struct {
ObjectsProcessed int64
BytesProcessed int64
StartTime time.Time
// contains filtered or unexported fields
}
BackupStats tracks backup operation statistics
type Category ¶
type Category struct {
Label string `json:"label"`
Instances []PublicInstance `json:"instances"`
}
type ClusterResources ¶
func FindResources ¶
func FindResources(cluster model.Cluster) (ClusterResources, error)
type GroupWithDeployments ¶
type GroupWithDeployments struct {
Name string `json:"name"`
Hostname string `json:"hostname"`
Deployments []*model.Deployment `json:"deployments"`
}
type Handler ¶
type Handler struct {
// contains filtered or unexported fields
}
func NewHandler ¶
func (Handler) DeleteDeployment ¶
DeleteDeployment deployment by id
func (Handler) DeleteDeploymentInstance ¶
DeleteDeploymentInstance delete deployment instance by id
func (Handler) DeployDeployment ¶
func (Handler) FindDeploymentById ¶
FindDeploymentById deployment
func (Handler) FindDeployments ¶
FindDeployments deployments
func (Handler) FindPublicInstances ¶
FindPublicInstances list public available instances
func (Handler) InstanceWithDetails ¶
InstanceWithDetails instance
func (Handler) SaveDeployment ¶
func (Handler) SaveInstance ¶
func (Handler) UpdateDeployment ¶
UpdateDeployment updates an existing Deployment's TTL and description
func (Handler) UpdateInstance ¶
UpdateInstance updates an existing deployment instance
type InstanceStatus ¶
type InstanceStatus string
const ( NotDeployed InstanceStatus = "NotDeployed" Pending InstanceStatus = "Pending" Booting InstanceStatus = "Booting" BootingWithRestart InstanceStatus = "Booting (%d)" Running InstanceStatus = "Running" Error InstanceStatus = "Error" )
type MinioBackupSource ¶
type MinioBackupSource struct {
// contains filtered or unexported fields
}
MinioBackupSource implements BackupSource for MinIO
func NewMinioBackupSource ¶
func NewMinioBackupSource(logger *slog.Logger, client MinioClient, bucket string) *MinioBackupSource
func (*MinioBackupSource) Get ¶
func (m *MinioBackupSource) Get(ctx context.Context, path string) (io.ReadCloser, error)
Get implements BackupSource interface
func (*MinioBackupSource) List ¶
func (m *MinioBackupSource) List(ctx context.Context) (<-chan BackupObject, error)
List implements BackupSource interface
type MinioClient ¶
type MinioClient interface {
ListObjects(ctx context.Context, bucketName string, opts minio.ListObjectsOptions) <-chan minio.ObjectInfo
GetObject(ctx context.Context, bucketName, objectName string, opts minio.GetObjectOptions) (*minio.Object, error)
}
MinioClient defines the methods we need from MinIO client
type MinioRestoreClient ¶
type MinioRestoreClient interface {
PutObject(ctx context.Context, bucket string, name string, reader io.Reader, size int64, options minio.PutObjectOptions) (minio.UploadInfo, error)
ListObjects(ctx context.Context, bucketName string, opts minio.ListObjectsOptions) <-chan minio.ObjectInfo
RemoveObjects(ctx context.Context, bucketName string, objectsCh <-chan minio.ObjectInfo, opts minio.RemoveObjectsOptions) <-chan minio.RemoveObjectError
}
type PublicInstance ¶
type RestoreService ¶
type RestoreService struct {
// contains filtered or unexported fields
}
func NewRestoreService ¶
func NewRestoreService(logger *slog.Logger, minioClient MinioRestoreClient, s3Client S3RestoreClient) *RestoreService
func (*RestoreService) PerformPurge ¶
func (s *RestoreService) PerformPurge(ctx context.Context, minioBucket string) error
func (*RestoreService) PerformRestore ¶
func (s *RestoreService) PerformRestore(ctx context.Context, s3Bucket, s3Key, minioBucket string) error
type RestoreStats ¶
type S3BackupClient ¶
type S3BackupClient interface {
CreateMultipartUpload(ctx context.Context, params *s3.CreateMultipartUploadInput, optFns ...func(*s3.Options)) (*s3.CreateMultipartUploadOutput, error)
UploadPart(ctx context.Context, params *s3.UploadPartInput, optFns ...func(*s3.Options)) (*s3.UploadPartOutput, error)
CompleteMultipartUpload(ctx context.Context, params *s3.CompleteMultipartUploadInput, optFns ...func(*s3.Options)) (*s3.CompleteMultipartUploadOutput, error)
AbortMultipartUpload(ctx context.Context, params *s3.AbortMultipartUploadInput, optFns ...func(*s3.Options)) (*s3.AbortMultipartUploadOutput, error)
}
S3BackupClient defines the methods we need from AWS S3 client
type S3RestoreClient ¶
type S3RestoreClient interface {
GetObject(ctx context.Context, params *s3.GetObjectInput, optFns ...func(*s3.Options)) (*s3.GetObjectOutput, error)
}
type SaveDeploymentRequest ¶
type SaveInstanceRequest ¶
type Service ¶
type Service struct {
// contains filtered or unexported fields
}
func NewService ¶
func (Service) DeleteDeployment ¶
func (Service) DeleteInstance ¶
func (Service) DeployDeployment ¶
func (Service) FilestoreBackup ¶
func (Service) FindAllDeployments ¶
func (Service) FindDecryptedDeploymentById ¶
func (Service) FindDecryptedDeploymentInstanceById ¶
func (Service) FindDeploymentById ¶
func (Service) FindDeploymentInstanceById ¶
func (Service) FindDeployments ¶
func (Service) FindPublicInstances ¶
func (s Service) FindPublicInstances(ctx context.Context) ([]GroupWithPublicInstances, error)
func (Service) GetStatus ¶
func (s Service) GetStatus(instance *model.DeploymentInstance) (InstanceStatus, error)
func (Service) Logs ¶
func (s Service) Logs(instance *model.DeploymentInstance, group *model.Group, typeSelector string) (io.ReadCloser, error)