1
0
Fork 0
mirror of https://github.com/anyproto/anytype-heart.git synced 2025-06-10 01:51:07 +09:00
anytype-heart/pb/protos/file.proto
requilence 3d15ad4bf7
refactor protobuf
put proto in dif files by types
use clear methots with struct input outputs
use custom protoc plugin to create bindings
2019-10-19 18:24:23 +03:00

103 lines
1.6 KiB
Protocol Buffer

syntax="proto3";
package anytype;
option go_package = "pb";
enum ImageSize {
LARGE = 0;
SMALL = 1;
THUMB = 2;
}
message Image {
string id = 1;
repeated ImageSize sizes = 2;
}
enum VideoSize {
SD_360p = 0;
SD_480p = 1;
HD_720p = 2;
HD_1080p = 3;
UHD_1440p = 4;
UHD_2160p = 5;
}
message Video {
string id = 1;
repeated VideoSize sizes = 2;
}
message IpfsGetFileRequest {
string id = 1;
}
message IpfsGetFileResponse {
Error error = 1;
bytes data = 2;
string media = 3;
string name = 4;
message Error {
Code code = 1;
string description = 2;
enum Code {
NULL = 0;
UNKNOWN_ERROR = 1;
BAD_INPUT = 2;
// ...
NOT_FOUND = 101;
TIMEOUT = 102;
}
}
}
message ImageGetBlobRequest {
string id = 1;
ImageSize size = 2;
}
message ImageGetBlobResponse {
Error error = 1;
bytes blob = 2;
message Error {
Code code = 1;
string description = 2;
enum Code {
NULL = 0;
UNKNOWN_ERROR = 1;
BAD_INPUT = 2;
// ...
NOT_FOUND = 101;
TIMEOUT = 102;
}
}
}
message ImageGetFileRequest {
string id = 1;
ImageSize size = 2;
}
message ImageGetFileResponse {
Error error = 1;
string localPath = 2;
message Error {
Code code = 1;
string description = 2;
enum Code {
NULL = 0;
UNKNOWN_ERROR = 1;
BAD_INPUT = 2;
// ...
NOT_FOUND = 101;
TIMEOUT = 102;
}
}
}