uploaders

package
v0.1.0 Latest Latest
Warning

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

Go to latest
Published: Jun 21, 2024 License: MIT Imports: 23 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func GetZipPath

func GetZipPath(repoName string) (string, error)

func ZipFolder

func ZipFolder(sourcePath, zipPath string) error

Types

type GoogleDriveDeviceCodeResponse

type GoogleDriveDeviceCodeResponse struct {
	DeviceCode      string `json:"device_code"`
	UserCode        string `json:"user_code"`
	VerificationURL string `json:"verification_url"`
	ExpiresIn       int    `json:"expires_in"`
	Interval        int    `json:"interval"`
}

type GoogleIDToken

type GoogleIDToken struct {
	Email string `json:"email"`
}

type GoogleTokenResponse

type GoogleTokenResponse struct {
	Error        string `json:"error"`
	AccessToken  string `json:"access_token"`
	TokenType    string `json:"token_type"`
	ExpiresIn    int    `json:"expires_in"`
	RefreshToken string `json:"refresh_token"`
	IDToken      string `json:"id_token"`

	// Not part of the response
	RefreshedAt time.Time `json:"obtained_at"`
}

type Uploader

type Uploader interface {
	Type() string
	// Returns the name of the uploader to be displayed
	Name() string
	// Returns whether the uploader is enabled
	Enabled() bool
	// Checks that the uploader is properly configured and can connect to the remote service; this includes authentication
	Connect() error
	// Basically returns the top level gh_backup_info.json file
	GetPreviousBackupTimes() (map[string]time.Time, error)
	// Push the backup to the remote service
	Push(changedRepos []string, infoFile map[string]time.Time) error
}

type UploaderGoogleDrive

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

func NewUploaderGoogleDrive

func NewUploaderGoogleDrive(settings *config.BackupMethod) *UploaderGoogleDrive

func (*UploaderGoogleDrive) Connect

func (u *UploaderGoogleDrive) Connect() error

func (*UploaderGoogleDrive) Enabled

func (u *UploaderGoogleDrive) Enabled() bool

func (*UploaderGoogleDrive) GetPreviousBackupTimes

func (u *UploaderGoogleDrive) GetPreviousBackupTimes() (res map[string]time.Time, err error)

func (*UploaderGoogleDrive) Name

func (u *UploaderGoogleDrive) Name() string

func (*UploaderGoogleDrive) Push

func (u *UploaderGoogleDrive) Push(changedRepos []string, infoFile map[string]time.Time) (err error)

func (*UploaderGoogleDrive) Type

func (u *UploaderGoogleDrive) Type() string

type UploaderLocalFolders

type UploaderLocalFolders struct {
	FolderPath string
	// contains filtered or unexported fields
}

func NewUploaderLocalFolders

func NewUploaderLocalFolders(settings *config.BackupMethod) *UploaderLocalFolders

func (*UploaderLocalFolders) Connect

func (u *UploaderLocalFolders) Connect() error

func (*UploaderLocalFolders) Enabled

func (u *UploaderLocalFolders) Enabled() bool

func (*UploaderLocalFolders) GetPreviousBackupTimes

func (u *UploaderLocalFolders) GetPreviousBackupTimes() (res map[string]time.Time, err error)

func (*UploaderLocalFolders) Name

func (u *UploaderLocalFolders) Name() string

func (*UploaderLocalFolders) Push

func (u *UploaderLocalFolders) Push(changedRepos []string, infoFile map[string]time.Time) (err error)

func (*UploaderLocalFolders) Type

func (u *UploaderLocalFolders) Type() string

Jump to

Keyboard shortcuts

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