Help us shape the future of Go! Take the 2026 Go Developer Survey

s3

package
v2.17.2 Latest Latest
Warning

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

Go to latest
Published: Oct 31, 2026 License: BSD-3-Clause Imports: 20 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))

Types

type Module

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

func New

func New(service *S3DestinationService, syncRemoteDestinations func(context.Context)) *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) backup.S3DestinationSync

type S3DestinationService

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

func NewS3DestinationService

func NewS3DestinationService(db *database.DB, checkRemoteReferences func(context.Context, string) error) *S3DestinationService

func (*S3DestinationService) Configuration

func (s *S3DestinationService) Configuration(ctx context.Context, id string) (s3.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) DestinationsByID added in v2.16.0

func (s *S3DestinationService) DestinationsByID(ctx context.Context) map[string]backup.S3Destination

DestinationsByID indexes destinations to decorate backup records, such as with their names. Decoration never fails its caller, so a failed listing yields an empty index.

func (*S3DestinationService) GetS3Destination

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

func (*S3DestinationService) ListAllS3Destinations

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

func (*S3DestinationService) ListS3Destinations

func (*S3DestinationService) S3DestinationExists

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

func (*S3DestinationService) SyncS3Destinations

func (s *S3DestinationService) SyncS3Destinations(ctx context.Context, destinations []backup.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 *backup.UpdateS3Destination) error

func (*S3DestinationService) TestS3DestinationConfiguration

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

func (*S3DestinationService) UpdateS3Destination

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

Jump to

Keyboard shortcuts

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