archive

package
v0.1.1 Latest Latest
Warning

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

Go to latest
Published: Sep 3, 2019 License: MIT Imports: 10 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type AWSConfig

type AWSConfig struct {
	Region                       string `json:"aws_region"`
	AccessKeyID                  string `json:"aws_access_key_id"`
	SecretKey                    string `json:"aws_secret_access_key"`
	Token                        string `json:"aws_token"`
	ExpiredStatDataBucketName    string `json:"aws_expired_stat_data_bucket_name"`
	ExpiredReserveDataBucketName string `json:"aws_expired_reserve_data_bucket_name"`
	LogBucketName                string `json:"aws_log_bucket_name"`
}

func GetAWSconfigFromFile

func GetAWSconfigFromFile(path string) (AWSConfig, error)

type Archive

type Archive interface {
	RemoveFile(bucketName string, destinationFolder string, filePath string) error

	// UploadFile: upload a local file to a remote destination.
	// The local file name should be passed in as full file Path.
	UploadFile(bucketName string, destinationFolder string, filePath string) error

	// CheckFileIntergrity: to ensure that the local file and the upload version is identical.
	CheckFileIntergrity(bucketName string, destinationFolder string, filePath string) (bool, error)

	// GetReserveDataBucketName: return pre-configured remote Bucket to store Reserve Data
	GetReserveDataBucketName() string

	// GetLogBucketName: return pre-configured remote Bucket to store logs
	GetLogBucketName() string
}

Archive is used to store obsolete files.

type S3Archive

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

func NewS3Archive

func NewS3Archive(conf AWSConfig) *S3Archive

func (*S3Archive) CheckFileIntergrity

func (archive *S3Archive) CheckFileIntergrity(bucketName string, awsfolderPath string, filePath string) (bool, error)

func (*S3Archive) GetLogBucketName

func (archive *S3Archive) GetLogBucketName() string

func (*S3Archive) GetReserveDataBucketName

func (archive *S3Archive) GetReserveDataBucketName() string

func (*S3Archive) RemoveFile

func (archive *S3Archive) RemoveFile(bucketName string, awsfolderPath string, filePath string) error

func (*S3Archive) UploadFile

func (archive *S3Archive) UploadFile(bucketName string, awsfolderPath string, filePath string) error

Jump to

Keyboard shortcuts

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