mirror

package module
v0.0.0-...-3fa8bca Latest Latest
Warning

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

Go to latest
Published: May 7, 2018 License: MIT Imports: 4 Imported by: 0

README

Mirror

CircleCI codecov

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Extractor

type Extractor interface {
	Extract(ctx context.Context, logctx log.Interface, photos []FileInfo) []LocalPhoto
}

type FileInfo

type FileInfo interface {
	ID() string
	FilePath() string
}

type LocalPhoto

type LocalPhoto interface {
	RemotePhoto
	FilePath() string
	CreatedAt() time.Time
	SetCreatedAt(t time.Time)
	Thumbnail() []byte
	NewJpgReader() (io.ReadCloser, error)
}

type MetadataRepo

type MetadataRepo interface {
	MetadataRepoReader
	MetadataRepoWriter
}

type MetadataRepoReader

type MetadataRepoReader interface {
	GetAll() []RemotePhoto
	Exists(id string) (bool, error)
	GetByDir(name string) ([]RemotePhoto, error)
	GetByDirAndId(dir, id string) (RemotePhoto, error)
	GetDirs() ([]string, error)
	Reload(ctx context.Context) error
}

type MetadataRepoWriter

type MetadataRepoWriter interface {
	Add(item RemotePhoto) error
	Delete(id string) error
	Persist(ctx context.Context) error
}

type ReadOnlyStorage

type ReadOnlyStorage interface {
	StorageReader
	FindFiles(rootPath string, fileExt ...string) []FileInfo
}

type RemotePhoto

type RemotePhoto interface {
	ID() string
	ThumbID() string
	Dir() string
}

type Storage

type Storage interface {
	StorageReader
	StorageWriter
	Exists(ctx context.Context, path string) bool
}

type StorageReader

type StorageReader interface {
	NewReader(ctx context.Context, path string) (io.ReadCloser, error)
}

type StorageWriter

type StorageWriter interface {
	NewWriter(ctx context.Context, path string) io.WriteCloser
	Delete(ctx context.Context, path string) error
}

Directories

Path Synopsis
cmd
mirror-cli command
mirror-web command

Jump to

Keyboard shortcuts

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