add conversion phase & progress metrics, timeout heuristics
This commit is contained in:
@@ -78,6 +78,65 @@ func (ConversionStatus) EnumDescriptor() ([]byte, []int) {
|
||||
return file_officeconvertapi_v1_conversion_proto_rawDescGZIP(), []int{0}
|
||||
}
|
||||
|
||||
// ConversionPhase represents the active stage for a running conversion.
|
||||
type ConversionPhase int32
|
||||
|
||||
const (
|
||||
ConversionPhase_CONVERSION_PHASE_UNSPECIFIED ConversionPhase = 0
|
||||
ConversionPhase_CONVERSION_PHASE_INACTIVE ConversionPhase = 1
|
||||
ConversionPhase_CONVERSION_PHASE_EXTRACTING_NOTES ConversionPhase = 2
|
||||
ConversionPhase_CONVERSION_PHASE_PPTX_TO_PDF ConversionPhase = 3
|
||||
ConversionPhase_CONVERSION_PHASE_PDF_TO_IMAGES ConversionPhase = 4
|
||||
ConversionPhase_CONVERSION_PHASE_UPLOADING_RESULTS ConversionPhase = 5
|
||||
)
|
||||
|
||||
// Enum value maps for ConversionPhase.
|
||||
var (
|
||||
ConversionPhase_name = map[int32]string{
|
||||
0: "CONVERSION_PHASE_UNSPECIFIED",
|
||||
1: "CONVERSION_PHASE_INACTIVE",
|
||||
2: "CONVERSION_PHASE_EXTRACTING_NOTES",
|
||||
3: "CONVERSION_PHASE_PPTX_TO_PDF",
|
||||
4: "CONVERSION_PHASE_PDF_TO_IMAGES",
|
||||
5: "CONVERSION_PHASE_UPLOADING_RESULTS",
|
||||
}
|
||||
ConversionPhase_value = map[string]int32{
|
||||
"CONVERSION_PHASE_UNSPECIFIED": 0,
|
||||
"CONVERSION_PHASE_INACTIVE": 1,
|
||||
"CONVERSION_PHASE_EXTRACTING_NOTES": 2,
|
||||
"CONVERSION_PHASE_PPTX_TO_PDF": 3,
|
||||
"CONVERSION_PHASE_PDF_TO_IMAGES": 4,
|
||||
"CONVERSION_PHASE_UPLOADING_RESULTS": 5,
|
||||
}
|
||||
)
|
||||
|
||||
func (x ConversionPhase) Enum() *ConversionPhase {
|
||||
p := new(ConversionPhase)
|
||||
*p = x
|
||||
return p
|
||||
}
|
||||
|
||||
func (x ConversionPhase) String() string {
|
||||
return protoimpl.X.EnumStringOf(x.Descriptor(), protoreflect.EnumNumber(x))
|
||||
}
|
||||
|
||||
func (ConversionPhase) Descriptor() protoreflect.EnumDescriptor {
|
||||
return file_officeconvertapi_v1_conversion_proto_enumTypes[1].Descriptor()
|
||||
}
|
||||
|
||||
func (ConversionPhase) Type() protoreflect.EnumType {
|
||||
return &file_officeconvertapi_v1_conversion_proto_enumTypes[1]
|
||||
}
|
||||
|
||||
func (x ConversionPhase) Number() protoreflect.EnumNumber {
|
||||
return protoreflect.EnumNumber(x)
|
||||
}
|
||||
|
||||
// Deprecated: Use ConversionPhase.Descriptor instead.
|
||||
func (ConversionPhase) EnumDescriptor() ([]byte, []int) {
|
||||
return file_officeconvertapi_v1_conversion_proto_rawDescGZIP(), []int{1}
|
||||
}
|
||||
|
||||
// Slide contains extracted notes and the rendered image URL for one slide.
|
||||
type Slide struct {
|
||||
state protoimpl.MessageState `protogen:"open.v1"`
|
||||
@@ -475,13 +534,16 @@ func (x *GetConversionStatusRequest) GetConversionId() string {
|
||||
|
||||
// GetConversionStatusResponse returns current status and optional error info.
|
||||
type GetConversionStatusResponse struct {
|
||||
state protoimpl.MessageState `protogen:"open.v1"`
|
||||
ConversionId string `protobuf:"bytes,1,opt,name=conversion_id,json=conversionId,proto3" json:"conversion_id,omitempty"`
|
||||
Status ConversionStatus `protobuf:"varint,2,opt,name=status,proto3,enum=officeconvertapi.v1.ConversionStatus" json:"status,omitempty"`
|
||||
ErrorMessage string `protobuf:"bytes,3,opt,name=error_message,json=errorMessage,proto3" json:"error_message,omitempty"`
|
||||
UpdatedAt *timestamppb.Timestamp `protobuf:"bytes,4,opt,name=updated_at,json=updatedAt,proto3" json:"updated_at,omitempty"`
|
||||
unknownFields protoimpl.UnknownFields
|
||||
sizeCache protoimpl.SizeCache
|
||||
state protoimpl.MessageState `protogen:"open.v1"`
|
||||
ConversionId string `protobuf:"bytes,1,opt,name=conversion_id,json=conversionId,proto3" json:"conversion_id,omitempty"`
|
||||
Status ConversionStatus `protobuf:"varint,2,opt,name=status,proto3,enum=officeconvertapi.v1.ConversionStatus" json:"status,omitempty"`
|
||||
ErrorMessage string `protobuf:"bytes,3,opt,name=error_message,json=errorMessage,proto3" json:"error_message,omitempty"`
|
||||
UpdatedAt *timestamppb.Timestamp `protobuf:"bytes,4,opt,name=updated_at,json=updatedAt,proto3" json:"updated_at,omitempty"`
|
||||
Phase ConversionPhase `protobuf:"varint,5,opt,name=phase,proto3,enum=officeconvertapi.v1.ConversionPhase" json:"phase,omitempty"`
|
||||
CurrentProgress int32 `protobuf:"varint,6,opt,name=current_progress,json=currentProgress,proto3" json:"current_progress,omitempty"`
|
||||
MaxProgress int32 `protobuf:"varint,7,opt,name=max_progress,json=maxProgress,proto3" json:"max_progress,omitempty"`
|
||||
unknownFields protoimpl.UnknownFields
|
||||
sizeCache protoimpl.SizeCache
|
||||
}
|
||||
|
||||
func (x *GetConversionStatusResponse) Reset() {
|
||||
@@ -542,6 +604,27 @@ func (x *GetConversionStatusResponse) GetUpdatedAt() *timestamppb.Timestamp {
|
||||
return nil
|
||||
}
|
||||
|
||||
func (x *GetConversionStatusResponse) GetPhase() ConversionPhase {
|
||||
if x != nil {
|
||||
return x.Phase
|
||||
}
|
||||
return ConversionPhase_CONVERSION_PHASE_UNSPECIFIED
|
||||
}
|
||||
|
||||
func (x *GetConversionStatusResponse) GetCurrentProgress() int32 {
|
||||
if x != nil {
|
||||
return x.CurrentProgress
|
||||
}
|
||||
return 0
|
||||
}
|
||||
|
||||
func (x *GetConversionStatusResponse) GetMaxProgress() int32 {
|
||||
if x != nil {
|
||||
return x.MaxProgress
|
||||
}
|
||||
return 0
|
||||
}
|
||||
|
||||
// GetSlideDeckRequest fetches a completed deck.
|
||||
type GetSlideDeckRequest struct {
|
||||
state protoimpl.MessageState `protogen:"open.v1"`
|
||||
@@ -762,13 +845,16 @@ const file_officeconvertapi_v1_conversion_proto_rawDesc = "" +
|
||||
"\rconversion_id\x18\x01 \x01(\tR\fconversionId\x12=\n" +
|
||||
"\x06status\x18\x02 \x01(\x0e2%.officeconvertapi.v1.ConversionStatusR\x06status\"A\n" +
|
||||
"\x1aGetConversionStatusRequest\x12#\n" +
|
||||
"\rconversion_id\x18\x01 \x01(\tR\fconversionId\"\xe1\x01\n" +
|
||||
"\rconversion_id\x18\x01 \x01(\tR\fconversionId\"\xeb\x02\n" +
|
||||
"\x1bGetConversionStatusResponse\x12#\n" +
|
||||
"\rconversion_id\x18\x01 \x01(\tR\fconversionId\x12=\n" +
|
||||
"\x06status\x18\x02 \x01(\x0e2%.officeconvertapi.v1.ConversionStatusR\x06status\x12#\n" +
|
||||
"\rerror_message\x18\x03 \x01(\tR\ferrorMessage\x129\n" +
|
||||
"\n" +
|
||||
"updated_at\x18\x04 \x01(\v2\x1a.google.protobuf.TimestampR\tupdatedAt\":\n" +
|
||||
"updated_at\x18\x04 \x01(\v2\x1a.google.protobuf.TimestampR\tupdatedAt\x12:\n" +
|
||||
"\x05phase\x18\x05 \x01(\x0e2$.officeconvertapi.v1.ConversionPhaseR\x05phase\x12)\n" +
|
||||
"\x10current_progress\x18\x06 \x01(\x05R\x0fcurrentProgress\x12!\n" +
|
||||
"\fmax_progress\x18\a \x01(\x05R\vmaxProgress\":\n" +
|
||||
"\x13GetSlideDeckRequest\x12#\n" +
|
||||
"\rconversion_id\x18\x01 \x01(\tR\fconversionId\"U\n" +
|
||||
"\x14GetSlideDeckResponse\x12=\n" +
|
||||
@@ -784,7 +870,14 @@ const file_officeconvertapi_v1_conversion_proto_rawDesc = "" +
|
||||
"\x19CONVERSION_STATUS_PENDING\x10\x01\x12\x1d\n" +
|
||||
"\x19CONVERSION_STATUS_RUNNING\x10\x02\x12\x1f\n" +
|
||||
"\x1bCONVERSION_STATUS_SUCCEEDED\x10\x03\x12\x1c\n" +
|
||||
"\x18CONVERSION_STATUS_FAILED\x10\x042\xcc\x04\n" +
|
||||
"\x18CONVERSION_STATUS_FAILED\x10\x04*\xe7\x01\n" +
|
||||
"\x0fConversionPhase\x12 \n" +
|
||||
"\x1cCONVERSION_PHASE_UNSPECIFIED\x10\x00\x12\x1d\n" +
|
||||
"\x19CONVERSION_PHASE_INACTIVE\x10\x01\x12%\n" +
|
||||
"!CONVERSION_PHASE_EXTRACTING_NOTES\x10\x02\x12 \n" +
|
||||
"\x1cCONVERSION_PHASE_PPTX_TO_PDF\x10\x03\x12\"\n" +
|
||||
"\x1eCONVERSION_PHASE_PDF_TO_IMAGES\x10\x04\x12&\n" +
|
||||
"\"CONVERSION_PHASE_UPLOADING_RESULTS\x10\x052\xcc\x04\n" +
|
||||
"\x11ConversionService\x12q\n" +
|
||||
"\x10CreateConversion\x12,.officeconvertapi.v1.CreateConversionRequest\x1a-.officeconvertapi.v1.CreateConversionResponse\"\x00\x12n\n" +
|
||||
"\x0fStartConversion\x12+.officeconvertapi.v1.StartConversionRequest\x1a,.officeconvertapi.v1.StartConversionResponse\"\x00\x12z\n" +
|
||||
@@ -804,47 +897,49 @@ func file_officeconvertapi_v1_conversion_proto_rawDescGZIP() []byte {
|
||||
return file_officeconvertapi_v1_conversion_proto_rawDescData
|
||||
}
|
||||
|
||||
var file_officeconvertapi_v1_conversion_proto_enumTypes = make([]protoimpl.EnumInfo, 1)
|
||||
var file_officeconvertapi_v1_conversion_proto_enumTypes = make([]protoimpl.EnumInfo, 2)
|
||||
var file_officeconvertapi_v1_conversion_proto_msgTypes = make([]protoimpl.MessageInfo, 12)
|
||||
var file_officeconvertapi_v1_conversion_proto_goTypes = []any{
|
||||
(ConversionStatus)(0), // 0: officeconvertapi.v1.ConversionStatus
|
||||
(*Slide)(nil), // 1: officeconvertapi.v1.Slide
|
||||
(*SlideDeck)(nil), // 2: officeconvertapi.v1.SlideDeck
|
||||
(*CreateConversionRequest)(nil), // 3: officeconvertapi.v1.CreateConversionRequest
|
||||
(*CreateConversionResponse)(nil), // 4: officeconvertapi.v1.CreateConversionResponse
|
||||
(*StartConversionRequest)(nil), // 5: officeconvertapi.v1.StartConversionRequest
|
||||
(*StartConversionResponse)(nil), // 6: officeconvertapi.v1.StartConversionResponse
|
||||
(*GetConversionStatusRequest)(nil), // 7: officeconvertapi.v1.GetConversionStatusRequest
|
||||
(*GetConversionStatusResponse)(nil), // 8: officeconvertapi.v1.GetConversionStatusResponse
|
||||
(*GetSlideDeckRequest)(nil), // 9: officeconvertapi.v1.GetSlideDeckRequest
|
||||
(*GetSlideDeckResponse)(nil), // 10: officeconvertapi.v1.GetSlideDeckResponse
|
||||
(*DeleteConversionRequest)(nil), // 11: officeconvertapi.v1.DeleteConversionRequest
|
||||
(*DeleteConversionResponse)(nil), // 12: officeconvertapi.v1.DeleteConversionResponse
|
||||
(*timestamppb.Timestamp)(nil), // 13: google.protobuf.Timestamp
|
||||
(ConversionPhase)(0), // 1: officeconvertapi.v1.ConversionPhase
|
||||
(*Slide)(nil), // 2: officeconvertapi.v1.Slide
|
||||
(*SlideDeck)(nil), // 3: officeconvertapi.v1.SlideDeck
|
||||
(*CreateConversionRequest)(nil), // 4: officeconvertapi.v1.CreateConversionRequest
|
||||
(*CreateConversionResponse)(nil), // 5: officeconvertapi.v1.CreateConversionResponse
|
||||
(*StartConversionRequest)(nil), // 6: officeconvertapi.v1.StartConversionRequest
|
||||
(*StartConversionResponse)(nil), // 7: officeconvertapi.v1.StartConversionResponse
|
||||
(*GetConversionStatusRequest)(nil), // 8: officeconvertapi.v1.GetConversionStatusRequest
|
||||
(*GetConversionStatusResponse)(nil), // 9: officeconvertapi.v1.GetConversionStatusResponse
|
||||
(*GetSlideDeckRequest)(nil), // 10: officeconvertapi.v1.GetSlideDeckRequest
|
||||
(*GetSlideDeckResponse)(nil), // 11: officeconvertapi.v1.GetSlideDeckResponse
|
||||
(*DeleteConversionRequest)(nil), // 12: officeconvertapi.v1.DeleteConversionRequest
|
||||
(*DeleteConversionResponse)(nil), // 13: officeconvertapi.v1.DeleteConversionResponse
|
||||
(*timestamppb.Timestamp)(nil), // 14: google.protobuf.Timestamp
|
||||
}
|
||||
var file_officeconvertapi_v1_conversion_proto_depIdxs = []int32{
|
||||
1, // 0: officeconvertapi.v1.SlideDeck.slides:type_name -> officeconvertapi.v1.Slide
|
||||
13, // 1: officeconvertapi.v1.SlideDeck.created_at:type_name -> google.protobuf.Timestamp
|
||||
13, // 2: officeconvertapi.v1.CreateConversionResponse.expires_at:type_name -> google.protobuf.Timestamp
|
||||
2, // 0: officeconvertapi.v1.SlideDeck.slides:type_name -> officeconvertapi.v1.Slide
|
||||
14, // 1: officeconvertapi.v1.SlideDeck.created_at:type_name -> google.protobuf.Timestamp
|
||||
14, // 2: officeconvertapi.v1.CreateConversionResponse.expires_at:type_name -> google.protobuf.Timestamp
|
||||
0, // 3: officeconvertapi.v1.StartConversionResponse.status:type_name -> officeconvertapi.v1.ConversionStatus
|
||||
0, // 4: officeconvertapi.v1.GetConversionStatusResponse.status:type_name -> officeconvertapi.v1.ConversionStatus
|
||||
13, // 5: officeconvertapi.v1.GetConversionStatusResponse.updated_at:type_name -> google.protobuf.Timestamp
|
||||
2, // 6: officeconvertapi.v1.GetSlideDeckResponse.slide_deck:type_name -> officeconvertapi.v1.SlideDeck
|
||||
3, // 7: officeconvertapi.v1.ConversionService.CreateConversion:input_type -> officeconvertapi.v1.CreateConversionRequest
|
||||
5, // 8: officeconvertapi.v1.ConversionService.StartConversion:input_type -> officeconvertapi.v1.StartConversionRequest
|
||||
7, // 9: officeconvertapi.v1.ConversionService.GetConversionStatus:input_type -> officeconvertapi.v1.GetConversionStatusRequest
|
||||
9, // 10: officeconvertapi.v1.ConversionService.GetSlideDeck:input_type -> officeconvertapi.v1.GetSlideDeckRequest
|
||||
11, // 11: officeconvertapi.v1.ConversionService.DeleteConversion:input_type -> officeconvertapi.v1.DeleteConversionRequest
|
||||
4, // 12: officeconvertapi.v1.ConversionService.CreateConversion:output_type -> officeconvertapi.v1.CreateConversionResponse
|
||||
6, // 13: officeconvertapi.v1.ConversionService.StartConversion:output_type -> officeconvertapi.v1.StartConversionResponse
|
||||
8, // 14: officeconvertapi.v1.ConversionService.GetConversionStatus:output_type -> officeconvertapi.v1.GetConversionStatusResponse
|
||||
10, // 15: officeconvertapi.v1.ConversionService.GetSlideDeck:output_type -> officeconvertapi.v1.GetSlideDeckResponse
|
||||
12, // 16: officeconvertapi.v1.ConversionService.DeleteConversion:output_type -> officeconvertapi.v1.DeleteConversionResponse
|
||||
12, // [12:17] is the sub-list for method output_type
|
||||
7, // [7:12] is the sub-list for method input_type
|
||||
7, // [7:7] is the sub-list for extension type_name
|
||||
7, // [7:7] is the sub-list for extension extendee
|
||||
0, // [0:7] is the sub-list for field type_name
|
||||
14, // 5: officeconvertapi.v1.GetConversionStatusResponse.updated_at:type_name -> google.protobuf.Timestamp
|
||||
1, // 6: officeconvertapi.v1.GetConversionStatusResponse.phase:type_name -> officeconvertapi.v1.ConversionPhase
|
||||
3, // 7: officeconvertapi.v1.GetSlideDeckResponse.slide_deck:type_name -> officeconvertapi.v1.SlideDeck
|
||||
4, // 8: officeconvertapi.v1.ConversionService.CreateConversion:input_type -> officeconvertapi.v1.CreateConversionRequest
|
||||
6, // 9: officeconvertapi.v1.ConversionService.StartConversion:input_type -> officeconvertapi.v1.StartConversionRequest
|
||||
8, // 10: officeconvertapi.v1.ConversionService.GetConversionStatus:input_type -> officeconvertapi.v1.GetConversionStatusRequest
|
||||
10, // 11: officeconvertapi.v1.ConversionService.GetSlideDeck:input_type -> officeconvertapi.v1.GetSlideDeckRequest
|
||||
12, // 12: officeconvertapi.v1.ConversionService.DeleteConversion:input_type -> officeconvertapi.v1.DeleteConversionRequest
|
||||
5, // 13: officeconvertapi.v1.ConversionService.CreateConversion:output_type -> officeconvertapi.v1.CreateConversionResponse
|
||||
7, // 14: officeconvertapi.v1.ConversionService.StartConversion:output_type -> officeconvertapi.v1.StartConversionResponse
|
||||
9, // 15: officeconvertapi.v1.ConversionService.GetConversionStatus:output_type -> officeconvertapi.v1.GetConversionStatusResponse
|
||||
11, // 16: officeconvertapi.v1.ConversionService.GetSlideDeck:output_type -> officeconvertapi.v1.GetSlideDeckResponse
|
||||
13, // 17: officeconvertapi.v1.ConversionService.DeleteConversion:output_type -> officeconvertapi.v1.DeleteConversionResponse
|
||||
13, // [13:18] is the sub-list for method output_type
|
||||
8, // [8:13] is the sub-list for method input_type
|
||||
8, // [8:8] is the sub-list for extension type_name
|
||||
8, // [8:8] is the sub-list for extension extendee
|
||||
0, // [0:8] is the sub-list for field type_name
|
||||
}
|
||||
|
||||
func init() { file_officeconvertapi_v1_conversion_proto_init() }
|
||||
@@ -857,7 +952,7 @@ func file_officeconvertapi_v1_conversion_proto_init() {
|
||||
File: protoimpl.DescBuilder{
|
||||
GoPackagePath: reflect.TypeOf(x{}).PkgPath(),
|
||||
RawDescriptor: unsafe.Slice(unsafe.StringData(file_officeconvertapi_v1_conversion_proto_rawDesc), len(file_officeconvertapi_v1_conversion_proto_rawDesc)),
|
||||
NumEnums: 1,
|
||||
NumEnums: 2,
|
||||
NumMessages: 12,
|
||||
NumExtensions: 0,
|
||||
NumServices: 1,
|
||||
|
||||
Reference in New Issue
Block a user