s3

package
v2.10.2 Latest Latest
Warning

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

Go to latest
Published: Sep 5, 2026 License: BSD-3-Clause Imports: 16 Imported by: 0

Documentation

Overview

Package s3 owns reusable S3-compatible backup destinations and their HTTP surface.

Index

Constants

This section is empty.

Variables

View Source
var (
	ErrS3DestinationNotFound = errors.New("S3 destination not found")
	ErrS3DestinationInUse    = errors.New("S3 destination is in use")
)

Functions

func RegisterS3Destinations

func RegisterS3Destinations(api huma.API, service *S3DestinationService, syncRemoteDestinations func(context.Context) error)

Types

type Dependencies

type Dependencies struct {
	DB                     *database.DB
	SyncRemoteDestinations func(context.Context) error
	CheckRemoteReferences  func(ctx context.Context, destinationID string) error
}

type Module

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

func New

func New(deps Dependencies) *Module

func (*Module) RegisterRoutes

func (m *Module) RegisterRoutes(api huma.API)

func (*Module) Service

func (m *Module) Service() *S3DestinationService

type S3Destination

type S3Destination struct {
	database.BaseModel

	Name            string `json:"name" gorm:"column:name;type:text;not null;uniqueIndex" sortable:"true"`
	Endpoint        string `json:"endpoint,omitempty" gorm:"column:endpoint;type:text" sortable:"true"`
	Bucket          string `json:"bucket" gorm:"column:bucket;type:text;not null" sortable:"true"`
	Region          string `json:"region" gorm:"column:region;type:text;not null" sortable:"true"`
	AccessKeyID     string `json:"accessKeyId" gorm:"column:access_key_id;type:text;not null" sortable:"true"`
	SecretAccessKey string `json:"-" gorm:"column:secret_access_key;type:text;not null"`
	Prefix          string `json:"prefix,omitempty" gorm:"column:prefix;type:text" sortable:"true"`
	UseSSL          bool   `json:"useSsl" gorm:"column:use_ssl;not null" sortable:"true"`
	ForcePathStyle  bool   `json:"forcePathStyle" gorm:"column:force_path_style;not null" sortable:"true"`
}

func (S3Destination) TableName

func (S3Destination) TableName() string

func (S3Destination) ToDTO

func (S3Destination) ToSync

func (d S3Destination) ToSync(secretAccessKey string) backuptypes.S3DestinationSync

type S3DestinationService

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

func NewS3DestinationService

func NewS3DestinationService(db *database.DB) *S3DestinationService

func (*S3DestinationService) Configuration

func (s *S3DestinationService) Configuration(ctx context.Context, id string) (s3config.Configuration, error)

Configuration returns a destination's decrypted runtime configuration for backup domains.

func (*S3DestinationService) CreateS3Destination

func (*S3DestinationService) DeleteS3Destination

func (s *S3DestinationService) DeleteS3Destination(ctx context.Context, id string) error

func (*S3DestinationService) DestinationInUse

func (s *S3DestinationService) DestinationInUse(ctx context.Context, id string) (bool, error)

DestinationInUse reports whether any local backup record or policy references the destination.

func (*S3DestinationService) GetS3Destination

func (s *S3DestinationService) GetS3Destination(ctx context.Context, id string) (*backuptypes.S3Destination, error)

func (*S3DestinationService) ListAllS3Destinations

func (s *S3DestinationService) ListAllS3Destinations(ctx context.Context) ([]backuptypes.S3Destination, error)

func (*S3DestinationService) ListS3Destinations

func (*S3DestinationService) ListS3DestinationsByID added in v2.10.2

func (s *S3DestinationService) ListS3DestinationsByID(ctx context.Context) (map[string]backuptypes.S3Destination, error)

ListS3DestinationsByID indexes destination DTOs for backup metadata lookups.

func (*S3DestinationService) S3DestinationExists

func (s *S3DestinationService) S3DestinationExists(ctx context.Context, id string) bool

func (*S3DestinationService) SyncS3Destinations

func (s *S3DestinationService) SyncS3Destinations(ctx context.Context, destinations []backuptypes.S3DestinationSync) error

SyncS3Destinations replaces an agent's destination cache with the manager-owned destinations.

func (*S3DestinationService) TestS3Destination

func (s *S3DestinationService) TestS3Destination(ctx context.Context, id string, input *backuptypes.UpdateS3Destination) error

func (*S3DestinationService) TestS3DestinationConfiguration

func (s *S3DestinationService) TestS3DestinationConfiguration(ctx context.Context, input backuptypes.CreateS3Destination) error

func (*S3DestinationService) UpdateS3Destination

Jump to

Keyboard shortcuts

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