storage

package
v0.0.0-...-aeab57e Latest Latest
Warning

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

Go to latest
Published: Jun 19, 2020 License: MIT Imports: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type ImageStorage

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

ImageStorage encapsulates access to cloud and db It stores resize results transparently for user

func (*ImageStorage) GetRecordByID

func (is *ImageStorage) GetRecordByID(ctx context.Context, id string) (*resize.Image, error)

GetRecordByID acquires records of image resize process by ID

func (*ImageStorage) ListUserRecords

func (is *ImageStorage) ListUserRecords(ctx context.Context) ([]*model.ResizeResult, error)

ListUserRecords shows list of resizes that are done by current user

func (*ImageStorage) RecordResizeResult

func (is *ImageStorage) RecordResizeResult(ctx context.Context, resizeResult resize.Result) (*model.ResizeResult, error)

RecordResizeResult loads resized images to cloud and creates record about this operation in database

type Storage

type Storage interface {
	RecordResizeResult(ctx context.Context, resizeResult resize.Result) (*model.ResizeResult, error)
	GetRecordByID(ctx context.Context, id string) (*resize.Image, error)
	ListUserRecords(ctx context.Context) ([]*model.ResizeResult, error)
}

Storage encapsulates interaction of GraphQL with cloud with images and DB with resize records

func New

func New() (Storage, error)

New creates new instance of ImageStorage

Directories

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

Jump to

Keyboard shortcuts

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