infra_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: 15 Imported by: 0

Documentation

Index

Constants

View Source
const BufferSize = 1024 * 1024 * 2

Variables

This section is empty.

Functions

This section is empty.

Types

type PhotoDBRepository

type PhotoDBRepository struct {
	repository.PhotoRepository
	// contains filtered or unexported fields
}

func New

func New(localDb bool, photosPath string) *PhotoDBRepository

func (*PhotoDBRepository) Close

func (r *PhotoDBRepository) Close()

func (*PhotoDBRepository) Connect

func (r *PhotoDBRepository) Connect(readOnly bool)

func (*PhotoDBRepository) CountPhotos added in v0.6.0

func (r *PhotoDBRepository) CountPhotos(ctx context.Context) (int, error)

func (*PhotoDBRepository) CreateOrReplace

func (r *PhotoDBRepository) CreateOrReplace(ctx context.Context, photo model.Photo) error

func (*PhotoDBRepository) Delete added in v0.6.0

func (r *PhotoDBRepository) Delete(ctx context.Context, path string) error

func (*PhotoDBRepository) DeleteAll added in v0.6.0

func (r *PhotoDBRepository) DeleteAll(ctx context.Context) error

func (*PhotoDBRepository) DeleteAllPhotoInPath added in v0.6.0

func (r *PhotoDBRepository) DeleteAllPhotoInPath(ctx context.Context, path string) error

func (*PhotoDBRepository) Exists

func (r *PhotoDBRepository) Exists(ctx context.Context, hash string) bool

func (*PhotoDBRepository) Get

func (r *PhotoDBRepository) Get(ctx context.Context, hash string) (model.Photo, error)

func (*PhotoDBRepository) List

func (r *PhotoDBRepository) List(ctx context.Context, page int32, pageSize int32) ([]model.Photo, error)

func (*PhotoDBRepository) ReadContent

func (r *PhotoDBRepository) ReadContent(ctx context.Context, hash string, reader repository.ImageReader) error

func (*PhotoDBRepository) ReadThumbnail added in v0.7.0

func (r *PhotoDBRepository) ReadThumbnail(ctx context.Context, hash string, reader repository.ImageReader) error

func (*PhotoDBRepository) SetThumbnail added in v0.7.0

func (r *PhotoDBRepository) SetThumbnail(ctx context.Context, hash string, thumbnail []byte) error

Jump to

Keyboard shortcuts

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