service

package
v0.0.0-...-7a4e380 Latest Latest
Warning

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

Go to latest
Published: Apr 20, 2024 License: GPL-3.0 Imports: 40 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func CompareChecksum

func CompareChecksum(filename string, checksumRemote string, site *Site) string

CompareChecksum compares local file checksum with S3 ETag value

func FilePathWalkDir

func FilePathWalkDir(site *Site, awsItems map[string]string, uploadCh chan<- UploadCFG, checksumCh chan<- ChecksumCFG)

FilePathWalkDir walks through the directory and all subdirectories returning list of files for upload and list of files to be deleted from S3

func IsExcluded

func IsExcluded(path string, exclusions []string, inclusions []string) bool

IsExcluded check if a path is excluded

func LoggerInitError

func LoggerInitError(err error)

LoggerInitError is a custom error representation

func Start

func Start()

Start function starts the s3sync-service daemon

Types

type ChecksumCFG

type ChecksumCFG struct {
	UploadCFG UploadCFG
	// contains filtered or unexported fields
}

ChecksumCFG - structure for the checksum comparison queue

type Config

type Config struct {
	AccessKey         string        `yaml:"access_key"`
	SecretAccessKey   string        `yaml:"secret_access_key"`
	AwsRegion         string        `yaml:"aws_region"`
	LogLevel          string        `yaml:"loglevel"`
	UploadQueueBuffer int           `yaml:"upload_queue_buffer"`
	UploadWorkers     int           `yaml:"upload_workers"`
	ChecksumWorkers   int           `yaml:"checksum_workers"`
	WatchInterval     time.Duration `yaml:"watch_interval"`
	S3OpsRetries      int           `yaml:"s3_ops_retries"`
	Sites             []Site        `yaml:",flow"`
}

Config structure - contains lst of Site options

type InfoResponse

type InfoResponse struct {
	VERSION         string
	STARTUPTIME     time.Time
	STATUS          string
	SITES           int
	UPLOADWORKERS   int
	CHECKSUMWORKERS int
	LOGLEVEL        string
}

InfoResponse defines info response data

type ReloadHandler

type ReloadHandler struct {
	Chan chan<- bool
}

ReloadHandler defines reload handler

type ReloadResponse

type ReloadResponse struct {
	VERSION     string
	STARTUPTIME time.Time
	STATUS      string
}

ReloadResponse defines info response data

type Site

type Site struct {
	Name            string        `yaml:"name"`
	LocalPath       string        `yaml:"local_path"`
	Bucket          string        `yaml:"bucket"`
	Endpoint        string        `yaml:"endpoint"`
	BucketPath      string        `yaml:"bucket_path"`
	BucketRegion    string        `yaml:"bucket_region"`
	StorageClass    string        `yaml:"storage_class"`
	AccessKey       string        `yaml:"access_key"`
	SecretAccessKey string        `yaml:"secret_access_key"`
	RetireDeleted   bool          `yaml:"retire_deleted"`
	Exclusions      []string      `yaml:",flow"`
	Inclusions      []string      `yaml:",flow"`
	WatchInterval   time.Duration `yaml:"watch_interval"`
	S3OpsRetries    int           `yaml:"s3_ops_retries"`
	// contains filtered or unexported fields
}

Site is a set of options for backing up data to S3

type UploadCFG

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

UploadCFG - structure for the upload queue

Jump to

Keyboard shortcuts

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