mirror of
https://github.com/crawlab-team/crawlab.git
synced 2026-01-22 17:31:03 +01:00
- add proto/services/sync_service.proto and generate Go pb + grpc bindings - implement SyncServiceServer (streaming file scan + download) with: - request deduplication, in-memory cache (TTL), chunked streaming - concurrent-safe broadcast to waiters and server-side logging - register SyncSvr in gRPC server and expose sync client in GrpcClient: - add syncClient field, registration and safe getters with reconnection-aware timeouts - integrate gRPC sync into runner: - split syncFiles into syncFilesHTTP (legacy) and syncFilesGRPC - Runner now chooses implementation via config flag and performs streaming scan/download - controller improvements: - add semaphore-based rate limiting for sync scan requests with in-flight counters and logs - misc: - add utils.IsSyncGrpcEnabled() config helper - improve HTTP sync error diagnostics (Content-Type validation, response previews) - update/regenerate many protobuf and gRPC generated files (protoc/protoc-gen-go / protoc-gen-go-grpc version bumps)
180 lines
12 KiB
Go
180 lines
12 KiB
Go
// Code generated by protoc-gen-go. DO NOT EDIT.
|
|
// versions:
|
|
// protoc-gen-go v1.36.1
|
|
// protoc v5.29.2
|
|
// source: services/model_base_service.proto
|
|
|
|
package grpc
|
|
|
|
import (
|
|
protoreflect "google.golang.org/protobuf/reflect/protoreflect"
|
|
protoimpl "google.golang.org/protobuf/runtime/protoimpl"
|
|
reflect "reflect"
|
|
)
|
|
|
|
const (
|
|
// Verify that this generated code is sufficiently up-to-date.
|
|
_ = protoimpl.EnforceVersion(20 - protoimpl.MinVersion)
|
|
// Verify that runtime/protoimpl is sufficiently up-to-date.
|
|
_ = protoimpl.EnforceVersion(protoimpl.MaxVersion - 20)
|
|
)
|
|
|
|
var File_services_model_base_service_proto protoreflect.FileDescriptor
|
|
|
|
var file_services_model_base_service_proto_rawDesc = []byte{
|
|
0x0a, 0x21, 0x73, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x73, 0x2f, 0x6d, 0x6f, 0x64, 0x65, 0x6c,
|
|
0x5f, 0x62, 0x61, 0x73, 0x65, 0x5f, 0x73, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x2e, 0x70, 0x72,
|
|
0x6f, 0x74, 0x6f, 0x12, 0x04, 0x67, 0x72, 0x70, 0x63, 0x1a, 0x22, 0x65, 0x6e, 0x74, 0x69, 0x74,
|
|
0x79, 0x2f, 0x6d, 0x6f, 0x64, 0x65, 0x6c, 0x5f, 0x73, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x5f,
|
|
0x72, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x1a, 0x15, 0x65,
|
|
0x6e, 0x74, 0x69, 0x74, 0x79, 0x2f, 0x72, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x2e, 0x70,
|
|
0x72, 0x6f, 0x74, 0x6f, 0x32, 0xf9, 0x07, 0x0a, 0x10, 0x4d, 0x6f, 0x64, 0x65, 0x6c, 0x42, 0x61,
|
|
0x73, 0x65, 0x53, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x12, 0x3d, 0x0a, 0x07, 0x47, 0x65, 0x74,
|
|
0x42, 0x79, 0x49, 0x64, 0x12, 0x20, 0x2e, 0x67, 0x72, 0x70, 0x63, 0x2e, 0x4d, 0x6f, 0x64, 0x65,
|
|
0x6c, 0x53, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x47, 0x65, 0x74, 0x42, 0x79, 0x49, 0x64, 0x52,
|
|
0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x0e, 0x2e, 0x67, 0x72, 0x70, 0x63, 0x2e, 0x52, 0x65,
|
|
0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x00, 0x12, 0x3b, 0x0a, 0x06, 0x47, 0x65, 0x74, 0x4f,
|
|
0x6e, 0x65, 0x12, 0x1f, 0x2e, 0x67, 0x72, 0x70, 0x63, 0x2e, 0x4d, 0x6f, 0x64, 0x65, 0x6c, 0x53,
|
|
0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x47, 0x65, 0x74, 0x4f, 0x6e, 0x65, 0x52, 0x65, 0x71, 0x75,
|
|
0x65, 0x73, 0x74, 0x1a, 0x0e, 0x2e, 0x67, 0x72, 0x70, 0x63, 0x2e, 0x52, 0x65, 0x73, 0x70, 0x6f,
|
|
0x6e, 0x73, 0x65, 0x22, 0x00, 0x12, 0x3d, 0x0a, 0x07, 0x47, 0x65, 0x74, 0x4d, 0x61, 0x6e, 0x79,
|
|
0x12, 0x20, 0x2e, 0x67, 0x72, 0x70, 0x63, 0x2e, 0x4d, 0x6f, 0x64, 0x65, 0x6c, 0x53, 0x65, 0x72,
|
|
0x76, 0x69, 0x63, 0x65, 0x47, 0x65, 0x74, 0x4d, 0x61, 0x6e, 0x79, 0x52, 0x65, 0x71, 0x75, 0x65,
|
|
0x73, 0x74, 0x1a, 0x0e, 0x2e, 0x67, 0x72, 0x70, 0x63, 0x2e, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e,
|
|
0x73, 0x65, 0x22, 0x00, 0x12, 0x43, 0x0a, 0x0a, 0x44, 0x65, 0x6c, 0x65, 0x74, 0x65, 0x42, 0x79,
|
|
0x49, 0x64, 0x12, 0x23, 0x2e, 0x67, 0x72, 0x70, 0x63, 0x2e, 0x4d, 0x6f, 0x64, 0x65, 0x6c, 0x53,
|
|
0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x44, 0x65, 0x6c, 0x65, 0x74, 0x65, 0x42, 0x79, 0x49, 0x64,
|
|
0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x0e, 0x2e, 0x67, 0x72, 0x70, 0x63, 0x2e, 0x52,
|
|
0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x00, 0x12, 0x41, 0x0a, 0x09, 0x44, 0x65, 0x6c,
|
|
0x65, 0x74, 0x65, 0x4f, 0x6e, 0x65, 0x12, 0x22, 0x2e, 0x67, 0x72, 0x70, 0x63, 0x2e, 0x4d, 0x6f,
|
|
0x64, 0x65, 0x6c, 0x53, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x44, 0x65, 0x6c, 0x65, 0x74, 0x65,
|
|
0x4f, 0x6e, 0x65, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x0e, 0x2e, 0x67, 0x72, 0x70,
|
|
0x63, 0x2e, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x00, 0x12, 0x43, 0x0a, 0x0a,
|
|
0x44, 0x65, 0x6c, 0x65, 0x74, 0x65, 0x4d, 0x61, 0x6e, 0x79, 0x12, 0x23, 0x2e, 0x67, 0x72, 0x70,
|
|
0x63, 0x2e, 0x4d, 0x6f, 0x64, 0x65, 0x6c, 0x53, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x44, 0x65,
|
|
0x6c, 0x65, 0x74, 0x65, 0x4d, 0x61, 0x6e, 0x79, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a,
|
|
0x0e, 0x2e, 0x67, 0x72, 0x70, 0x63, 0x2e, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22,
|
|
0x00, 0x12, 0x43, 0x0a, 0x0a, 0x55, 0x70, 0x64, 0x61, 0x74, 0x65, 0x42, 0x79, 0x49, 0x64, 0x12,
|
|
0x23, 0x2e, 0x67, 0x72, 0x70, 0x63, 0x2e, 0x4d, 0x6f, 0x64, 0x65, 0x6c, 0x53, 0x65, 0x72, 0x76,
|
|
0x69, 0x63, 0x65, 0x55, 0x70, 0x64, 0x61, 0x74, 0x65, 0x42, 0x79, 0x49, 0x64, 0x52, 0x65, 0x71,
|
|
0x75, 0x65, 0x73, 0x74, 0x1a, 0x0e, 0x2e, 0x67, 0x72, 0x70, 0x63, 0x2e, 0x52, 0x65, 0x73, 0x70,
|
|
0x6f, 0x6e, 0x73, 0x65, 0x22, 0x00, 0x12, 0x41, 0x0a, 0x09, 0x55, 0x70, 0x64, 0x61, 0x74, 0x65,
|
|
0x4f, 0x6e, 0x65, 0x12, 0x22, 0x2e, 0x67, 0x72, 0x70, 0x63, 0x2e, 0x4d, 0x6f, 0x64, 0x65, 0x6c,
|
|
0x53, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x55, 0x70, 0x64, 0x61, 0x74, 0x65, 0x4f, 0x6e, 0x65,
|
|
0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x0e, 0x2e, 0x67, 0x72, 0x70, 0x63, 0x2e, 0x52,
|
|
0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x00, 0x12, 0x43, 0x0a, 0x0a, 0x55, 0x70, 0x64,
|
|
0x61, 0x74, 0x65, 0x4d, 0x61, 0x6e, 0x79, 0x12, 0x23, 0x2e, 0x67, 0x72, 0x70, 0x63, 0x2e, 0x4d,
|
|
0x6f, 0x64, 0x65, 0x6c, 0x53, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x55, 0x70, 0x64, 0x61, 0x74,
|
|
0x65, 0x4d, 0x61, 0x6e, 0x79, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x0e, 0x2e, 0x67,
|
|
0x72, 0x70, 0x63, 0x2e, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x00, 0x12, 0x45,
|
|
0x0a, 0x0b, 0x52, 0x65, 0x70, 0x6c, 0x61, 0x63, 0x65, 0x42, 0x79, 0x49, 0x64, 0x12, 0x24, 0x2e,
|
|
0x67, 0x72, 0x70, 0x63, 0x2e, 0x4d, 0x6f, 0x64, 0x65, 0x6c, 0x53, 0x65, 0x72, 0x76, 0x69, 0x63,
|
|
0x65, 0x52, 0x65, 0x70, 0x6c, 0x61, 0x63, 0x65, 0x42, 0x79, 0x49, 0x64, 0x52, 0x65, 0x71, 0x75,
|
|
0x65, 0x73, 0x74, 0x1a, 0x0e, 0x2e, 0x67, 0x72, 0x70, 0x63, 0x2e, 0x52, 0x65, 0x73, 0x70, 0x6f,
|
|
0x6e, 0x73, 0x65, 0x22, 0x00, 0x12, 0x43, 0x0a, 0x0a, 0x52, 0x65, 0x70, 0x6c, 0x61, 0x63, 0x65,
|
|
0x4f, 0x6e, 0x65, 0x12, 0x23, 0x2e, 0x67, 0x72, 0x70, 0x63, 0x2e, 0x4d, 0x6f, 0x64, 0x65, 0x6c,
|
|
0x53, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x52, 0x65, 0x70, 0x6c, 0x61, 0x63, 0x65, 0x4f, 0x6e,
|
|
0x65, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x0e, 0x2e, 0x67, 0x72, 0x70, 0x63, 0x2e,
|
|
0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x00, 0x12, 0x41, 0x0a, 0x09, 0x49, 0x6e,
|
|
0x73, 0x65, 0x72, 0x74, 0x4f, 0x6e, 0x65, 0x12, 0x22, 0x2e, 0x67, 0x72, 0x70, 0x63, 0x2e, 0x4d,
|
|
0x6f, 0x64, 0x65, 0x6c, 0x53, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x49, 0x6e, 0x73, 0x65, 0x72,
|
|
0x74, 0x4f, 0x6e, 0x65, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x0e, 0x2e, 0x67, 0x72,
|
|
0x70, 0x63, 0x2e, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x00, 0x12, 0x43, 0x0a,
|
|
0x0a, 0x49, 0x6e, 0x73, 0x65, 0x72, 0x74, 0x4d, 0x61, 0x6e, 0x79, 0x12, 0x23, 0x2e, 0x67, 0x72,
|
|
0x70, 0x63, 0x2e, 0x4d, 0x6f, 0x64, 0x65, 0x6c, 0x53, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x49,
|
|
0x6e, 0x73, 0x65, 0x72, 0x74, 0x4d, 0x61, 0x6e, 0x79, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74,
|
|
0x1a, 0x0e, 0x2e, 0x67, 0x72, 0x70, 0x63, 0x2e, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65,
|
|
0x22, 0x00, 0x12, 0x41, 0x0a, 0x09, 0x55, 0x70, 0x73, 0x65, 0x72, 0x74, 0x4f, 0x6e, 0x65, 0x12,
|
|
0x22, 0x2e, 0x67, 0x72, 0x70, 0x63, 0x2e, 0x4d, 0x6f, 0x64, 0x65, 0x6c, 0x53, 0x65, 0x72, 0x76,
|
|
0x69, 0x63, 0x65, 0x55, 0x70, 0x73, 0x65, 0x72, 0x74, 0x4f, 0x6e, 0x65, 0x52, 0x65, 0x71, 0x75,
|
|
0x65, 0x73, 0x74, 0x1a, 0x0e, 0x2e, 0x67, 0x72, 0x70, 0x63, 0x2e, 0x52, 0x65, 0x73, 0x70, 0x6f,
|
|
0x6e, 0x73, 0x65, 0x22, 0x00, 0x12, 0x39, 0x0a, 0x05, 0x43, 0x6f, 0x75, 0x6e, 0x74, 0x12, 0x1e,
|
|
0x2e, 0x67, 0x72, 0x70, 0x63, 0x2e, 0x4d, 0x6f, 0x64, 0x65, 0x6c, 0x53, 0x65, 0x72, 0x76, 0x69,
|
|
0x63, 0x65, 0x43, 0x6f, 0x75, 0x6e, 0x74, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x0e,
|
|
0x2e, 0x67, 0x72, 0x70, 0x63, 0x2e, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x00,
|
|
0x42, 0x08, 0x5a, 0x06, 0x2e, 0x3b, 0x67, 0x72, 0x70, 0x63, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74,
|
|
0x6f, 0x33,
|
|
}
|
|
|
|
var file_services_model_base_service_proto_goTypes = []any{
|
|
(*ModelServiceGetByIdRequest)(nil), // 0: grpc.ModelServiceGetByIdRequest
|
|
(*ModelServiceGetOneRequest)(nil), // 1: grpc.ModelServiceGetOneRequest
|
|
(*ModelServiceGetManyRequest)(nil), // 2: grpc.ModelServiceGetManyRequest
|
|
(*ModelServiceDeleteByIdRequest)(nil), // 3: grpc.ModelServiceDeleteByIdRequest
|
|
(*ModelServiceDeleteOneRequest)(nil), // 4: grpc.ModelServiceDeleteOneRequest
|
|
(*ModelServiceDeleteManyRequest)(nil), // 5: grpc.ModelServiceDeleteManyRequest
|
|
(*ModelServiceUpdateByIdRequest)(nil), // 6: grpc.ModelServiceUpdateByIdRequest
|
|
(*ModelServiceUpdateOneRequest)(nil), // 7: grpc.ModelServiceUpdateOneRequest
|
|
(*ModelServiceUpdateManyRequest)(nil), // 8: grpc.ModelServiceUpdateManyRequest
|
|
(*ModelServiceReplaceByIdRequest)(nil), // 9: grpc.ModelServiceReplaceByIdRequest
|
|
(*ModelServiceReplaceOneRequest)(nil), // 10: grpc.ModelServiceReplaceOneRequest
|
|
(*ModelServiceInsertOneRequest)(nil), // 11: grpc.ModelServiceInsertOneRequest
|
|
(*ModelServiceInsertManyRequest)(nil), // 12: grpc.ModelServiceInsertManyRequest
|
|
(*ModelServiceUpsertOneRequest)(nil), // 13: grpc.ModelServiceUpsertOneRequest
|
|
(*ModelServiceCountRequest)(nil), // 14: grpc.ModelServiceCountRequest
|
|
(*Response)(nil), // 15: grpc.Response
|
|
}
|
|
var file_services_model_base_service_proto_depIdxs = []int32{
|
|
0, // 0: grpc.ModelBaseService.GetById:input_type -> grpc.ModelServiceGetByIdRequest
|
|
1, // 1: grpc.ModelBaseService.GetOne:input_type -> grpc.ModelServiceGetOneRequest
|
|
2, // 2: grpc.ModelBaseService.GetMany:input_type -> grpc.ModelServiceGetManyRequest
|
|
3, // 3: grpc.ModelBaseService.DeleteById:input_type -> grpc.ModelServiceDeleteByIdRequest
|
|
4, // 4: grpc.ModelBaseService.DeleteOne:input_type -> grpc.ModelServiceDeleteOneRequest
|
|
5, // 5: grpc.ModelBaseService.DeleteMany:input_type -> grpc.ModelServiceDeleteManyRequest
|
|
6, // 6: grpc.ModelBaseService.UpdateById:input_type -> grpc.ModelServiceUpdateByIdRequest
|
|
7, // 7: grpc.ModelBaseService.UpdateOne:input_type -> grpc.ModelServiceUpdateOneRequest
|
|
8, // 8: grpc.ModelBaseService.UpdateMany:input_type -> grpc.ModelServiceUpdateManyRequest
|
|
9, // 9: grpc.ModelBaseService.ReplaceById:input_type -> grpc.ModelServiceReplaceByIdRequest
|
|
10, // 10: grpc.ModelBaseService.ReplaceOne:input_type -> grpc.ModelServiceReplaceOneRequest
|
|
11, // 11: grpc.ModelBaseService.InsertOne:input_type -> grpc.ModelServiceInsertOneRequest
|
|
12, // 12: grpc.ModelBaseService.InsertMany:input_type -> grpc.ModelServiceInsertManyRequest
|
|
13, // 13: grpc.ModelBaseService.UpsertOne:input_type -> grpc.ModelServiceUpsertOneRequest
|
|
14, // 14: grpc.ModelBaseService.Count:input_type -> grpc.ModelServiceCountRequest
|
|
15, // 15: grpc.ModelBaseService.GetById:output_type -> grpc.Response
|
|
15, // 16: grpc.ModelBaseService.GetOne:output_type -> grpc.Response
|
|
15, // 17: grpc.ModelBaseService.GetMany:output_type -> grpc.Response
|
|
15, // 18: grpc.ModelBaseService.DeleteById:output_type -> grpc.Response
|
|
15, // 19: grpc.ModelBaseService.DeleteOne:output_type -> grpc.Response
|
|
15, // 20: grpc.ModelBaseService.DeleteMany:output_type -> grpc.Response
|
|
15, // 21: grpc.ModelBaseService.UpdateById:output_type -> grpc.Response
|
|
15, // 22: grpc.ModelBaseService.UpdateOne:output_type -> grpc.Response
|
|
15, // 23: grpc.ModelBaseService.UpdateMany:output_type -> grpc.Response
|
|
15, // 24: grpc.ModelBaseService.ReplaceById:output_type -> grpc.Response
|
|
15, // 25: grpc.ModelBaseService.ReplaceOne:output_type -> grpc.Response
|
|
15, // 26: grpc.ModelBaseService.InsertOne:output_type -> grpc.Response
|
|
15, // 27: grpc.ModelBaseService.InsertMany:output_type -> grpc.Response
|
|
15, // 28: grpc.ModelBaseService.UpsertOne:output_type -> grpc.Response
|
|
15, // 29: grpc.ModelBaseService.Count:output_type -> grpc.Response
|
|
15, // [15:30] is the sub-list for method output_type
|
|
0, // [0:15] is the sub-list for method input_type
|
|
0, // [0:0] is the sub-list for extension type_name
|
|
0, // [0:0] is the sub-list for extension extendee
|
|
0, // [0:0] is the sub-list for field type_name
|
|
}
|
|
|
|
func init() { file_services_model_base_service_proto_init() }
|
|
func file_services_model_base_service_proto_init() {
|
|
if File_services_model_base_service_proto != nil {
|
|
return
|
|
}
|
|
file_entity_model_service_request_proto_init()
|
|
file_entity_response_proto_init()
|
|
type x struct{}
|
|
out := protoimpl.TypeBuilder{
|
|
File: protoimpl.DescBuilder{
|
|
GoPackagePath: reflect.TypeOf(x{}).PkgPath(),
|
|
RawDescriptor: file_services_model_base_service_proto_rawDesc,
|
|
NumEnums: 0,
|
|
NumMessages: 0,
|
|
NumExtensions: 0,
|
|
NumServices: 1,
|
|
},
|
|
GoTypes: file_services_model_base_service_proto_goTypes,
|
|
DependencyIndexes: file_services_model_base_service_proto_depIdxs,
|
|
}.Build()
|
|
File_services_model_base_service_proto = out.File
|
|
file_services_model_base_service_proto_rawDesc = nil
|
|
file_services_model_base_service_proto_goTypes = nil
|
|
file_services_model_base_service_proto_depIdxs = nil
|
|
}
|