syncer

package
v0.1.2 Latest Latest
Warning

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

Go to latest
Published: Feb 19, 2022 License: Apache-2.0 Imports: 16 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Archiver

type Archiver interface {
	Do(ctx context.Context, root string, w io.Writer) error
}

func NewArchiver

func NewArchiver() Archiver

type Client

type Client struct {
	LocalStorage LocalStorage
	Repository   Repository
	Archiver     Archiver
	Dryrun       bool
	Concurrency  int
}

func (*Client) Run

func (c *Client) Run(ctx context.Context, in *ClientRunInput) error

type ClientRunInput

type ClientRunInput struct {
	Path  string
	Depth int
}

type LocalObject

type LocalObject struct {
	Key              string
	LastModifiedUnix int64
}

type LocalStorage

type LocalStorage interface {
	List(ctx context.Context, path string, depth int) ([]LocalObject, error)
}

func NewLocalStorage

func NewLocalStorage() LocalStorage

type NewRepositoryS3Input

type NewRepositoryS3Input struct {
	Bucket   string
	Prefix   string
	API      s3iface.S3API
	Uploader s3manageriface.UploaderAPI
}

type Repository

type Repository interface {
	List(ctx context.Context) ([]RepositoryObject, error)
	Upload(ctx context.Context, key string, r io.Reader) error
	Delete(ctx context.Context, keys []string) error
}

func NewRepositoryS3

func NewRepositoryS3(in *NewRepositoryS3Input) Repository

type RepositoryObject

type RepositoryObject struct {
	Key              string
	LastModifiedUnix int64
}

type RepositoryS3

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

func (*RepositoryS3) Delete

func (s *RepositoryS3) Delete(ctx context.Context, keys []string) error

func (*RepositoryS3) List

func (*RepositoryS3) Upload

func (s *RepositoryS3) Upload(ctx context.Context, key string, r io.Reader) error

Directories

Path Synopsis
Package syncermock is a generated GoMock package.
Package syncermock is a generated GoMock package.

Jump to

Keyboard shortcuts

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