dependabot[bot] 36b1b7f3fd build(deps): bump golang.org/x/crypto from 0.31.0 to 0.37.0
Bumps [golang.org/x/crypto](https://github.com/golang/crypto) from 0.31.0 to 0.37.0.
- [Commits](https://github.com/golang/crypto/compare/v0.31.0...v0.37.0)

---
updated-dependencies:
- dependency-name: golang.org/x/crypto
  dependency-version: 0.37.0
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
2025-04-07 00:11:17 +00:00
2024-12-07 19:44:57 +01:00
2024-10-23 02:36:04 +02:00
2024-10-23 02:36:04 +02:00
2024-12-07 19:47:07 +01:00

Go Storage

A simple Go storage client

Supported storage:

  • Local
  • S3
  • SSH
  • FTP
  • Azure Blob
go get github.com/jkaninda/go-storage

Local Storage

	localStorage := local.NewStorage(local.Config{
		LocalPath:  tmpPath,
		RemotePath: backupDestination,
	})
	err = localStorage.Copy(finalFileName)
	if err != nil {
		log.Fatal("Error copying file, error %v", err)
	}

S3 Storage

s3Storage, err := s3.NewStorage(s3.Config{
    Endpoint:       "",
    Bucket:         "",
    AccessKey:      "",
    SecretKey:      "",
    Region:         "",
    DisableSsl:     "",
    ForcePathStyle: "",
    RemotePath:     "",
    LocalPath:      "",
})
if err != nil {
    log.Fatalf("Error creating s3 storage: %s", err)
}
// Copy file to S3
err = s3Storage.Copy(finalFileName)
if err != nil {
    log.Fatalf("Error copying file, error %v", err)
}
// Download file from S3
err = s3Storage.CopyFrom(finalFileName)
if err != nil {
    log.Fatalf("Error copying file, error %v", err)
}

SSH Storage

sshStorage, err := ssh.NewStorage(ssh.Config{
		Host:       "",
		Port:       22,
		User:       "",
		Password:   "",
		RemotePath: "",
		LocalPath:  "",
	})
	if err != nil {
        log.Fatalf("Error creating SSH storage: %s", err)
	}
	// Copy file to the remote server
	err = sshStorage.Copy(finalFileName)
	if err != nil {
        log.Fatalf("Error copying backup file: %s", err)
	}
// Download file from SSH remote server
err = sshStorage.CopyFrom(finalFileName)
if err != nil {
log.Fatalf("Error copying file, error %v", err)
}

FTP Storage

	ftpStorage, err := ftp.NewStorage(ftp.Config{
		Host:       "",
		Port:       21,
		User:       "",
		Password:   "",
		RemotePath: "",
		LocalPath:  "",
	})
	if err != nil {
        log.Fatalf("Error creating FTP storage: %s", err)
	}
	err = ftpStorage.Copy(finalFileName)
	if err != nil {
        log.Fatalf("Error copying backup file: %s", err)
	}
// Download file from ftp remote server
err = ftpStorage.CopyFrom(finalFileName)
if err != nil {
log.Fatalf("Error copying file, error %v", err)
}

Azure Blob storage

azureStorage, err := azure.NewStorage(azure.Config{
		ContainerName: '',
		AccountName:   '',
		AccountKey:    '',
		RemotePath:    '',
		LocalPath:     '',
	})
	if err != nil {
		log.Fatal("Error creating Azure Blob storage storage: %s", err)
	}
	err = azureStorage.Copy(finalFileName)
	if err != nil {
		log.Fatal("Error copying file: %s", err)
	}

// Download file from Azure Blob remote server
err = azureStorage.CopyFrom(finalFileName)
if err != nil {
log.Fatalf("Error copying file, error %v", err)
}
Description
Go Storage
Readme MIT 260 KiB
Languages
Go 100%