handler

package
v0.0.0-...-834d4d8 Latest Latest
Warning

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

Go to latest
Published: Aug 9, 2019 License: Apache-2.0 Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Image

type Image struct {
	// Blob is blob-srv client
	Blob blob.BlobService
}

Image implements image service handler

func (*Image) CreateAlbum

func (h *Image) CreateAlbum(ctx context.Context, req *pb.CreateAlbumReq, resp *pb.CreateAlbumResp) error

CreateAlbum creates new image album and returns it. It calls blob-srv which handles the low level filesystem operations. It returns error if the blob-srv fails to allocate dedicated filesystem for the album.

func (*Image) Delete

func (h *Image) Delete(ctx context.Context, req *pb.DeleteImageReq, resp *pb.DeleteImageResp) error

Delete deletes the image from the given album It relies on blob-srv to delete the image from the physical storage. It returns error if the image failed to be removed.

func (*Image) DeleteAlbum

func (h *Image) DeleteAlbum(ctx context.Context, req *pb.DeleteAlbumReq, resp *pb.DeleteAlbumResp) error

DeleteAlbum deletes image album. It calls blob-srv to delete the album from the physical storage. It returns error if the album failed to be removed from storage.

func (*Image) Download

func (h *Image) Download(ctx context.Context, req *pb.DownloadImageReq, stream pb.Image_DownloadStream) error

Download uploads image from server image album. It relies on blob-srv to retrieve the image from remote filesystem. It returns error if the image failed to be retrieved from blob-srv.

func (*Image) List

func (h *Image) List(ctx context.Context, req *pb.ListImageReq, resp *pb.ListImageResp) error

List lists images in given album. It returns error if the images failed to be listed.

func (*Image) Upload

func (h *Image) Upload(ctx context.Context, stream pb.Image_UploadStream) error

Upload uploads image to remote server image album. It relies on blob-srv to store the image. It returns error if the image failed to be stored by blob-srv.

Jump to

Keyboard shortcuts

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