repository

package
v0.7.0 Latest Latest
Warning

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

Go to latest
Published: Nov 10, 2022 License: Apache-2.0 Imports: 2 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type ImageReader

type ImageReader interface {
	ReadChunk([]byte, string) error
}

type PhotoRepository

type PhotoRepository interface {
	// Connect Opens a database connection
	Connect(readOnly bool)
	// Close Closes the database connection
	Close()

	CreateOrReplace(context.Context, model.Photo) error
	Get(ctx context.Context, hash string) (model.Photo, error)
	ReadContent(ctx context.Context, hash string, reader ImageReader) error
	ReadThumbnail(ctx context.Context, hash string, reader ImageReader) error
	SetThumbnail(ctx context.Context, hash string, thumbnail []byte) error
	Exists(ctx context.Context, hash string) bool
	List(ctx context.Context, page int32, pageSize int32) ([]model.Photo, error)
	Delete(ctx context.Context, path string) error
	DeleteAllPhotoInPath(ctx context.Context, path string) error
	DeleteAll(ctx context.Context) error
	CountPhotos(ctx context.Context) (int, error)
}

Jump to

Keyboard shortcuts

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