database

package
v0.64.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Feb 16, 2026 License: AGPL-3.0 Imports: 26 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func NewRepository

func NewRepository(db *gorm.DB) *repository

func NewService

func NewService(logger *slog.Logger, s3Bucket string, s3Client S3Client, groupService groupService, repository *repository, podExecutor podExecutorFunc) *service

func Routes

func Routes(router *gin.Engine, authenticator gin.HandlerFunc, handler Handler)

Types

type CopyDatabaseRequest

type CopyDatabaseRequest struct {
	Name  string `json:"name" binding:"required"`
	Group string `json:"group" binding:"required"`
}

type CreateExternalDatabaseRequest

type CreateExternalDatabaseRequest struct {
	// Expiration time in seconds
	Expiration uint `json:"expiration" binding:"required"`
}

type Error

type Error struct {
	// The error message
	//in: body
	Message string
}

swagger:response

type GroupsWithDatabases

type GroupsWithDatabases struct {
	Name      string           `json:"name"`
	Databases []model.Database `json:"databases"`
}

swagger:model GroupsWithDatabases

type Handler

type Handler struct {
	// contains filtered or unexported fields
}

func NewHandler

func NewHandler(logger *slog.Logger, databaseService *service, groupService groupService, instanceService instanceService, stackService stackService) Handler

func (Handler) Copy

func (h Handler) Copy(c *gin.Context)

Copy database

func (Handler) CreateExternalDownload

func (h Handler) CreateExternalDownload(c *gin.Context)

CreateExternalDownload database

func (Handler) Delete

func (h Handler) Delete(c *gin.Context)

Delete database

func (Handler) Download

func (h Handler) Download(c *gin.Context)

Download database

func (Handler) ExternalDownload

func (h Handler) ExternalDownload(c *gin.Context)

ExternalDownload database

func (Handler) FindByIdentifier

func (h Handler) FindByIdentifier(c *gin.Context)

FindByIdentifier database

func (Handler) List

func (h Handler) List(c *gin.Context)

List databases

func (Handler) Lock

func (h Handler) Lock(c *gin.Context)

Lock database

func (Handler) Save

func (h Handler) Save(c *gin.Context)

Save database

func (Handler) SaveAs

func (h Handler) SaveAs(c *gin.Context)

SaveAs database

func (Handler) Unlock

func (h Handler) Unlock(c *gin.Context)

Unlock database

func (Handler) Update

func (h Handler) Update(c *gin.Context)

Update database

func (Handler) Upload

func (h Handler) Upload(c *gin.Context)

Upload database

type LockDatabaseRequest

type LockDatabaseRequest struct {
	InstanceId uint `json:"instanceId" binding:"required"`
}

type PodExecutor added in v0.64.0

type PodExecutor interface {
	Exec(ctx context.Context, namespace, podName, container string, command []string, stdout, stderr io.Writer) error
}

type ReadAtSeeker

type ReadAtSeeker interface {
	io.ReaderAt
	io.ReadSeeker
}

type S3Client

type S3Client interface {
	Copy(bucket string, source string, destination string) error
	Move(bucket string, source string, destination string) error
	Upload(ctx context.Context, bucket string, key string, body storage.ReadAtSeeker, size int64) error
	Delete(bucket string, key string) error
	Download(ctx context.Context, bucket string, key string, dst io.Writer, cb func(contentLength int64)) error
	StreamUpload(ctx context.Context, bucket, key, contentType string, r io.Reader) (int64, error)
}

type UpdateDatabaseRequest

type UpdateDatabaseRequest struct {
	Name        string `json:"name" binding:"required"`
	Description string `json:"description" binding:"required"`
}

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL