Documentation
¶
Overview ¶
Package s3 owns reusable S3-compatible backup destinations and their HTTP surface.
Index ¶
- Variables
- func RegisterS3Destinations(api huma.API, service *S3DestinationService, ...)
- type Dependencies
- type Module
- type S3Destination
- type S3DestinationService
- func (s *S3DestinationService) Configuration(ctx context.Context, id string) (s3config.Configuration, error)
- func (s *S3DestinationService) CreateS3Destination(ctx context.Context, input backuptypes.CreateS3Destination) (*backuptypes.S3Destination, error)
- func (s *S3DestinationService) DeleteS3Destination(ctx context.Context, id string) error
- func (s *S3DestinationService) DestinationInUse(ctx context.Context, id string) (bool, error)
- func (s *S3DestinationService) GetS3Destination(ctx context.Context, id string) (*backuptypes.S3Destination, error)
- func (s *S3DestinationService) ListAllS3Destinations(ctx context.Context) ([]backuptypes.S3Destination, error)
- func (s *S3DestinationService) ListS3Destinations(ctx context.Context, params pagination.QueryParams) ([]backuptypes.S3Destination, pagination.Response, error)
- func (s *S3DestinationService) ListS3DestinationsByID(ctx context.Context) (map[string]backuptypes.S3Destination, error)
- func (s *S3DestinationService) S3DestinationExists(ctx context.Context, id string) bool
- func (s *S3DestinationService) SyncS3Destinations(ctx context.Context, destinations []backuptypes.S3DestinationSync) error
- func (s *S3DestinationService) TestS3Destination(ctx context.Context, id string, input *backuptypes.UpdateS3Destination) error
- func (s *S3DestinationService) TestS3DestinationConfiguration(ctx context.Context, input backuptypes.CreateS3Destination) error
- func (s *S3DestinationService) UpdateS3Destination(ctx context.Context, id string, input backuptypes.UpdateS3Destination) (*backuptypes.S3Destination, error)
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 ¶
Types ¶
type Dependencies ¶
type Module ¶
type Module struct {
// contains filtered or unexported fields
}
func New ¶
func New(deps Dependencies) *Module
func (*Module) RegisterRoutes ¶
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 (d S3Destination) ToDTO() backuptypes.S3Destination
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 (s *S3DestinationService) CreateS3Destination(ctx context.Context, input backuptypes.CreateS3Destination) (*backuptypes.S3Destination, error)
func (*S3DestinationService) DeleteS3Destination ¶
func (s *S3DestinationService) DeleteS3Destination(ctx context.Context, id string) error
func (*S3DestinationService) DestinationInUse ¶
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 (s *S3DestinationService) ListS3Destinations(ctx context.Context, params pagination.QueryParams) ([]backuptypes.S3Destination, pagination.Response, error)
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 ¶
func (s *S3DestinationService) UpdateS3Destination(ctx context.Context, id string, input backuptypes.UpdateS3Destination) (*backuptypes.S3Destination, error)
Click to show internal directories.
Click to hide internal directories.