sidecar

package
v0.1.29 Latest Latest
Warning

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

Go to latest
Published: Jun 26, 2024 License: Apache-2.0 Imports: 34 Imported by: 1

Documentation

Index

Constants

View Source
const (
	DirName = "hot-backup"
)

Variables

View Source
var (
	ErrEmptyBackupDir     = errors.New("empty backup directory")
	ErrMemberIDOutOfIndex = errors.New("MemberID is out of index for present backup folders")
)

Functions

func CreateArchive

func CreateArchive(w io.Writer, dir, baseDirName string) error

func UploadBackup

func UploadBackup(ctx context.Context, bucket *blob.Bucket, backupsDir, prefix string, memberID int) (string, error)

Types

type Cmd

type Cmd struct {
	HTTPAddress  string `envconfig:"BACKUP_HTTP_ADDRESS"`
	HTTPSAddress string `envconfig:"BACKUP_HTTPS_ADDRESS"`
	CA           string `envconfig:"BACKUP_CA"`
	Cert         string `envconfig:"BACKUP_CERT"`
	Key          string `envconfig:"BACKUP_KEY"`
}

func (*Cmd) Execute

func (p *Cmd) Execute(ctx context.Context, _ *flag.FlagSet, _ ...interface{}) subcommands.ExitStatus

func (*Cmd) Name

func (*Cmd) Name() string

func (*Cmd) SetFlags

func (p *Cmd) SetFlags(f *flag.FlagSet)

func (*Cmd) Synopsis

func (*Cmd) Synopsis() string

func (*Cmd) Usage

func (*Cmd) Usage() string

type DialRequest

type DialRequest struct {
	Endpoints []string `json:"endpoints"`
}

type DialResponse

type DialResponse struct {
	Success       bool     `json:"success"`
	ErrorMessages []string `json:"error_messages"`
}

type DialService added in v0.1.15

type DialService struct{}

type DownloadFileReq added in v0.1.18

type DownloadFileReq struct {
	URL          string       `json:"url"`
	FileName     string       `json:"file_name"`
	DestDir      string       `json:"dest_dir"`
	SecretName   string       `json:"secret_name"`
	DownloadType DownloadType `json:"download_type"`
}

type DownloadType added in v0.1.20

type DownloadType string
const (
	BucketDownload DownloadType = "Buckets"
	URLDownload    DownloadType = "URL"
)

type Req

type Req struct {
	BackupBaseDir string `json:"backup_base_dir"`
	MemberID      int    `json:"member_id"`
}

Req is a backup Service backup method request

type Resp

type Resp struct {
	Backups []string `json:"backups"`
}

Resp is a backup Service backup method response

type Service

type Service struct {
	Mu    sync.RWMutex
	Tasks map[uuid.UUID]*task
}

Service handles requests and keeps track of Tasks

type StatusResp

type StatusResp struct {
	Status    string `json:"status"`
	Message   string `json:"message,omitempty"`
	BackupKey string `json:"backup_key,omitempty"`
}

StatusResp is a backup Service task status response

type UploadReq

type UploadReq struct {
	BucketURL       string `json:"bucket_url"`
	BackupBaseDir   string `json:"backup_base_dir"`
	HazelcastCRName string `json:"hz_cr_name"`
	SecretName      string `json:"secret_name"`
	MemberID        int    `json:"member_id"`
}

UploadReq is a backup Service upload method request

type UploadResp

type UploadResp struct {
	ID uuid.UUID `json:"id"`
}

UploadResp ia a backup Service upload method response

Jump to

Keyboard shortcuts

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