oshub

package
v0.0.0-...-3d1052a Latest Latest
Warning

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

Go to latest
Published: May 24, 2021 License: Apache-2.0 Imports: 21 Imported by: 0

Documentation

Index

Constants

View Source
const (
	FilesToCheckMaxNumb int = 500
)

Variables

This section is empty.

Functions

func Bucket

func Bucket() string

func Check

func Check(fileQueue <-chan *RepoFile, objectPrefix string, l echo.Logger) <-chan *RepoFile

func CheckRepoHandler

func CheckRepoHandler() echo.HandlerFunc

func Filter

func Filter(fileQueue <-chan *RepoFile, filterPrefix []string) (<-chan *RepoFile, <-chan uint32)

func InitHandler

func InitHandler(repo string, e *echo.Echo)

func InitUploader

func InitUploader(bucket string, workerNumb int, opts ...StorageFactory)

func RegenerateSummary

func RegenerateSummary(objectPrefix string) error

func Sync

func Sync(objectQueue <-chan *RepoFile, objectPrefix string, srcDir string, l echo.Logger) <-chan *uploadStatus

func Untar

func Untar(tarReader *tar.Reader, dstDir string, l echo.Logger) <-chan *RepoFile

func UpdateSummary

func UpdateSummary() echo.HandlerFunc

func UploadRepoHandler

func UploadRepoHandler() echo.HandlerFunc

Types

type RepoCtx

type RepoCtx struct {
	Dir     string
	Factory string
	Prefix  string
}

func RepoBaseHandler

func RepoBaseHandler(c echo.Context) (*RepoCtx, error)

type RepoFile

type RepoFile struct {
	Path  string
	CRC32 uint32
}

type SendReport

type SendReport struct {
	FileNumb uint
	ObjNumb  uint
	Bytes    int64
}

type StorageFactory

type StorageFactory func(ctx context.Context) (*gcs.Client, error)

type SyncReport

type SyncReport struct {
	UploadedFileNumb     uint32 `json:"uploaded"`
	SyncedFileNumb       uint32 `json:"synced"`
	UploadSyncedFileNumb uint32 `json:"upload_synced"`
	SyncFailedNumb       uint32 `json:"sync_failed"`
}

func Wait

func Wait(reportQueue <-chan uint32, statusQueue <-chan *uploadStatus) *SyncReport

Jump to

Keyboard shortcuts

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