Documentation
¶
Index ¶
- type Image
- func (h *Image) CreateAlbum(ctx context.Context, req *pb.CreateAlbumReq, resp *pb.CreateAlbumResp) error
- func (h *Image) Delete(ctx context.Context, req *pb.DeleteImageReq, resp *pb.DeleteImageResp) error
- func (h *Image) DeleteAlbum(ctx context.Context, req *pb.DeleteAlbumReq, resp *pb.DeleteAlbumResp) error
- func (h *Image) Download(ctx context.Context, req *pb.DownloadImageReq, stream pb.Image_DownloadStream) error
- func (h *Image) List(ctx context.Context, req *pb.ListImageReq, resp *pb.ListImageResp) error
- func (h *Image) Upload(ctx context.Context, stream pb.Image_UploadStream) error
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.