Migrate thumbnails proto files and adjust related import paths

This commit is contained in:
Juan Pablo Villafáñez
2022-01-31 09:26:23 +01:00
parent eb78b80f18
commit 04b8ef0fcb
20 changed files with 948 additions and 850 deletions
+5 -1
View File
@@ -13,10 +13,14 @@ plugins:
- paths=source_relative
- name: microweb
path: ../../.bingo/protoc-gen-microweb
#path: ../../.bingo/protoc-gen-microweb
path: ../../../protoc-gen-microweb/protoc-gen-microweb
out: ../gen/
opt:
- paths=source_relative
- "ignore_packages=\
ocis.services.thumbnails.v1;\
ocis.messages.thumbnails.v1"
- name: openapiv2
path: ../../.bingo/protoc-gen-openapiv2
@@ -0,0 +1,23 @@
syntax = "proto3";
package ocis.messages.thumbnails.v1;
option go_package = "github.com/owncloud/ocis/protogen/gen/ocis/messages/thumbnails/v1";
message WebdavSource {
// REQUIRED.
string url = 1;
// REQUIRED.
bool is_public_link = 2;
// OPTIONAL.
string webdav_authorization = 3;
// OPTIONAL.
string reva_authorization = 4;
// OPTIONAL.
string public_link_token = 5;
}
message CS3Source {
string path = 1;
string authorization = 2;
}
@@ -0,0 +1,67 @@
syntax = "proto3";
package ocis.services.thumbnails.v1;
option go_package = "github.com/owncloud/ocis/protogen/gen/ocis/services/thumbnails/v1";
import "ocis/messages/thumbnails/v1/thumbnails.proto";
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.dev/extensions/thumbnails/";
};
};
// A Service for handling thumbnail generation
service ThumbnailService {
// Generates the thumbnail and returns it.
rpc GetThumbnail(GetThumbnailRequest) returns (GetThumbnailResponse);
}
// A request to retrieve a thumbnail
message GetThumbnailRequest {
// The path to the source image
string filepath = 1;
// The file types to which the thumbnail can get encoded to.
enum ThumbnailType {
PNG = 0; // Represents PNG type
JPG = 1; // Represents JPG type
}
// The type to which the thumbnail should get encoded to.
ThumbnailType thumbnail_type = 2;
// The width of the thumbnail
int32 width = 3;
// The height of the thumbnail
int32 height = 4;
oneof source {
ocis.messages.thumbnails.v1.WebdavSource webdav_source = 5;
ocis.messages.thumbnails.v1.CS3Source cs3_source = 6;
}
}
// The service response
message GetThumbnailResponse {
// The thumbnail as a binary
bytes thumbnail = 1;
// The mimetype of the thumbnail
string mimetype = 2;
}