Documentation
¶
Index ¶
- type Backup
- type BackupCreateRequest
- type BackupCreateResponse
- type BackupDeleteRequest
- type BackupDetailResponse
- type BackupDownloadRequest
- type BackupsListRequest
- type BackupsListResponse
- type DownloadPayload
- type Handler
- type Service
- func (s *Service) Create(ctx context.Context, req *BackupCreateRequest) (*BackupCreateResponse, error)
- func (s *Service) Delete(ctx context.Context, req *BackupDeleteRequest) error
- func (s *Service) Download(ctx context.Context, req *BackupDownloadRequest) (*DownloadPayload, error)
- func (s *Service) List(ctx context.Context, req *BackupsListRequest) (*BackupsListResponse, error)
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Backup ¶
type Backup struct {
Id string `json:"id"`
Name string `json:"name"`
Size int64 `json:"size"`
Type string `json:"type"`
Status string `json:"status"`
CreatedAt string `json:"createdAt"`
}
Backup represents a backup
type BackupCreateRequest ¶
type BackupCreateRequest struct {
Name string `json:"name"`
Type string `json:"type"` // full, incremental
}
BackupCreateRequest represents the request to create a backup
type BackupCreateResponse ¶
type BackupCreateResponse struct {
Backup
}
BackupCreateResponse represents the response after creating a backup
type BackupDeleteRequest ¶
type BackupDeleteRequest struct {
ID string `uri:"id"`
}
BackupDeleteRequest represents the request to delete a backup
type BackupDetailResponse ¶
type BackupDetailResponse struct {
Backup
}
BackupDetailResponse represents the response with backup details
type BackupDownloadRequest ¶
type BackupDownloadRequest struct {
ID string `uri:"id"`
}
BackupDownloadRequest represents the request to download a backup
type BackupsListRequest ¶
type BackupsListRequest struct {
Page int `form:"page,optional,default=1"`
PageSize int `form:"pageSize,optional,default=20"`
Type string `form:"type"`
}
BackupsListRequest represents the request to list backups
type BackupsListResponse ¶
type BackupsListResponse struct {
Items []Backup `json:"items"`
Total int64 `json:"total"`
Page int `json:"page"`
Size int `json:"pageSize"`
}
BackupsListResponse represents the response with a list of backups
type DownloadPayload ¶
DownloadPayload represents the download payload for a backup file
type Handler ¶
type Handler struct {
// contains filtered or unexported fields
}
func NewHandler ¶
type Service ¶
type Service struct {
// contains filtered or unexported fields
}
func NewService ¶
func NewService(svcCtx *svc.ServiceContext) *Service
func (*Service) Create ¶
func (s *Service) Create(ctx context.Context, req *BackupCreateRequest) (*BackupCreateResponse, error)
Create creates a new backup
func (*Service) Delete ¶
func (s *Service) Delete(ctx context.Context, req *BackupDeleteRequest) error
Delete deletes a backup
func (*Service) Download ¶
func (s *Service) Download(ctx context.Context, req *BackupDownloadRequest) (*DownloadPayload, error)
Download downloads a backup file
func (*Service) List ¶
func (s *Service) List(ctx context.Context, req *BackupsListRequest) (*BackupsListResponse, error)
List retrieves a paginated list of backups