Files
opencloud/thumbnails/pkg/proto/v0/thumbnails.proto
T
2021-02-16 15:44:06 +01:00

68 lines
1.8 KiB
Protocol Buffer

syntax = "proto3";
option go_package = "pkg/proto/v0;proto";
package com.owncloud.ocis.thumbnails.v0;
import "protoc-gen-openapiv2/options/annotations.proto";
option (grpc.gateway.protoc_gen_openapiv2.options.openapiv2_swagger) = {
info: {
title: "ownCloud Infinite Scale thumbnails";
version: "1.0.0";
contact: {
name: "ownCloud GmbH";
url: "https://github.com/owncloud/ocis";
email: "support@owncloud.com";
};
license: {
name: "Apache-2.0";
url: "https://github.com/owncloud/ocis/blob/master/LICENSE";
};
};
schemes: HTTP;
schemes: HTTPS;
consumes: "application/json";
produces: "application/json";
external_docs: {
description: "Developer Manual";
url: "https://owncloud.github.io/extensions/thumbnails/";
};
};
// A Service for handling thumbnail generation
service ThumbnailService {
// Generates the thumbnail and returns it.
rpc GetThumbnail(GetRequest) returns (GetResponse);
}
// A request to retrieve a thumbnail
message GetRequest {
// The path to the source image
string filepath = 1;
// The file types to which the thumbnail cna get encoded to.
enum FileType {
PNG = 0; // Represents PNG type
JPG = 1; // Represents JPG type
}
// The type to which the thumbnail should get encoded to.
FileType filetype = 2;
// The etag of the source image
string etag = 3;
// The width of the thumbnail
int32 width = 4;
// The height of the thumbnail
int32 height = 5;
// The authorization token
string authorization = 6;
// The user requesting the resource.
string username = 7;
}
// The service response
message GetResponse {
// The thumbnail as a binary
bytes thumbnail = 1;
// The mimetype of the thumbnail
string mimetype = 2;
}