diff --git a/core/controllers/base_v2.go b/core/controllers/base_v2.go index 1e3e1407..a01bacab 100644 --- a/core/controllers/base_v2.go +++ b/core/controllers/base_v2.go @@ -18,7 +18,7 @@ type Action struct { } type BaseControllerV2[T any] struct { - modelSvc *service.ModelServiceV2[T] + modelSvc *service.ModelService[T] actions []Action } @@ -229,7 +229,7 @@ func (ctr *BaseControllerV2[T]) getList(c *gin.Context) { func NewControllerV2[T any](actions ...Action) *BaseControllerV2[T] { ctr := &BaseControllerV2[T]{ - modelSvc: service.NewModelServiceV2[T](), + modelSvc: service.NewModelService[T](), actions: actions, } return ctr diff --git a/core/controllers/base_v2_test.go b/core/controllers/base_v2_test.go index 5259ca9a..f1c373f3 100644 --- a/core/controllers/base_v2_test.go +++ b/core/controllers/base_v2_test.go @@ -31,7 +31,7 @@ var TestToken string // SetupTestDB sets up the test database func SetupTestDB() { viper.Set("mongo.db", "testdb") - modelSvc := service.NewModelServiceV2[models.UserV2]() + modelSvc := service.NewModelService[models.UserV2]() u := models.UserV2{ Username: "admin", } @@ -68,7 +68,7 @@ func TestBaseControllerV2_GetById(t *testing.T) { defer CleanupTestDB() // Insert a test document - id, err := service.NewModelServiceV2[TestModel]().InsertOne(TestModel{Name: "test"}) + id, err := service.NewModelService[TestModel]().InsertOne(TestModel{Name: "test"}) assert.NoError(t, err) // Initialize the controller @@ -127,7 +127,7 @@ func TestBaseControllerV2_Post(t *testing.T) { assert.Equal(t, "test", response.Data.Name) // Check if the document was inserted into the database - result, err := service.NewModelServiceV2[TestModel]().GetById(response.Data.Id) + result, err := service.NewModelService[TestModel]().GetById(response.Data.Id) assert.NoError(t, err) assert.Equal(t, "test", result.Name) } @@ -137,7 +137,7 @@ func TestBaseControllerV2_DeleteById(t *testing.T) { defer CleanupTestDB() // Insert a test document - id, err := service.NewModelServiceV2[TestModel]().InsertOne(TestModel{Name: "test"}) + id, err := service.NewModelService[TestModel]().InsertOne(TestModel{Name: "test"}) assert.NoError(t, err) // Initialize the controller @@ -160,6 +160,6 @@ func TestBaseControllerV2_DeleteById(t *testing.T) { assert.Equal(t, http.StatusOK, w.Code) // Check if the document was deleted from the database - _, err = service.NewModelServiceV2[TestModel]().GetById(id) + _, err = service.NewModelService[TestModel]().GetById(id) assert.Error(t, err) } diff --git a/core/controllers/project_v2.go b/core/controllers/project_v2.go index 5da46799..a2947c09 100644 --- a/core/controllers/project_v2.go +++ b/core/controllers/project_v2.go @@ -25,7 +25,7 @@ func GetProjectList(c *gin.Context) { sort := MustGetSortOption(c) // get list - projects, err := service.NewModelServiceV2[models2.ProjectV2]().GetMany(query, &mongo.FindOptions{ + projects, err := service.NewModelService[models2.ProjectV2]().GetMany(query, &mongo.FindOptions{ Sort: sort, Skip: pagination.Size * (pagination.Page - 1), Limit: pagination.Size, @@ -42,7 +42,7 @@ func GetProjectList(c *gin.Context) { } // total count - total, err := service.NewModelServiceV2[models2.ProjectV2]().Count(query) + total, err := service.NewModelService[models2.ProjectV2]().Count(query) if err != nil { HandleErrorInternalServerError(c, err) return @@ -61,7 +61,7 @@ func GetProjectList(c *gin.Context) { } // spiders - spiders, err := service.NewModelServiceV2[models2.SpiderV2]().GetMany(bson.M{ + spiders, err := service.NewModelService[models2.SpiderV2]().GetMany(bson.M{ "project_id": bson.M{ "$in": ids, }, diff --git a/core/controllers/schedule_v2.go b/core/controllers/schedule_v2.go index ffd1c3e3..4aa7bede 100644 --- a/core/controllers/schedule_v2.go +++ b/core/controllers/schedule_v2.go @@ -18,7 +18,7 @@ func PostSchedule(c *gin.Context) { u := GetUserFromContext(c) - modelSvc := service.NewModelServiceV2[models.ScheduleV2]() + modelSvc := service.NewModelService[models.ScheduleV2]() s.SetCreated(u.Id) s.SetUpdated(u.Id) @@ -60,7 +60,7 @@ func PutScheduleById(c *gin.Context) { return } - modelSvc := service.NewModelServiceV2[models.ScheduleV2]() + modelSvc := service.NewModelService[models.ScheduleV2]() err = modelSvc.ReplaceById(id, s) if err != nil { HandleErrorInternalServerError(c, err) @@ -110,7 +110,7 @@ func postScheduleEnableDisableFunc(isEnable bool) func(c *gin.Context) { HandleErrorInternalServerError(c, err) return } - s, err := service.NewModelServiceV2[models.ScheduleV2]().GetById(id) + s, err := service.NewModelService[models.ScheduleV2]().GetById(id) if err != nil { HandleErrorInternalServerError(c, err) return diff --git a/core/controllers/setting_v2.go b/core/controllers/setting_v2.go index e7abca56..f9777f56 100644 --- a/core/controllers/setting_v2.go +++ b/core/controllers/setting_v2.go @@ -14,7 +14,7 @@ func GetSetting(c *gin.Context) { key := c.Param("id") // setting - s, err := service.NewModelServiceV2[models.SettingV2]().GetOne(bson.M{"key": key}, nil) + s, err := service.NewModelService[models.SettingV2]().GetOne(bson.M{"key": key}, nil) if err != nil { if errors.Is(err, mongo.ErrNoDocuments) { HandleSuccess(c) @@ -47,7 +47,7 @@ func PostSetting(c *gin.Context) { s.SetCreated(u.Id) s.SetUpdated(u.Id) - id, err := service.NewModelServiceV2[models.SettingV2]().InsertOne(s) + id, err := service.NewModelService[models.SettingV2]().InsertOne(s) if err != nil { HandleErrorInternalServerError(c, err) return @@ -68,7 +68,7 @@ func PutSetting(c *gin.Context) { return } - modelSvc := service.NewModelServiceV2[models.SettingV2]() + modelSvc := service.NewModelService[models.SettingV2]() // setting _s, err := modelSvc.GetOne(bson.M{"key": key}, nil) diff --git a/core/controllers/spider_v2.go b/core/controllers/spider_v2.go index 2cc2ae26..17eb9bb6 100644 --- a/core/controllers/spider_v2.go +++ b/core/controllers/spider_v2.go @@ -30,7 +30,7 @@ func GetSpiderById(c *gin.Context) { HandleErrorBadRequest(c, err) return } - s, err := service.NewModelServiceV2[models2.SpiderV2]().GetById(id) + s, err := service.NewModelService[models2.SpiderV2]().GetById(id) if errors.Is(err, mongo2.ErrNoDocuments) { HandleErrorNotFound(c, err) return @@ -41,7 +41,7 @@ func GetSpiderById(c *gin.Context) { } // stat - s.Stat, err = service.NewModelServiceV2[models2.SpiderStatV2]().GetById(s.Id) + s.Stat, err = service.NewModelService[models2.SpiderStatV2]().GetById(s.Id) if err != nil { if !errors.Is(err, mongo2.ErrNoDocuments) { HandleErrorInternalServerError(c, err) @@ -51,7 +51,7 @@ func GetSpiderById(c *gin.Context) { // data collection (compatible to old version) # TODO: remove in the future if s.ColName == "" && !s.ColId.IsZero() { - col, err := service.NewModelServiceV2[models2.DataCollectionV2]().GetById(s.ColId) + col, err := service.NewModelService[models2.DataCollectionV2]().GetById(s.ColId) if err != nil { if !errors.Is(err, mongo2.ErrNoDocuments) { HandleErrorInternalServerError(c, err) @@ -64,7 +64,7 @@ func GetSpiderById(c *gin.Context) { // git if utils.IsPro() && !s.GitId.IsZero() { - s.Git, err = service.NewModelServiceV2[models2.GitV2]().GetById(s.GitId) + s.Git, err = service.NewModelService[models2.GitV2]().GetById(s.GitId) if err != nil { if !errors.Is(err, mongo2.ErrNoDocuments) { HandleErrorInternalServerError(c, err) @@ -102,7 +102,7 @@ func getSpiderListWithStats(c *gin.Context) { sort := MustGetSortOption(c) // get list - spiders, err := service.NewModelServiceV2[models2.SpiderV2]().GetMany(query, &mongo.FindOptions{ + spiders, err := service.NewModelService[models2.SpiderV2]().GetMany(query, &mongo.FindOptions{ Sort: sort, Skip: pagination.Size * (pagination.Page - 1), Limit: pagination.Size, @@ -129,14 +129,14 @@ func getSpiderListWithStats(c *gin.Context) { } // total count - total, err := service.NewModelServiceV2[models2.SpiderV2]().Count(query) + total, err := service.NewModelService[models2.SpiderV2]().Count(query) if err != nil { HandleErrorInternalServerError(c, err) return } // stat list - spiderStats, err := service.NewModelServiceV2[models2.SpiderStatV2]().GetMany(bson.M{"_id": bson.M{"$in": ids}}, nil) + spiderStats, err := service.NewModelService[models2.SpiderStatV2]().GetMany(bson.M{"_id": bson.M{"$in": ids}}, nil) if err != nil { HandleErrorInternalServerError(c, err) return @@ -170,14 +170,14 @@ func getSpiderListWithStats(c *gin.Context) { "$in": taskIds, }, } - tasks, err = service.NewModelServiceV2[models2.TaskV2]().GetMany(queryTask, nil) + tasks, err = service.NewModelService[models2.TaskV2]().GetMany(queryTask, nil) if err != nil { HandleErrorInternalServerError(c, err) return } // task stats list - taskStats, err := service.NewModelServiceV2[models2.TaskStatV2]().GetMany(queryTask, nil) + taskStats, err := service.NewModelService[models2.TaskStatV2]().GetMany(queryTask, nil) if err != nil { HandleErrorInternalServerError(c, err) return @@ -201,7 +201,7 @@ func getSpiderListWithStats(c *gin.Context) { // git list var gits []models2.GitV2 if len(gitIds) > 0 && utils.IsPro() { - gits, err = service.NewModelServiceV2[models2.GitV2]().GetMany(bson.M{"_id": bson.M{"$in": gitIds}}, nil) + gits, err = service.NewModelService[models2.GitV2]().GetMany(bson.M{"_id": bson.M{"$in": gitIds}}, nil) if err != nil { HandleErrorInternalServerError(c, err) return @@ -259,7 +259,7 @@ func PostSpider(c *gin.Context) { // add s.SetCreated(u.Id) s.SetUpdated(u.Id) - id, err := service.NewModelServiceV2[models2.SpiderV2]().InsertOne(s) + id, err := service.NewModelService[models2.SpiderV2]().InsertOne(s) if err != nil { HandleErrorInternalServerError(c, err) return @@ -271,7 +271,7 @@ func PostSpider(c *gin.Context) { st.SetId(id) st.SetCreated(u.Id) st.SetUpdated(u.Id) - _, err = service.NewModelServiceV2[models2.SpiderStatV2]().InsertOne(st) + _, err = service.NewModelService[models2.SpiderStatV2]().InsertOne(st) if err != nil { HandleErrorInternalServerError(c, err) return @@ -308,7 +308,7 @@ func PutSpiderById(c *gin.Context) { u := GetUserFromContext(c) - modelSvc := service.NewModelServiceV2[models2.SpiderV2]() + modelSvc := service.NewModelService[models2.SpiderV2]() // save s.SetUpdated(u.Id) @@ -336,7 +336,7 @@ func DeleteSpiderById(c *gin.Context) { } // spider - s, err := service.NewModelServiceV2[models2.SpiderV2]().GetById(id) + s, err := service.NewModelService[models2.SpiderV2]().GetById(id) if err != nil { HandleErrorInternalServerError(c, err) return @@ -344,19 +344,19 @@ func DeleteSpiderById(c *gin.Context) { if err := mongo.RunTransaction(func(context mongo2.SessionContext) (err error) { // delete spider - err = service.NewModelServiceV2[models2.SpiderV2]().DeleteById(id) + err = service.NewModelService[models2.SpiderV2]().DeleteById(id) if err != nil { return err } // delete spider stat - err = service.NewModelServiceV2[models2.SpiderStatV2]().DeleteById(id) + err = service.NewModelService[models2.SpiderStatV2]().DeleteById(id) if err != nil { return err } // related tasks - tasks, err := service.NewModelServiceV2[models2.TaskV2]().GetMany(bson.M{"spider_id": id}, nil) + tasks, err := service.NewModelService[models2.TaskV2]().GetMany(bson.M{"spider_id": id}, nil) if err != nil { return err } @@ -372,13 +372,13 @@ func DeleteSpiderById(c *gin.Context) { } // delete related tasks - err = service.NewModelServiceV2[models2.TaskV2]().DeleteMany(bson.M{"_id": bson.M{"$in": taskIds}}) + err = service.NewModelService[models2.TaskV2]().DeleteMany(bson.M{"_id": bson.M{"$in": taskIds}}) if err != nil { return err } // delete related task stats - err = service.NewModelServiceV2[models2.TaskStatV2]().DeleteMany(bson.M{"_id": bson.M{"$in": taskIds}}) + err = service.NewModelService[models2.TaskStatV2]().DeleteMany(bson.M{"_id": bson.M{"$in": taskIds}}) if err != nil { return err } @@ -433,7 +433,7 @@ func DeleteSpiderList(c *gin.Context) { } // Fetch spiders before deletion - spiders, err := service.NewModelServiceV2[models2.SpiderV2]().GetMany(bson.M{ + spiders, err := service.NewModelService[models2.SpiderV2]().GetMany(bson.M{ "_id": bson.M{ "$in": payload.Ids, }, @@ -445,7 +445,7 @@ func DeleteSpiderList(c *gin.Context) { if err := mongo.RunTransaction(func(context mongo2.SessionContext) (err error) { // delete spiders - if err := service.NewModelServiceV2[models2.SpiderV2]().DeleteMany(bson.M{ + if err := service.NewModelService[models2.SpiderV2]().DeleteMany(bson.M{ "_id": bson.M{ "$in": payload.Ids, }, @@ -454,7 +454,7 @@ func DeleteSpiderList(c *gin.Context) { } // delete spider stats - if err := service.NewModelServiceV2[models2.SpiderStatV2]().DeleteMany(bson.M{ + if err := service.NewModelService[models2.SpiderStatV2]().DeleteMany(bson.M{ "_id": bson.M{ "$in": payload.Ids, }, @@ -463,7 +463,7 @@ func DeleteSpiderList(c *gin.Context) { } // related tasks - tasks, err := service.NewModelServiceV2[models2.TaskV2]().GetMany(bson.M{"spider_id": bson.M{"$in": payload.Ids}}, nil) + tasks, err := service.NewModelService[models2.TaskV2]().GetMany(bson.M{"spider_id": bson.M{"$in": payload.Ids}}, nil) if err != nil { return err } @@ -479,12 +479,12 @@ func DeleteSpiderList(c *gin.Context) { } // delete related tasks - if err := service.NewModelServiceV2[models2.TaskV2]().DeleteMany(bson.M{"_id": bson.M{"$in": taskIds}}); err != nil { + if err := service.NewModelService[models2.TaskV2]().DeleteMany(bson.M{"_id": bson.M{"$in": taskIds}}); err != nil { return err } // delete related task stats - if err := service.NewModelServiceV2[models2.TaskStatV2]().DeleteMany(bson.M{"_id": bson.M{"$in": taskIds}}); err != nil { + if err := service.NewModelService[models2.TaskStatV2]().DeleteMany(bson.M{"_id": bson.M{"$in": taskIds}}); err != nil { return err } @@ -676,7 +676,7 @@ func GetSpiderResults(c *gin.Context) { return } - s, err := service.NewModelServiceV2[models2.SpiderV2]().GetById(id) + s, err := service.NewModelService[models2.SpiderV2]().GetById(id) if err != nil { HandleErrorInternalServerError(c, err) return @@ -716,7 +716,7 @@ func getSpiderFsSvc(s *models2.SpiderV2) (svc interfaces.FsService, err error) { } func getSpiderFsSvcById(id primitive.ObjectID) (svc interfaces.FsService, err error) { - s, err := service.NewModelServiceV2[models2.SpiderV2]().GetById(id) + s, err := service.NewModelService[models2.SpiderV2]().GetById(id) if err != nil { log.Errorf("failed to get spider: %s", err.Error()) trace.PrintError(err) @@ -733,7 +733,7 @@ func getSpiderRootPath(c *gin.Context) (rootPath string, err error) { } // spider - s, err := service.NewModelServiceV2[models2.SpiderV2]().GetById(id) + s, err := service.NewModelService[models2.SpiderV2]().GetById(id) if err != nil { return "", err } diff --git a/core/controllers/spider_v2_test.go b/core/controllers/spider_v2_test.go index dd3caf8f..da17cacc 100644 --- a/core/controllers/spider_v2_test.go +++ b/core/controllers/spider_v2_test.go @@ -62,11 +62,11 @@ func TestGetSpiderById(t *testing.T) { Name: "Test Spider", ColName: "test_spiders", } - id, err := service.NewModelServiceV2[models.SpiderV2]().InsertOne(model) + id, err := service.NewModelService[models.SpiderV2]().InsertOne(model) require.Nil(t, err) ts := models.SpiderStatV2{} ts.SetId(id) - _, err = service.NewModelServiceV2[models.SpiderStatV2]().InsertOne(ts) + _, err = service.NewModelService[models.SpiderStatV2]().InsertOne(ts) require.Nil(t, err) req, _ := http.NewRequest("GET", "/spiders/"+id.Hex(), nil) @@ -97,11 +97,11 @@ func TestUpdateSpiderById(t *testing.T) { Name: "Test Spider", ColName: "test_spiders", } - id, err := service.NewModelServiceV2[models.SpiderV2]().InsertOne(model) + id, err := service.NewModelService[models.SpiderV2]().InsertOne(model) require.Nil(t, err) ts := models.SpiderStatV2{} ts.SetId(id) - _, err = service.NewModelServiceV2[models.SpiderStatV2]().InsertOne(ts) + _, err = service.NewModelService[models.SpiderStatV2]().InsertOne(ts) require.Nil(t, err) spiderId := id.Hex() @@ -124,7 +124,7 @@ func TestUpdateSpiderById(t *testing.T) { require.Nil(t, err) assert.Equal(t, payload.Name, response.Data.Name) - svc := service.NewModelServiceV2[models.SpiderV2]() + svc := service.NewModelService[models.SpiderV2]() resModel, err := svc.GetById(id) require.Nil(t, err) assert.Equal(t, payload.Name, resModel.Name) @@ -144,19 +144,19 @@ func TestDeleteSpiderById(t *testing.T) { Name: "Test Spider", ColName: "test_spiders", } - id, err := service.NewModelServiceV2[models.SpiderV2]().InsertOne(model) + id, err := service.NewModelService[models.SpiderV2]().InsertOne(model) require.Nil(t, err) ts := models.SpiderStatV2{} ts.SetId(id) - _, err = service.NewModelServiceV2[models.SpiderStatV2]().InsertOne(ts) + _, err = service.NewModelService[models.SpiderStatV2]().InsertOne(ts) require.Nil(t, err) task := models.TaskV2{} task.SpiderId = id - taskId, err := service.NewModelServiceV2[models.TaskV2]().InsertOne(task) + taskId, err := service.NewModelService[models.TaskV2]().InsertOne(task) require.Nil(t, err) taskStat := models.TaskStatV2{} taskStat.SetId(taskId) - _, err = service.NewModelServiceV2[models.TaskStatV2]().InsertOne(taskStat) + _, err = service.NewModelService[models.TaskStatV2]().InsertOne(taskStat) require.Nil(t, err) req, _ := http.NewRequest("DELETE", "/spiders/"+id.Hex(), nil) @@ -167,14 +167,14 @@ func TestDeleteSpiderById(t *testing.T) { assert.Equal(t, http.StatusOK, resp.Code) - _, err = service.NewModelServiceV2[models.SpiderV2]().GetById(id) + _, err = service.NewModelService[models.SpiderV2]().GetById(id) assert.NotNil(t, err) - _, err = service.NewModelServiceV2[models.SpiderStatV2]().GetById(id) + _, err = service.NewModelService[models.SpiderStatV2]().GetById(id) assert.NotNil(t, err) - taskCount, err := service.NewModelServiceV2[models.TaskV2]().Count(bson.M{"spider_id": id}) + taskCount, err := service.NewModelService[models.TaskV2]().Count(bson.M{"spider_id": id}) require.Nil(t, err) assert.Equal(t, 0, taskCount) - taskStatCount, err := service.NewModelServiceV2[models.TaskStatV2]().Count(bson.M{"_id": taskId}) + taskStatCount, err := service.NewModelService[models.TaskStatV2]().Count(bson.M{"_id": taskId}) require.Nil(t, err) assert.Equal(t, 0, taskStatCount) @@ -202,19 +202,19 @@ func TestDeleteSpiderList(t *testing.T) { var ids []primitive.ObjectID var taskIds []primitive.ObjectID for _, model := range modelList { - id, err := service.NewModelServiceV2[models.SpiderV2]().InsertOne(model) + id, err := service.NewModelService[models.SpiderV2]().InsertOne(model) require.Nil(t, err) ts := models.SpiderStatV2{} ts.SetId(id) - _, err = service.NewModelServiceV2[models.SpiderStatV2]().InsertOne(ts) + _, err = service.NewModelService[models.SpiderStatV2]().InsertOne(ts) require.Nil(t, err) task := models.TaskV2{} task.SpiderId = id - taskId, err := service.NewModelServiceV2[models.TaskV2]().InsertOne(task) + taskId, err := service.NewModelService[models.TaskV2]().InsertOne(task) require.Nil(t, err) taskStat := models.TaskStatV2{} taskStat.SetId(taskId) - _, err = service.NewModelServiceV2[models.TaskStatV2]().InsertOne(taskStat) + _, err = service.NewModelService[models.TaskStatV2]().InsertOne(taskStat) require.Nil(t, err) ids = append(ids, id) taskIds = append(taskIds, taskId) @@ -234,16 +234,16 @@ func TestDeleteSpiderList(t *testing.T) { assert.Equal(t, http.StatusOK, resp.Code) - spiderCount, err := service.NewModelServiceV2[models.SpiderV2]().Count(bson.M{"_id": bson.M{"$in": ids}}) + spiderCount, err := service.NewModelService[models.SpiderV2]().Count(bson.M{"_id": bson.M{"$in": ids}}) require.Nil(t, err) assert.Equal(t, 0, spiderCount) - spiderStatCount, err := service.NewModelServiceV2[models.SpiderStatV2]().Count(bson.M{"_id": bson.M{"$in": ids}}) + spiderStatCount, err := service.NewModelService[models.SpiderStatV2]().Count(bson.M{"_id": bson.M{"$in": ids}}) require.Nil(t, err) assert.Equal(t, 0, spiderStatCount) - taskCount, err := service.NewModelServiceV2[models.TaskV2]().Count(bson.M{"_id": bson.M{"$in": taskIds}}) + taskCount, err := service.NewModelService[models.TaskV2]().Count(bson.M{"_id": bson.M{"$in": taskIds}}) require.Nil(t, err) assert.Equal(t, 0, taskCount) - taskStatCount, err := service.NewModelServiceV2[models.TaskStatV2]().Count(bson.M{"_id": bson.M{"$in": taskIds}}) + taskStatCount, err := service.NewModelService[models.TaskStatV2]().Count(bson.M{"_id": bson.M{"$in": taskIds}}) require.Nil(t, err) assert.Equal(t, 0, taskStatCount) } diff --git a/core/controllers/task_v2.go b/core/controllers/task_v2.go index 2fb15252..926e9c35 100644 --- a/core/controllers/task_v2.go +++ b/core/controllers/task_v2.go @@ -32,7 +32,7 @@ func GetTaskById(c *gin.Context) { } // task - t, err := service.NewModelServiceV2[models.TaskV2]().GetById(id) + t, err := service.NewModelService[models.TaskV2]().GetById(id) if errors.Is(err, mongo2.ErrNoDocuments) { HandleErrorNotFound(c, err) return @@ -50,21 +50,21 @@ func GetTaskById(c *gin.Context) { // spider if !t.SpiderId.IsZero() { - t.Spider, _ = service.NewModelServiceV2[models.SpiderV2]().GetById(t.SpiderId) + t.Spider, _ = service.NewModelService[models.SpiderV2]().GetById(t.SpiderId) } // schedule if !t.ScheduleId.IsZero() { - t.Schedule, _ = service.NewModelServiceV2[models.ScheduleV2]().GetById(t.ScheduleId) + t.Schedule, _ = service.NewModelService[models.ScheduleV2]().GetById(t.ScheduleId) } // node if !t.NodeId.IsZero() { - t.Node, _ = service.NewModelServiceV2[models.NodeV2]().GetById(t.NodeId) + t.Node, _ = service.NewModelService[models.NodeV2]().GetById(t.NodeId) } // task stat - t.Stat, _ = service.NewModelServiceV2[models.TaskStatV2]().GetById(id) + t.Stat, _ = service.NewModelService[models.TaskStatV2]().GetById(id) HandleSuccessWithData(c, t) } @@ -82,7 +82,7 @@ func GetTaskList(c *gin.Context) { sort := MustGetSortOption(c) // get tasks - tasks, err := service.NewModelServiceV2[models.TaskV2]().GetMany(query, &mongo.FindOptions{ + tasks, err := service.NewModelService[models.TaskV2]().GetMany(query, &mongo.FindOptions{ Sort: sort, Skip: pagination.Size * (pagination.Page - 1), Limit: pagination.Size, @@ -111,14 +111,14 @@ func GetTaskList(c *gin.Context) { } // total count - total, err := service.NewModelServiceV2[models.TaskV2]().Count(query) + total, err := service.NewModelService[models.TaskV2]().Count(query) if err != nil { HandleErrorInternalServerError(c, err) return } // stat list - stats, err := service.NewModelServiceV2[models.TaskStatV2]().GetMany(bson.M{ + stats, err := service.NewModelService[models.TaskStatV2]().GetMany(bson.M{ "_id": bson.M{ "$in": taskIds, }, @@ -135,7 +135,7 @@ func GetTaskList(c *gin.Context) { } // spider list - spiders, err := service.NewModelServiceV2[models.SpiderV2]().GetMany(bson.M{ + spiders, err := service.NewModelService[models.SpiderV2]().GetMany(bson.M{ "_id": bson.M{ "$in": spiderIds, }, @@ -180,22 +180,22 @@ func DeleteTaskById(c *gin.Context) { // delete in db if err := mongo.RunTransaction(func(context mongo2.SessionContext) (err error) { // delete task - _, err = service.NewModelServiceV2[models.TaskV2]().GetById(id) + _, err = service.NewModelService[models.TaskV2]().GetById(id) if err != nil { return err } - err = service.NewModelServiceV2[models.TaskV2]().DeleteById(id) + err = service.NewModelService[models.TaskV2]().DeleteById(id) if err != nil { return err } // delete task stat - _, err = service.NewModelServiceV2[models.TaskStatV2]().GetById(id) + _, err = service.NewModelService[models.TaskStatV2]().GetById(id) if err != nil { log2.Warnf("delete task stat error: %s", err.Error()) return nil } - err = service.NewModelServiceV2[models.TaskStatV2]().DeleteById(id) + err = service.NewModelService[models.TaskStatV2]().DeleteById(id) if err != nil { log2.Warnf("delete task stat error: %s", err.Error()) return nil @@ -227,7 +227,7 @@ func DeleteList(c *gin.Context) { if err := mongo.RunTransaction(func(context mongo2.SessionContext) error { // delete tasks - if err := service.NewModelServiceV2[models.TaskV2]().DeleteMany(bson.M{ + if err := service.NewModelService[models.TaskV2]().DeleteMany(bson.M{ "_id": bson.M{ "$in": payload.Ids, }, @@ -236,7 +236,7 @@ func DeleteList(c *gin.Context) { } // delete task stats - if err := service.NewModelServiceV2[models.TaskV2]().DeleteMany(bson.M{ + if err := service.NewModelService[models.TaskV2]().DeleteMany(bson.M{ "_id": bson.M{ "$in": payload.Ids, }, @@ -284,7 +284,7 @@ func PostTaskRun(c *gin.Context) { } // spider - s, err := service.NewModelServiceV2[models.SpiderV2]().GetById(t.SpiderId) + s, err := service.NewModelService[models.SpiderV2]().GetById(t.SpiderId) if err != nil { HandleErrorInternalServerError(c, err) return @@ -329,7 +329,7 @@ func PostTaskRestart(c *gin.Context) { } // task - t, err := service.NewModelServiceV2[models.TaskV2]().GetById(id) + t, err := service.NewModelService[models.TaskV2]().GetById(id) if err != nil { HandleErrorInternalServerError(c, err) return @@ -384,7 +384,7 @@ func PostTaskCancel(c *gin.Context) { } // task - t, err := service.NewModelServiceV2[models.TaskV2]().GetById(id) + t, err := service.NewModelService[models.TaskV2]().GetById(id) if err != nil { HandleErrorInternalServerError(c, err) return diff --git a/core/controllers/token_v2.go b/core/controllers/token_v2.go index ae85cff1..daefc7a0 100644 --- a/core/controllers/token_v2.go +++ b/core/controllers/token_v2.go @@ -26,7 +26,7 @@ func PostToken(c *gin.Context) { HandleErrorInternalServerError(c, err) return } - _, err = service.NewModelServiceV2[models.TokenV2]().InsertOne(t) + _, err = service.NewModelService[models.TokenV2]().InsertOne(t) if err != nil { HandleErrorInternalServerError(c, err) return diff --git a/core/controllers/user_v2.go b/core/controllers/user_v2.go index b91a69ba..97a3edc1 100644 --- a/core/controllers/user_v2.go +++ b/core/controllers/user_v2.go @@ -28,13 +28,13 @@ func PostUser(c *gin.Context) { } model.SetCreated(u.Id) model.SetUpdated(u.Id) - id, err := service.NewModelServiceV2[models.UserV2]().InsertOne(model) + id, err := service.NewModelService[models.UserV2]().InsertOne(model) if err != nil { HandleErrorInternalServerError(c, err) return } - result, err := service.NewModelServiceV2[models.UserV2]().GetById(id) + result, err := service.NewModelService[models.UserV2]().GetById(id) if err != nil { HandleErrorInternalServerError(c, err) return @@ -63,7 +63,7 @@ func PostUserChangePassword(c *gin.Context) { // get user u := GetUserFromContext(c) - modelSvc := service.NewModelServiceV2[models.UserV2]() + modelSvc := service.NewModelService[models.UserV2]() // update password user, err := modelSvc.GetById(id) @@ -84,7 +84,7 @@ func PostUserChangePassword(c *gin.Context) { func GetUserMe(c *gin.Context) { u := GetUserFromContext(c) - _u, err := service.NewModelServiceV2[models.UserV2]().GetById(u.Id) + _u, err := service.NewModelService[models.UserV2]().GetById(u.Id) if err != nil { HandleErrorInternalServerError(c, err) return @@ -103,7 +103,7 @@ func PutUserById(c *gin.Context) { // get user u := GetUserFromContext(c) - modelSvc := service.NewModelServiceV2[models.UserV2]() + modelSvc := service.NewModelService[models.UserV2]() // update user userDb, err := modelSvc.GetById(u.Id) diff --git a/core/controllers/user_v2_test.go b/core/controllers/user_v2_test.go index 88901537..53a62f1e 100644 --- a/core/controllers/user_v2_test.go +++ b/core/controllers/user_v2_test.go @@ -17,7 +17,7 @@ func TestPostUserChangePassword_Success(t *testing.T) { SetupTestDB() defer CleanupTestDB() - modelSvc := service.NewModelServiceV2[models.UserV2]() + modelSvc := service.NewModelService[models.UserV2]() u := models.UserV2{} id, err := modelSvc.InsertOne(u) assert.Nil(t, err) @@ -43,7 +43,7 @@ func TestGetUserMe_Success(t *testing.T) { SetupTestDB() defer CleanupTestDB() - modelSvc := service.NewModelServiceV2[models.UserV2]() + modelSvc := service.NewModelService[models.UserV2]() u := models.UserV2{} id, err := modelSvc.InsertOne(u) assert.Nil(t, err) @@ -67,7 +67,7 @@ func TestPutUserById_Success(t *testing.T) { SetupTestDB() defer CleanupTestDB() - modelSvc := service.NewModelServiceV2[models.UserV2]() + modelSvc := service.NewModelService[models.UserV2]() u := models.UserV2{} id, err := modelSvc.InsertOne(u) assert.Nil(t, err) diff --git a/core/grpc/client/client.go b/core/grpc/client/client.go index 94d6d939..15e99cec 100644 --- a/core/grpc/client/client.go +++ b/core/grpc/client/client.go @@ -37,11 +37,11 @@ type GrpcClient struct { stop chan struct{} // clients - NodeClient grpc2.NodeServiceClient - TaskClient grpc2.TaskServiceClient - ModelBaseServiceV2Client grpc2.ModelBaseServiceV2Client - DependencyClient grpc2.DependencyServiceV2Client - MetricClient grpc2.MetricServiceV2Client + NodeClient grpc2.NodeServiceClient + TaskClient grpc2.TaskServiceClient + ModelBaseServiceClient grpc2.ModelBaseServiceClient + DependencyClient grpc2.DependencyServiceClient + MetricClient grpc2.MetricServiceClient } func (c *GrpcClient) Start() (err error) { @@ -84,10 +84,10 @@ func (c *GrpcClient) Stop() (err error) { func (c *GrpcClient) register() { c.NodeClient = grpc2.NewNodeServiceClient(c.conn) - c.ModelBaseServiceV2Client = grpc2.NewModelBaseServiceV2Client(c.conn) + c.ModelBaseServiceClient = grpc2.NewModelBaseServiceClient(c.conn) c.TaskClient = grpc2.NewTaskServiceClient(c.conn) - c.DependencyClient = grpc2.NewDependencyServiceV2Client(c.conn) - c.MetricClient = grpc2.NewMetricServiceV2Client(c.conn) + c.DependencyClient = grpc2.NewDependencyServiceClient(c.conn) + c.MetricClient = grpc2.NewMetricServiceClient(c.conn) } func (c *GrpcClient) Context() (ctx context.Context, cancel context.CancelFunc) { diff --git a/core/grpc/server/dependency_service_server.go b/core/grpc/server/dependency_service_server.go index 27f6d94c..c08f7218 100644 --- a/core/grpc/server/dependency_service_server.go +++ b/core/grpc/server/dependency_service_server.go @@ -18,12 +18,12 @@ import ( ) type DependencyServiceServer struct { - grpc.UnimplementedDependencyServiceV2Server + grpc.UnimplementedDependencyServiceServer mu *sync.Mutex - streams map[string]*grpc.DependencyServiceV2_ConnectServer + streams map[string]*grpc.DependencyService_ConnectServer } -func (svr DependencyServiceServer) Connect(req *grpc.DependencyServiceV2ConnectRequest, stream grpc.DependencyServiceV2_ConnectServer) (err error) { +func (svr DependencyServiceServer) Connect(req *grpc.DependencyServiceConnectRequest, stream grpc.DependencyService_ConnectServer) (err error) { svr.mu.Lock() svr.streams[req.NodeKey] = &stream svr.mu.Unlock() @@ -39,19 +39,19 @@ func (svr DependencyServiceServer) Connect(req *grpc.DependencyServiceV2ConnectR } } -func (svr DependencyServiceServer) Sync(ctx context.Context, request *grpc.DependencyServiceV2SyncRequest) (response *grpc.Response, err error) { - n, err := service.NewModelServiceV2[models2.NodeV2]().GetOne(bson.M{"key": request.NodeKey}, nil) +func (svr DependencyServiceServer) Sync(ctx context.Context, request *grpc.DependencyServiceSyncRequest) (response *grpc.Response, err error) { + n, err := service.NewModelService[models2.NodeV2]().GetOne(bson.M{"key": request.NodeKey}, nil) if err != nil { return nil, err } - depsDb, err := service.NewModelServiceV2[models2.DependencyV2]().GetMany(bson.M{ + depsDb, err := service.NewModelService[models2.DependencyV2]().GetMany(bson.M{ "node_id": n.Id, "type": request.Lang, }, nil) if err != nil { if !errors.Is(err, mongo.ErrNoDocuments) { - log.Errorf("[DependencyServiceV2] get dependencies from db error: %v", err) + log.Errorf("[DependencyService] get dependencies from db error: %v", err) return nil, err } } @@ -90,7 +90,7 @@ func (svr DependencyServiceServer) Sync(ctx context.Context, request *grpc.Depen err = mongo2.RunTransaction(func(ctx mongo.SessionContext) (err error) { if len(depIdsToDelete) > 0 { - err = service.NewModelServiceV2[models2.DependencyV2]().DeleteMany(bson.M{ + err = service.NewModelService[models2.DependencyV2]().DeleteMany(bson.M{ "_id": bson.M{"$in": depIdsToDelete}, }) if err != nil { @@ -101,7 +101,7 @@ func (svr DependencyServiceServer) Sync(ctx context.Context, request *grpc.Depen } if len(depsToInsert) > 0 { - _, err = service.NewModelServiceV2[models2.DependencyV2]().InsertMany(depsToInsert) + _, err = service.NewModelService[models2.DependencyV2]().InsertMany(depsToInsert) if err != nil { log.Errorf("[DependencyServiceServer] insert dependencies in db error: %v", err) trace.PrintError(err) @@ -115,7 +115,7 @@ func (svr DependencyServiceServer) Sync(ctx context.Context, request *grpc.Depen return nil, err } -func (svr DependencyServiceServer) UpdateTaskLog(stream grpc.DependencyServiceV2_UpdateTaskLogServer) (err error) { +func (svr DependencyServiceServer) UpdateTaskLog(stream grpc.DependencyService_UpdateTaskLogServer) (err error) { var t *models2.DependencyTaskV2 for { req, err := stream.Recv() @@ -131,7 +131,7 @@ func (svr DependencyServiceServer) UpdateTaskLog(stream grpc.DependencyServiceV2 return err } if t == nil { - t, err = service.NewModelServiceV2[models2.DependencyTaskV2]().GetById(taskId) + t, err = service.NewModelService[models2.DependencyTaskV2]().GetById(taskId) if err != nil { return err } @@ -145,14 +145,14 @@ func (svr DependencyServiceServer) UpdateTaskLog(stream grpc.DependencyServiceV2 l.SetCreated(t.CreatedBy) logs = append(logs, l) } - _, err = service.NewModelServiceV2[models2.DependencyLogV2]().InsertMany(logs) + _, err = service.NewModelService[models2.DependencyLogV2]().InsertMany(logs) if err != nil { return err } } } -func (svr DependencyServiceServer) GetStream(key string) (stream *grpc.DependencyServiceV2_ConnectServer, err error) { +func (svr DependencyServiceServer) GetStream(key string) (stream *grpc.DependencyService_ConnectServer, err error) { svr.mu.Lock() defer svr.mu.Unlock() stream, ok := svr.streams[key] @@ -165,7 +165,7 @@ func (svr DependencyServiceServer) GetStream(key string) (stream *grpc.Dependenc func NewDependencyServerV2() *DependencyServiceServer { return &DependencyServiceServer{ mu: new(sync.Mutex), - streams: make(map[string]*grpc.DependencyServiceV2_ConnectServer), + streams: make(map[string]*grpc.DependencyService_ConnectServer), } } diff --git a/core/grpc/server/metric_service_server.go b/core/grpc/server/metric_service_server.go index e36ef0c0..95ef78e1 100644 --- a/core/grpc/server/metric_service_server.go +++ b/core/grpc/server/metric_service_server.go @@ -12,12 +12,12 @@ import ( ) type MetricServiceServer struct { - grpc.UnimplementedMetricServiceV2Server + grpc.UnimplementedMetricServiceServer } -func (svr MetricServiceServer) Send(_ context.Context, req *grpc.MetricServiceV2SendRequest) (res *grpc.Response, err error) { +func (svr MetricServiceServer) Send(_ context.Context, req *grpc.MetricServiceSendRequest) (res *grpc.Response, err error) { log.Info("[MetricServiceServer] received metric from node: " + req.NodeKey) - n, err := service.NewModelServiceV2[models2.NodeV2]().GetOne(bson.M{"key": req.NodeKey}, nil) + n, err := service.NewModelService[models2.NodeV2]().GetOne(bson.M{"key": req.NodeKey}, nil) if err != nil { log.Errorf("[MetricServiceServer] error getting node: %v", err) return HandleError(err) @@ -40,7 +40,7 @@ func (svr MetricServiceServer) Send(_ context.Context, req *grpc.MetricServiceV2 NetworkBytesRecvRate: req.NetworkBytesRecvRate, } metric.CreatedAt = time.Unix(req.Timestamp, 0) - _, err = service.NewModelServiceV2[models2.MetricV2]().InsertOne(metric) + _, err = service.NewModelService[models2.MetricV2]().InsertOne(metric) if err != nil { log.Errorf("[MetricServiceServer] error inserting metric: %v", err) return HandleError(err) diff --git a/core/grpc/server/model_base_service_v2_server.go b/core/grpc/server/model_base_service_server.go similarity index 72% rename from core/grpc/server/model_base_service_v2_server.go rename to core/grpc/server/model_base_service_server.go index dbadbaf8..46882984 100644 --- a/core/grpc/server/model_base_service_v2_server.go +++ b/core/grpc/server/model_base_service_server.go @@ -33,16 +33,16 @@ func GetOneInstanceModel(typeName string) any { return typeOneNameModelMap[typeName] } -type ModelBaseServiceServerV2 struct { - grpc.UnimplementedModelBaseServiceV2Server +type ModelBaseServiceServer struct { + grpc.UnimplementedModelBaseServiceServer } -func (svr ModelBaseServiceServerV2) GetById(_ context.Context, req *grpc.ModelServiceV2GetByIdRequest) (res *grpc.Response, err error) { +func (svr ModelBaseServiceServer) GetById(_ context.Context, req *grpc.ModelServiceGetByIdRequest) (res *grpc.Response, err error) { id, err := primitive.ObjectIDFromHex(req.Id) if err != nil { return HandleError(err) } - modelSvc := service.NewModelServiceV2WithColName[bson.M](typeNameColNameMap[req.ModelType]) + modelSvc := service.NewModelServiceWithColName[bson.M](typeNameColNameMap[req.ModelType]) data, err := modelSvc.GetById(id) if err != nil { return HandleError(err) @@ -50,7 +50,7 @@ func (svr ModelBaseServiceServerV2) GetById(_ context.Context, req *grpc.ModelSe return HandleSuccessWithData(data) } -func (svr ModelBaseServiceServerV2) GetOne(_ context.Context, req *grpc.ModelServiceV2GetOneRequest) (res *grpc.Response, err error) { +func (svr ModelBaseServiceServer) GetOne(_ context.Context, req *grpc.ModelServiceGetOneRequest) (res *grpc.Response, err error) { var query bson.M err = json.Unmarshal(req.Query, &query) if err != nil { @@ -61,7 +61,7 @@ func (svr ModelBaseServiceServerV2) GetOne(_ context.Context, req *grpc.ModelSer if err != nil { return HandleError(err) } - modelSvc := service.NewModelServiceV2WithColName[bson.M](typeNameColNameMap[req.ModelType]) + modelSvc := service.NewModelServiceWithColName[bson.M](typeNameColNameMap[req.ModelType]) data, err := modelSvc.GetOne(query, &options) if err != nil { return HandleError(err) @@ -69,7 +69,7 @@ func (svr ModelBaseServiceServerV2) GetOne(_ context.Context, req *grpc.ModelSer return HandleSuccessWithData(data) } -func (svr ModelBaseServiceServerV2) GetMany(_ context.Context, req *grpc.ModelServiceV2GetManyRequest) (res *grpc.Response, err error) { +func (svr ModelBaseServiceServer) GetMany(_ context.Context, req *grpc.ModelServiceGetManyRequest) (res *grpc.Response, err error) { var query bson.M err = json.Unmarshal(req.Query, &query) if err != nil { @@ -80,7 +80,7 @@ func (svr ModelBaseServiceServerV2) GetMany(_ context.Context, req *grpc.ModelSe if err != nil { return HandleError(err) } - modelSvc := service.NewModelServiceV2WithColName[bson.M](typeNameColNameMap[req.ModelType]) + modelSvc := service.NewModelServiceWithColName[bson.M](typeNameColNameMap[req.ModelType]) data, err := modelSvc.GetMany(query, &options) if err != nil { return HandleError(err) @@ -88,7 +88,7 @@ func (svr ModelBaseServiceServerV2) GetMany(_ context.Context, req *grpc.ModelSe return HandleSuccessWithData(data) } -func (svr ModelBaseServiceServerV2) DeleteById(_ context.Context, req *grpc.ModelServiceV2DeleteByIdRequest) (res *grpc.Response, err error) { +func (svr ModelBaseServiceServer) DeleteById(_ context.Context, req *grpc.ModelServiceDeleteByIdRequest) (res *grpc.Response, err error) { id, err := primitive.ObjectIDFromHex(req.Id) if err != nil { return HandleError(err) @@ -101,7 +101,7 @@ func (svr ModelBaseServiceServerV2) DeleteById(_ context.Context, req *grpc.Mode return HandleSuccess() } -func (svr ModelBaseServiceServerV2) DeleteOne(_ context.Context, req *grpc.ModelServiceV2DeleteOneRequest) (res *grpc.Response, err error) { +func (svr ModelBaseServiceServer) DeleteOne(_ context.Context, req *grpc.ModelServiceDeleteOneRequest) (res *grpc.Response, err error) { var query bson.M err = json.Unmarshal(req.Query, &query) if err != nil { @@ -115,7 +115,7 @@ func (svr ModelBaseServiceServerV2) DeleteOne(_ context.Context, req *grpc.Model return HandleSuccess() } -func (svr ModelBaseServiceServerV2) DeleteMany(_ context.Context, req *grpc.ModelServiceV2DeleteManyRequest) (res *grpc.Response, err error) { +func (svr ModelBaseServiceServer) DeleteMany(_ context.Context, req *grpc.ModelServiceDeleteManyRequest) (res *grpc.Response, err error) { var query bson.M err = json.Unmarshal(req.Query, &query) if err != nil { @@ -129,7 +129,7 @@ func (svr ModelBaseServiceServerV2) DeleteMany(_ context.Context, req *grpc.Mode return HandleSuccess() } -func (svr ModelBaseServiceServerV2) UpdateById(_ context.Context, req *grpc.ModelServiceV2UpdateByIdRequest) (res *grpc.Response, err error) { +func (svr ModelBaseServiceServer) UpdateById(_ context.Context, req *grpc.ModelServiceUpdateByIdRequest) (res *grpc.Response, err error) { id, err := primitive.ObjectIDFromHex(req.Id) if err != nil { return HandleError(err) @@ -147,7 +147,7 @@ func (svr ModelBaseServiceServerV2) UpdateById(_ context.Context, req *grpc.Mode return HandleSuccess() } -func (svr ModelBaseServiceServerV2) UpdateOne(_ context.Context, req *grpc.ModelServiceV2UpdateOneRequest) (res *grpc.Response, err error) { +func (svr ModelBaseServiceServer) UpdateOne(_ context.Context, req *grpc.ModelServiceUpdateOneRequest) (res *grpc.Response, err error) { var query bson.M err = json.Unmarshal(req.Query, &query) if err != nil { @@ -166,7 +166,7 @@ func (svr ModelBaseServiceServerV2) UpdateOne(_ context.Context, req *grpc.Model return HandleSuccess() } -func (svr ModelBaseServiceServerV2) UpdateMany(_ context.Context, req *grpc.ModelServiceV2UpdateManyRequest) (res *grpc.Response, err error) { +func (svr ModelBaseServiceServer) UpdateMany(_ context.Context, req *grpc.ModelServiceUpdateManyRequest) (res *grpc.Response, err error) { var query bson.M err = json.Unmarshal(req.Query, &query) if err != nil { @@ -185,7 +185,7 @@ func (svr ModelBaseServiceServerV2) UpdateMany(_ context.Context, req *grpc.Mode return HandleSuccess() } -func (svr ModelBaseServiceServerV2) ReplaceById(_ context.Context, req *grpc.ModelServiceV2ReplaceByIdRequest) (res *grpc.Response, err error) { +func (svr ModelBaseServiceServer) ReplaceById(_ context.Context, req *grpc.ModelServiceReplaceByIdRequest) (res *grpc.Response, err error) { id, err := primitive.ObjectIDFromHex(req.Id) if err != nil { return HandleError(err) @@ -205,7 +205,7 @@ func (svr ModelBaseServiceServerV2) ReplaceById(_ context.Context, req *grpc.Mod return HandleSuccess() } -func (svr ModelBaseServiceServerV2) ReplaceOne(_ context.Context, req *grpc.ModelServiceV2ReplaceOneRequest) (res *grpc.Response, err error) { +func (svr ModelBaseServiceServer) ReplaceOne(_ context.Context, req *grpc.ModelServiceReplaceOneRequest) (res *grpc.Response, err error) { var query bson.M err = json.Unmarshal(req.Query, &query) if err != nil { @@ -226,7 +226,7 @@ func (svr ModelBaseServiceServerV2) ReplaceOne(_ context.Context, req *grpc.Mode return HandleSuccess() } -func (svr ModelBaseServiceServerV2) InsertOne(_ context.Context, req *grpc.ModelServiceV2InsertOneRequest) (res *grpc.Response, err error) { +func (svr ModelBaseServiceServer) InsertOne(_ context.Context, req *grpc.ModelServiceInsertOneRequest) (res *grpc.Response, err error) { model := GetOneInstanceModel(req.ModelType) modelType := reflect.TypeOf(model) modelValuePtr := reflect.New(modelType).Interface() @@ -242,7 +242,7 @@ func (svr ModelBaseServiceServerV2) InsertOne(_ context.Context, req *grpc.Model return HandleSuccessWithData(r.InsertedID) } -func (svr ModelBaseServiceServerV2) InsertMany(_ context.Context, req *grpc.ModelServiceV2InsertManyRequest) (res *grpc.Response, err error) { +func (svr ModelBaseServiceServer) InsertMany(_ context.Context, req *grpc.ModelServiceInsertManyRequest) (res *grpc.Response, err error) { model := GetOneInstanceModel(req.ModelType) modelType := reflect.TypeOf(model) modelsSliceType := reflect.SliceOf(modelType) @@ -268,7 +268,7 @@ func (svr ModelBaseServiceServerV2) InsertMany(_ context.Context, req *grpc.Mode return HandleSuccessWithData(r.InsertedIDs) } -func (svr ModelBaseServiceServerV2) Count(_ context.Context, req *grpc.ModelServiceV2CountRequest) (res *grpc.Response, err error) { +func (svr ModelBaseServiceServer) Count(_ context.Context, req *grpc.ModelServiceCountRequest) (res *grpc.Response, err error) { var query bson.M err = json.Unmarshal(req.Query, &query) if err != nil { @@ -281,10 +281,10 @@ func (svr ModelBaseServiceServerV2) Count(_ context.Context, req *grpc.ModelServ return HandleSuccessWithData(count) } -func GetModelService[T any](typeName string) *service.ModelServiceV2[T] { - return service.NewModelServiceV2WithColName[T](typeNameColNameMap[typeName]) +func GetModelService[T any](typeName string) *service.ModelService[T] { + return service.NewModelServiceWithColName[T](typeNameColNameMap[typeName]) } -func NewModelBaseServiceV2Server() *ModelBaseServiceServerV2 { - return &ModelBaseServiceServerV2{} +func NewModelBaseServiceServer() *ModelBaseServiceServer { + return &ModelBaseServiceServer{} } diff --git a/core/grpc/server/node_service_server.go b/core/grpc/server/node_service_server.go index 661aef6f..46aa42eb 100644 --- a/core/grpc/server/node_service_server.go +++ b/core/grpc/server/node_service_server.go @@ -41,13 +41,13 @@ func (svr NodeServiceServer) Register(_ context.Context, req *grpc.NodeServiceRe // find in db var node *models.NodeV2 - node, err = service.NewModelServiceV2[models.NodeV2]().GetOne(bson.M{"key": req.NodeKey}, nil) + node, err = service.NewModelService[models.NodeV2]().GetOne(bson.M{"key": req.NodeKey}, nil) if err == nil { // register existing node.Status = constants.NodeStatusOnline node.Active = true node.ActiveAt = time.Now() - err = service.NewModelServiceV2[models.NodeV2]().ReplaceById(node.Id, *node) + err = service.NewModelService[models.NodeV2]().ReplaceById(node.Id, *node) if err != nil { return HandleError(err) } @@ -65,7 +65,7 @@ func (svr NodeServiceServer) Register(_ context.Context, req *grpc.NodeServiceRe } node.SetCreated(primitive.NilObjectID) node.SetUpdated(primitive.NilObjectID) - node.Id, err = service.NewModelServiceV2[models.NodeV2]().InsertOne(*node) + node.Id, err = service.NewModelService[models.NodeV2]().InsertOne(*node) if err != nil { return HandleError(err) } @@ -83,7 +83,7 @@ func (svr NodeServiceServer) Register(_ context.Context, req *grpc.NodeServiceRe // SendHeartbeat from worker to master func (svr NodeServiceServer) SendHeartbeat(_ context.Context, req *grpc.NodeServiceSendHeartbeatRequest) (res *grpc.Response, err error) { // find in db - node, err := service.NewModelServiceV2[models.NodeV2]().GetOne(bson.M{"key": req.NodeKey}, nil) + node, err := service.NewModelService[models.NodeV2]().GetOne(bson.M{"key": req.NodeKey}, nil) if err != nil { if errors2.Is(err, mongo.ErrNoDocuments) { return HandleError(errors.ErrorNodeNotExists) @@ -96,7 +96,7 @@ func (svr NodeServiceServer) SendHeartbeat(_ context.Context, req *grpc.NodeServ node.Status = constants.NodeStatusOnline node.Active = true node.ActiveAt = time.Now() - err = service.NewModelServiceV2[models.NodeV2]().ReplaceById(node.Id, *node) + err = service.NewModelService[models.NodeV2]().ReplaceById(node.Id, *node) if err != nil { return HandleError(err) } @@ -116,7 +116,7 @@ func (svr NodeServiceServer) Subscribe(request *grpc.NodeServiceSubscribeRequest log.Infof("[NodeServiceServer] master received subscribe request from node[%s]", request.NodeKey) // find in db - node, err := service.NewModelServiceV2[models.NodeV2]().GetOne(bson.M{"key": request.NodeKey}, nil) + node, err := service.NewModelService[models.NodeV2]().GetOne(bson.M{"key": request.NodeKey}, nil) if err != nil { log.Errorf("[NodeServiceServer] error getting node: %v", err) return err diff --git a/core/grpc/server/server.go b/core/grpc/server/server.go index 9dea9db1..5915390c 100644 --- a/core/grpc/server/server.go +++ b/core/grpc/server/server.go @@ -34,7 +34,7 @@ type GrpcServer struct { // servers NodeSvr *NodeServiceServer TaskSvr *TaskServiceServer - ModelBaseServiceSvr *ModelBaseServiceServerV2 + ModelBaseServiceSvr *ModelBaseServiceServer DependencySvr *DependencyServiceServer MetricSvr *MetricServiceServer } @@ -106,10 +106,10 @@ func (svr *GrpcServer) Stop() (err error) { func (svr *GrpcServer) register() (err error) { grpc2.RegisterNodeServiceServer(svr.svr, *svr.NodeSvr) - grpc2.RegisterModelBaseServiceV2Server(svr.svr, *svr.ModelBaseServiceSvr) + grpc2.RegisterModelBaseServiceServer(svr.svr, *svr.ModelBaseServiceSvr) grpc2.RegisterTaskServiceServer(svr.svr, *svr.TaskSvr) - grpc2.RegisterDependencyServiceV2Server(svr.svr, *svr.DependencySvr) - grpc2.RegisterMetricServiceV2Server(svr.svr, *svr.MetricSvr) + grpc2.RegisterDependencyServiceServer(svr.svr, *svr.DependencySvr) + grpc2.RegisterMetricServiceServer(svr.svr, *svr.MetricSvr) return nil } @@ -141,7 +141,7 @@ func NewGrpcServer() (svr *GrpcServer, err error) { if err != nil { return nil, err } - svr.ModelBaseServiceSvr = NewModelBaseServiceV2Server() + svr.ModelBaseServiceSvr = NewModelBaseServiceServer() svr.TaskSvr, err = NewTaskServiceServer() if err != nil { return nil, err diff --git a/core/grpc/server/task_service_server.go b/core/grpc/server/task_service_server.go index 7800c6ad..6d587215 100644 --- a/core/grpc/server/task_service_server.go +++ b/core/grpc/server/task_service_server.go @@ -110,7 +110,7 @@ func (svr TaskServiceServer) FetchTask(ctx context.Context, request *grpc.TaskSe if nodeKey == "" { return nil, errors.New("invalid node key") } - n, err := service.NewModelServiceV2[models2.NodeV2]().GetOne(bson.M{"key": nodeKey}, nil) + n, err := service.NewModelService[models2.NodeV2]().GetOne(bson.M{"key": nodeKey}, nil) if err != nil { return nil, trace.TraceError(err) } @@ -124,7 +124,7 @@ func (svr TaskServiceServer) FetchTask(ctx context.Context, request *grpc.TaskSe } if err := mongo.RunTransactionWithContext(ctx, func(sc mongo2.SessionContext) (err error) { // fetch task for the given node - t, err := service.NewModelServiceV2[models2.TaskV2]().GetOne(bson.M{ + t, err := service.NewModelService[models2.TaskV2]().GetOne(bson.M{ "node_id": n.Id, "status": constants.TaskStatusPending, }, opts) @@ -138,7 +138,7 @@ func (svr TaskServiceServer) FetchTask(ctx context.Context, request *grpc.TaskSe } // fetch task for any node - t, err = service.NewModelServiceV2[models2.TaskV2]().GetOne(bson.M{ + t, err = service.NewModelService[models2.TaskV2]().GetOne(bson.M{ "node_id": primitive.NilObjectID, "status": constants.TaskStatusPending, }, opts) @@ -177,7 +177,7 @@ func (svr TaskServiceServer) SendNotification(_ context.Context, request *grpc.T var args []any // task - task, err := service.NewModelServiceV2[models2.TaskV2]().GetById(taskId) + task, err := service.NewModelService[models2.TaskV2]().GetById(taskId) if err != nil { log.Errorf("task not found: %s", request.TaskId) return nil, trace.TraceError(err) @@ -185,7 +185,7 @@ func (svr TaskServiceServer) SendNotification(_ context.Context, request *grpc.T args = append(args, task) // task stat - taskStat, err := service.NewModelServiceV2[models2.TaskStatV2]().GetById(task.Id) + taskStat, err := service.NewModelService[models2.TaskStatV2]().GetById(task.Id) if err != nil { log.Errorf("task stat not found for task: %s", request.TaskId) return nil, trace.TraceError(err) @@ -193,7 +193,7 @@ func (svr TaskServiceServer) SendNotification(_ context.Context, request *grpc.T args = append(args, taskStat) // spider - spider, err := service.NewModelServiceV2[models2.SpiderV2]().GetById(task.SpiderId) + spider, err := service.NewModelService[models2.SpiderV2]().GetById(task.SpiderId) if err != nil { log.Errorf("spider not found for task: %s", request.TaskId) return nil, trace.TraceError(err) @@ -201,7 +201,7 @@ func (svr TaskServiceServer) SendNotification(_ context.Context, request *grpc.T args = append(args, spider) // node - node, err := service.NewModelServiceV2[models2.NodeV2]().GetById(task.NodeId) + node, err := service.NewModelService[models2.NodeV2]().GetById(task.NodeId) if err != nil { return nil, trace.TraceError(err) } @@ -210,7 +210,7 @@ func (svr TaskServiceServer) SendNotification(_ context.Context, request *grpc.T // schedule var schedule *models2.ScheduleV2 if !task.ScheduleId.IsZero() { - schedule, err = service.NewModelServiceV2[models2.ScheduleV2]().GetById(task.ScheduleId) + schedule, err = service.NewModelService[models2.ScheduleV2]().GetById(task.ScheduleId) if err != nil { log.Errorf("schedule not found for task: %s", request.TaskId) return nil, trace.TraceError(err) @@ -219,7 +219,7 @@ func (svr TaskServiceServer) SendNotification(_ context.Context, request *grpc.T } // settings - settings, err := service.NewModelServiceV2[models2.NotificationSettingV2]().GetMany(bson.M{ + settings, err := service.NewModelService[models2.NotificationSettingV2]().GetMany(bson.M{ "enabled": true, "trigger": bson.M{ "$regex": constants.NotificationTriggerPatternTask, @@ -288,7 +288,7 @@ func (svr TaskServiceServer) handleInsertLogs(taskId primitive.ObjectID, msg *gr func (svr TaskServiceServer) saveTask(t *models2.TaskV2) (err error) { t.SetUpdated(t.CreatedBy) - return service.NewModelServiceV2[models2.TaskV2]().ReplaceById(t.Id, *t) + return service.NewModelService[models2.TaskV2]().ReplaceById(t.Id, *t) } func NewTaskServiceServer() (res *TaskServiceServer, err error) { diff --git a/core/middlewares/auth_v2.go b/core/middlewares/auth_v2.go index bb19def9..fb9ccea3 100644 --- a/core/middlewares/auth_v2.go +++ b/core/middlewares/auth_v2.go @@ -17,7 +17,7 @@ func AuthorizationMiddlewareV2() gin.HandlerFunc { return func(c *gin.Context) { // disable auth for test if viper.GetBool("auth.disabled") { - u, err := service.NewModelServiceV2[models.UserV2]().GetOne(bson.M{"username": constants.DefaultAdminUsername}, nil) + u, err := service.NewModelService[models.UserV2]().GetOne(bson.M{"username": constants.DefaultAdminUsername}, nil) if err != nil { utils.HandleErrorInternalServerError(c, err) return diff --git a/core/models/client/model_service_v2.go b/core/models/client/model_service.go similarity index 66% rename from core/models/client/model_service_v2.go rename to core/models/client/model_service.go index 4d5d236e..acb8560d 100644 --- a/core/models/client/model_service_v2.go +++ b/core/models/client/model_service.go @@ -19,16 +19,16 @@ var ( mu sync.Mutex ) -type ModelServiceV2[T any] struct { +type ModelService[T any] struct { cfg interfaces.NodeConfigService c *client.GrpcClient modelType string } -func (svc *ModelServiceV2[T]) GetById(id primitive.ObjectID) (model *T, err error) { +func (svc *ModelService[T]) GetById(id primitive.ObjectID) (model *T, err error) { ctx, cancel := svc.c.Context() defer cancel() - res, err := svc.c.ModelBaseServiceV2Client.GetById(ctx, &grpc.ModelServiceV2GetByIdRequest{ + res, err := svc.c.ModelBaseServiceClient.GetById(ctx, &grpc.ModelServiceGetByIdRequest{ NodeKey: svc.cfg.GetNodeKey(), ModelType: svc.modelType, Id: id.Hex(), @@ -39,7 +39,7 @@ func (svc *ModelServiceV2[T]) GetById(id primitive.ObjectID) (model *T, err erro return svc.deserializeOne(res) } -func (svc *ModelServiceV2[T]) GetOne(query bson.M, options *mongo.FindOptions) (model *T, err error) { +func (svc *ModelService[T]) GetOne(query bson.M, options *mongo.FindOptions) (model *T, err error) { ctx, cancel := svc.c.Context() defer cancel() queryData, err := json.Marshal(query) @@ -50,7 +50,7 @@ func (svc *ModelServiceV2[T]) GetOne(query bson.M, options *mongo.FindOptions) ( if err != nil { return nil, err } - res, err := svc.c.ModelBaseServiceV2Client.GetOne(ctx, &grpc.ModelServiceV2GetOneRequest{ + res, err := svc.c.ModelBaseServiceClient.GetOne(ctx, &grpc.ModelServiceGetOneRequest{ NodeKey: svc.cfg.GetNodeKey(), ModelType: svc.modelType, Query: queryData, @@ -62,7 +62,7 @@ func (svc *ModelServiceV2[T]) GetOne(query bson.M, options *mongo.FindOptions) ( return svc.deserializeOne(res) } -func (svc *ModelServiceV2[T]) GetMany(query bson.M, options *mongo.FindOptions) (models []T, err error) { +func (svc *ModelService[T]) GetMany(query bson.M, options *mongo.FindOptions) (models []T, err error) { ctx, cancel := svc.c.Context() defer cancel() queryData, err := json.Marshal(query) @@ -73,7 +73,7 @@ func (svc *ModelServiceV2[T]) GetMany(query bson.M, options *mongo.FindOptions) if err != nil { return nil, err } - res, err := svc.c.ModelBaseServiceV2Client.GetMany(ctx, &grpc.ModelServiceV2GetManyRequest{ + res, err := svc.c.ModelBaseServiceClient.GetMany(ctx, &grpc.ModelServiceGetManyRequest{ NodeKey: svc.cfg.GetNodeKey(), ModelType: svc.modelType, Query: queryData, @@ -85,10 +85,10 @@ func (svc *ModelServiceV2[T]) GetMany(query bson.M, options *mongo.FindOptions) return svc.deserializeMany(res) } -func (svc *ModelServiceV2[T]) DeleteById(id primitive.ObjectID) (err error) { +func (svc *ModelService[T]) DeleteById(id primitive.ObjectID) (err error) { ctx, cancel := svc.c.Context() defer cancel() - _, err = svc.c.ModelBaseServiceV2Client.DeleteById(ctx, &grpc.ModelServiceV2DeleteByIdRequest{ + _, err = svc.c.ModelBaseServiceClient.DeleteById(ctx, &grpc.ModelServiceDeleteByIdRequest{ NodeKey: svc.cfg.GetNodeKey(), ModelType: svc.modelType, Id: id.Hex(), @@ -99,14 +99,14 @@ func (svc *ModelServiceV2[T]) DeleteById(id primitive.ObjectID) (err error) { return nil } -func (svc *ModelServiceV2[T]) DeleteOne(query bson.M) (err error) { +func (svc *ModelService[T]) DeleteOne(query bson.M) (err error) { ctx, cancel := svc.c.Context() defer cancel() queryData, err := json.Marshal(query) if err != nil { return err } - _, err = svc.c.ModelBaseServiceV2Client.DeleteOne(ctx, &grpc.ModelServiceV2DeleteOneRequest{ + _, err = svc.c.ModelBaseServiceClient.DeleteOne(ctx, &grpc.ModelServiceDeleteOneRequest{ NodeKey: svc.cfg.GetNodeKey(), ModelType: svc.modelType, Query: queryData, @@ -117,14 +117,14 @@ func (svc *ModelServiceV2[T]) DeleteOne(query bson.M) (err error) { return nil } -func (svc *ModelServiceV2[T]) DeleteMany(query bson.M) (err error) { +func (svc *ModelService[T]) DeleteMany(query bson.M) (err error) { ctx, cancel := svc.c.Context() defer cancel() queryData, err := json.Marshal(query) if err != nil { return err } - _, err = svc.c.ModelBaseServiceV2Client.DeleteMany(ctx, &grpc.ModelServiceV2DeleteManyRequest{ + _, err = svc.c.ModelBaseServiceClient.DeleteMany(ctx, &grpc.ModelServiceDeleteManyRequest{ NodeKey: svc.cfg.GetNodeKey(), ModelType: svc.modelType, Query: queryData, @@ -135,14 +135,14 @@ func (svc *ModelServiceV2[T]) DeleteMany(query bson.M) (err error) { return nil } -func (svc *ModelServiceV2[T]) UpdateById(id primitive.ObjectID, update bson.M) (err error) { +func (svc *ModelService[T]) UpdateById(id primitive.ObjectID, update bson.M) (err error) { ctx, cancel := svc.c.Context() defer cancel() updateData, err := json.Marshal(update) if err != nil { return err } - _, err = svc.c.ModelBaseServiceV2Client.UpdateById(ctx, &grpc.ModelServiceV2UpdateByIdRequest{ + _, err = svc.c.ModelBaseServiceClient.UpdateById(ctx, &grpc.ModelServiceUpdateByIdRequest{ NodeKey: svc.cfg.GetNodeKey(), ModelType: svc.modelType, Id: id.Hex(), @@ -154,7 +154,7 @@ func (svc *ModelServiceV2[T]) UpdateById(id primitive.ObjectID, update bson.M) ( return nil } -func (svc *ModelServiceV2[T]) UpdateOne(query bson.M, update bson.M) (err error) { +func (svc *ModelService[T]) UpdateOne(query bson.M, update bson.M) (err error) { ctx, cancel := svc.c.Context() defer cancel() queryData, err := json.Marshal(query) @@ -165,7 +165,7 @@ func (svc *ModelServiceV2[T]) UpdateOne(query bson.M, update bson.M) (err error) if err != nil { return err } - _, err = svc.c.ModelBaseServiceV2Client.UpdateOne(ctx, &grpc.ModelServiceV2UpdateOneRequest{ + _, err = svc.c.ModelBaseServiceClient.UpdateOne(ctx, &grpc.ModelServiceUpdateOneRequest{ NodeKey: svc.cfg.GetNodeKey(), ModelType: svc.modelType, Query: queryData, @@ -177,7 +177,7 @@ func (svc *ModelServiceV2[T]) UpdateOne(query bson.M, update bson.M) (err error) return nil } -func (svc *ModelServiceV2[T]) UpdateMany(query bson.M, update bson.M) (err error) { +func (svc *ModelService[T]) UpdateMany(query bson.M, update bson.M) (err error) { ctx, cancel := svc.c.Context() defer cancel() queryData, err := json.Marshal(query) @@ -188,7 +188,7 @@ func (svc *ModelServiceV2[T]) UpdateMany(query bson.M, update bson.M) (err error if err != nil { return err } - _, err = svc.c.ModelBaseServiceV2Client.UpdateMany(ctx, &grpc.ModelServiceV2UpdateManyRequest{ + _, err = svc.c.ModelBaseServiceClient.UpdateMany(ctx, &grpc.ModelServiceUpdateManyRequest{ NodeKey: svc.cfg.GetNodeKey(), ModelType: svc.modelType, Query: queryData, @@ -197,14 +197,14 @@ func (svc *ModelServiceV2[T]) UpdateMany(query bson.M, update bson.M) (err error return nil } -func (svc *ModelServiceV2[T]) ReplaceById(id primitive.ObjectID, model T) (err error) { +func (svc *ModelService[T]) ReplaceById(id primitive.ObjectID, model T) (err error) { ctx, cancel := svc.c.Context() defer cancel() modelData, err := json.Marshal(model) if err != nil { return err } - _, err = svc.c.ModelBaseServiceV2Client.ReplaceById(ctx, &grpc.ModelServiceV2ReplaceByIdRequest{ + _, err = svc.c.ModelBaseServiceClient.ReplaceById(ctx, &grpc.ModelServiceReplaceByIdRequest{ NodeKey: svc.cfg.GetNodeKey(), ModelType: svc.modelType, Id: id.Hex(), @@ -216,7 +216,7 @@ func (svc *ModelServiceV2[T]) ReplaceById(id primitive.ObjectID, model T) (err e return nil } -func (svc *ModelServiceV2[T]) ReplaceOne(query bson.M, model T) (err error) { +func (svc *ModelService[T]) ReplaceOne(query bson.M, model T) (err error) { ctx, cancel := svc.c.Context() defer cancel() queryData, err := json.Marshal(query) @@ -227,7 +227,7 @@ func (svc *ModelServiceV2[T]) ReplaceOne(query bson.M, model T) (err error) { if err != nil { return err } - _, err = svc.c.ModelBaseServiceV2Client.ReplaceOne(ctx, &grpc.ModelServiceV2ReplaceOneRequest{ + _, err = svc.c.ModelBaseServiceClient.ReplaceOne(ctx, &grpc.ModelServiceReplaceOneRequest{ NodeKey: svc.cfg.GetNodeKey(), ModelType: svc.modelType, Query: queryData, @@ -239,14 +239,14 @@ func (svc *ModelServiceV2[T]) ReplaceOne(query bson.M, model T) (err error) { return nil } -func (svc *ModelServiceV2[T]) InsertOne(model T) (id primitive.ObjectID, err error) { +func (svc *ModelService[T]) InsertOne(model T) (id primitive.ObjectID, err error) { ctx, cancel := svc.c.Context() defer cancel() modelData, err := json.Marshal(model) if err != nil { return primitive.NilObjectID, err } - res, err := svc.c.ModelBaseServiceV2Client.InsertOne(ctx, &grpc.ModelServiceV2InsertOneRequest{ + res, err := svc.c.ModelBaseServiceClient.InsertOne(ctx, &grpc.ModelServiceInsertOneRequest{ NodeKey: svc.cfg.GetNodeKey(), ModelType: svc.modelType, Model: modelData, @@ -262,14 +262,14 @@ func (svc *ModelServiceV2[T]) InsertOne(model T) (id primitive.ObjectID, err err //return primitive.ObjectIDFromHex(idStr) } -func (svc *ModelServiceV2[T]) InsertMany(models []T) (ids []primitive.ObjectID, err error) { +func (svc *ModelService[T]) InsertMany(models []T) (ids []primitive.ObjectID, err error) { ctx, cancel := svc.c.Context() defer cancel() modelsData, err := json.Marshal(models) if err != nil { return nil, err } - res, err := svc.c.ModelBaseServiceV2Client.InsertMany(ctx, &grpc.ModelServiceV2InsertManyRequest{ + res, err := svc.c.ModelBaseServiceClient.InsertMany(ctx, &grpc.ModelServiceInsertManyRequest{ NodeKey: svc.cfg.GetNodeKey(), ModelType: svc.modelType, Models: modelsData, @@ -280,14 +280,14 @@ func (svc *ModelServiceV2[T]) InsertMany(models []T) (ids []primitive.ObjectID, return deserialize[[]primitive.ObjectID](res) } -func (svc *ModelServiceV2[T]) Count(query bson.M) (total int, err error) { +func (svc *ModelService[T]) Count(query bson.M) (total int, err error) { ctx, cancel := svc.c.Context() defer cancel() queryData, err := json.Marshal(query) if err != nil { return 0, err } - res, err := svc.c.ModelBaseServiceV2Client.Count(ctx, &grpc.ModelServiceV2CountRequest{ + res, err := svc.c.ModelBaseServiceClient.Count(ctx, &grpc.ModelServiceCountRequest{ NodeKey: svc.cfg.GetNodeKey(), ModelType: svc.modelType, Query: queryData, @@ -298,11 +298,11 @@ func (svc *ModelServiceV2[T]) Count(query bson.M) (total int, err error) { return deserialize[int](res) } -func (svc *ModelServiceV2[T]) GetCol() (col *mongo.Col) { +func (svc *ModelService[T]) GetCol() (col *mongo.Col) { return nil } -func (svc *ModelServiceV2[T]) deserializeOne(res *grpc.Response) (result *T, err error) { +func (svc *ModelService[T]) deserializeOne(res *grpc.Response) (result *T, err error) { r, err := deserialize[T](res) if err != nil { return nil, err @@ -310,7 +310,7 @@ func (svc *ModelServiceV2[T]) deserializeOne(res *grpc.Response) (result *T, err return &r, err } -func (svc *ModelServiceV2[T]) deserializeMany(res *grpc.Response) (results []T, err error) { +func (svc *ModelService[T]) deserializeMany(res *grpc.Response) (results []T, err error) { return deserialize[[]T](res) } @@ -322,7 +322,7 @@ func deserialize[T any](res *grpc.Response) (result T, err error) { return result, nil } -func NewModelServiceV2[T any]() *ModelServiceV2[T] { +func NewModelService[T any]() *ModelService[T] { mu.Lock() defer mu.Unlock() @@ -334,7 +334,7 @@ func NewModelServiceV2[T any]() *ModelServiceV2[T] { onceMap[typeName] = new(sync.Once) } - var instance *ModelServiceV2[T] + var instance *ModelService[T] c := client.GetGrpcClient() if !c.IsStarted() { @@ -345,7 +345,7 @@ func NewModelServiceV2[T any]() *ModelServiceV2[T] { } onceMap[typeName].Do(func() { - instance = &ModelServiceV2[T]{ + instance = &ModelService[T]{ cfg: nodeconfig.GetNodeConfigService(), c: c, modelType: typeName, @@ -353,5 +353,5 @@ func NewModelServiceV2[T any]() *ModelServiceV2[T] { instanceMap[typeName] = instance }) - return instanceMap[typeName].(*ModelServiceV2[T]) + return instanceMap[typeName].(*ModelService[T]) } diff --git a/core/models/client/model_service_v2_test.go b/core/models/client/model_service_test.go similarity index 80% rename from core/models/client/model_service_v2_test.go rename to core/models/client/model_service_test.go index 85469653..8c545295 100644 --- a/core/models/client/model_service_v2_test.go +++ b/core/models/client/model_service_test.go @@ -43,7 +43,7 @@ func stopSvr(svr *server.GrpcServer) { } } -func TestModelServiceV2_GetById(t *testing.T) { +func TestModelService_GetById(t *testing.T) { setupTestDB() defer teardownTestDB() svr, err := server.NewGrpcServer() @@ -54,7 +54,7 @@ func TestModelServiceV2_GetById(t *testing.T) { m := models.TestModelV2{ Name: "Test Name", } - modelSvc := service.NewModelServiceV2[models.TestModelV2]() + modelSvc := service.NewModelService[models.TestModelV2]() id, err := modelSvc.InsertOne(m) require.Nil(t, err) m.SetId(id) @@ -64,14 +64,14 @@ func TestModelServiceV2_GetById(t *testing.T) { require.Nil(t, err) c.Connect() - clientSvc := client.NewModelServiceV2[models.TestModelV2]() + clientSvc := client.NewModelService[models.TestModelV2]() res, err := clientSvc.GetById(m.Id) require.Nil(t, err) assert.Equal(t, res.Id, m.Id) assert.Equal(t, res.Name, m.Name) } -func TestModelServiceV2_GetOne(t *testing.T) { +func TestModelService_GetOne(t *testing.T) { setupTestDB() defer teardownTestDB() svr, err := server.NewGrpcServer() @@ -82,7 +82,7 @@ func TestModelServiceV2_GetOne(t *testing.T) { m := models.TestModelV2{ Name: "Test Name", } - modelSvc := service.NewModelServiceV2[models.TestModelV2]() + modelSvc := service.NewModelService[models.TestModelV2]() id, err := modelSvc.InsertOne(m) require.Nil(t, err) m.SetId(id) @@ -92,14 +92,14 @@ func TestModelServiceV2_GetOne(t *testing.T) { require.Nil(t, err) c.Connect() - clientSvc := client.NewModelServiceV2[models.TestModelV2]() + clientSvc := client.NewModelService[models.TestModelV2]() res, err := clientSvc.GetOne(bson.M{"name": m.Name}, nil) require.Nil(t, err) assert.Equal(t, res.Id, m.Id) assert.Equal(t, res.Name, m.Name) } -func TestModelServiceV2_GetMany(t *testing.T) { +func TestModelService_GetMany(t *testing.T) { setupTestDB() defer teardownTestDB() svr, err := server.NewGrpcServer() @@ -110,7 +110,7 @@ func TestModelServiceV2_GetMany(t *testing.T) { m := models.TestModelV2{ Name: "Test Name", } - modelSvc := service.NewModelServiceV2[models.TestModelV2]() + modelSvc := service.NewModelService[models.TestModelV2]() id, err := modelSvc.InsertOne(m) require.Nil(t, err) m.SetId(id) @@ -120,7 +120,7 @@ func TestModelServiceV2_GetMany(t *testing.T) { require.Nil(t, err) c.Connect() - clientSvc := client.NewModelServiceV2[models.TestModelV2]() + clientSvc := client.NewModelService[models.TestModelV2]() res, err := clientSvc.GetMany(bson.M{"name": m.Name}, nil) require.Nil(t, err) assert.Equal(t, len(res), 1) @@ -128,7 +128,7 @@ func TestModelServiceV2_GetMany(t *testing.T) { assert.Equal(t, res[0].Name, m.Name) } -func TestModelServiceV2_DeleteById(t *testing.T) { +func TestModelService_DeleteById(t *testing.T) { setupTestDB() defer teardownTestDB() svr, err := server.NewGrpcServer() @@ -139,7 +139,7 @@ func TestModelServiceV2_DeleteById(t *testing.T) { m := models.TestModelV2{ Name: "Test Name", } - modelSvc := service.NewModelServiceV2[models.TestModelV2]() + modelSvc := service.NewModelService[models.TestModelV2]() id, err := modelSvc.InsertOne(m) require.Nil(t, err) m.SetId(id) @@ -149,7 +149,7 @@ func TestModelServiceV2_DeleteById(t *testing.T) { require.Nil(t, err) c.Connect() - clientSvc := client.NewModelServiceV2[models.TestModelV2]() + clientSvc := client.NewModelService[models.TestModelV2]() err = clientSvc.DeleteById(m.Id) require.Nil(t, err) @@ -158,7 +158,7 @@ func TestModelServiceV2_DeleteById(t *testing.T) { require.Nil(t, res) } -func TestModelServiceV2_DeleteOne(t *testing.T) { +func TestModelService_DeleteOne(t *testing.T) { setupTestDB() defer teardownTestDB() svr, err := server.NewGrpcServer() @@ -169,7 +169,7 @@ func TestModelServiceV2_DeleteOne(t *testing.T) { m := models.TestModelV2{ Name: "Test Name", } - modelSvc := service.NewModelServiceV2[models.TestModelV2]() + modelSvc := service.NewModelService[models.TestModelV2]() id, err := modelSvc.InsertOne(m) require.Nil(t, err) m.SetId(id) @@ -179,7 +179,7 @@ func TestModelServiceV2_DeleteOne(t *testing.T) { require.Nil(t, err) c.Connect() - clientSvc := client.NewModelServiceV2[models.TestModelV2]() + clientSvc := client.NewModelService[models.TestModelV2]() err = clientSvc.DeleteOne(bson.M{"name": m.Name}) require.Nil(t, err) @@ -188,7 +188,7 @@ func TestModelServiceV2_DeleteOne(t *testing.T) { require.Nil(t, res) } -func TestModelServiceV2_DeleteMany(t *testing.T) { +func TestModelService_DeleteMany(t *testing.T) { setupTestDB() defer teardownTestDB() svr, err := server.NewGrpcServer() @@ -199,7 +199,7 @@ func TestModelServiceV2_DeleteMany(t *testing.T) { m := models.TestModelV2{ Name: "Test Name", } - modelSvc := service.NewModelServiceV2[models.TestModelV2]() + modelSvc := service.NewModelService[models.TestModelV2]() id, err := modelSvc.InsertOne(m) require.Nil(t, err) m.SetId(id) @@ -209,7 +209,7 @@ func TestModelServiceV2_DeleteMany(t *testing.T) { require.Nil(t, err) c.Connect() - clientSvc := client.NewModelServiceV2[models.TestModelV2]() + clientSvc := client.NewModelService[models.TestModelV2]() err = clientSvc.DeleteMany(bson.M{"name": m.Name}) require.Nil(t, err) @@ -218,7 +218,7 @@ func TestModelServiceV2_DeleteMany(t *testing.T) { assert.Equal(t, len(res), 0) } -func TestModelServiceV2_UpdateById(t *testing.T) { +func TestModelService_UpdateById(t *testing.T) { setupTestDB() defer teardownTestDB() svr, err := server.NewGrpcServer() @@ -229,7 +229,7 @@ func TestModelServiceV2_UpdateById(t *testing.T) { m := models.TestModelV2{ Name: "Test Name", } - modelSvc := service.NewModelServiceV2[models.TestModelV2]() + modelSvc := service.NewModelService[models.TestModelV2]() id, err := modelSvc.InsertOne(m) require.Nil(t, err) m.SetId(id) @@ -239,7 +239,7 @@ func TestModelServiceV2_UpdateById(t *testing.T) { require.Nil(t, err) c.Connect() - clientSvc := client.NewModelServiceV2[models.TestModelV2]() + clientSvc := client.NewModelService[models.TestModelV2]() err = clientSvc.UpdateById(m.Id, bson.M{"$set": bson.M{"name": "New Name"}}) require.Nil(t, err) @@ -248,7 +248,7 @@ func TestModelServiceV2_UpdateById(t *testing.T) { assert.Equal(t, res.Name, "New Name") } -func TestModelServiceV2_UpdateOne(t *testing.T) { +func TestModelService_UpdateOne(t *testing.T) { setupTestDB() defer teardownTestDB() svr, err := server.NewGrpcServer() @@ -259,7 +259,7 @@ func TestModelServiceV2_UpdateOne(t *testing.T) { m := models.TestModelV2{ Name: "Test Name", } - modelSvc := service.NewModelServiceV2[models.TestModelV2]() + modelSvc := service.NewModelService[models.TestModelV2]() id, err := modelSvc.InsertOne(m) require.Nil(t, err) m.SetId(id) @@ -269,7 +269,7 @@ func TestModelServiceV2_UpdateOne(t *testing.T) { require.Nil(t, err) c.Connect() - clientSvc := client.NewModelServiceV2[models.TestModelV2]() + clientSvc := client.NewModelService[models.TestModelV2]() err = clientSvc.UpdateOne(bson.M{"name": m.Name}, bson.M{"$set": bson.M{"name": "New Name"}}) require.Nil(t, err) @@ -278,7 +278,7 @@ func TestModelServiceV2_UpdateOne(t *testing.T) { assert.Equal(t, res.Name, "New Name") } -func TestModelServiceV2_UpdateMany(t *testing.T) { +func TestModelService_UpdateMany(t *testing.T) { setupTestDB() defer teardownTestDB() svr, err := server.NewGrpcServer() @@ -292,7 +292,7 @@ func TestModelServiceV2_UpdateMany(t *testing.T) { m2 := models.TestModelV2{ Name: "Test Name", } - modelSvc := service.NewModelServiceV2[models.TestModelV2]() + modelSvc := service.NewModelService[models.TestModelV2]() _, err = modelSvc.InsertOne(m1) require.Nil(t, err) _, err = modelSvc.InsertOne(m2) @@ -303,7 +303,7 @@ func TestModelServiceV2_UpdateMany(t *testing.T) { require.Nil(t, err) c.Connect() - clientSvc := client.NewModelServiceV2[models.TestModelV2]() + clientSvc := client.NewModelService[models.TestModelV2]() err = clientSvc.UpdateMany(bson.M{"name": "Test Name"}, bson.M{"$set": bson.M{"name": "New Name"}}) require.Nil(t, err) @@ -312,7 +312,7 @@ func TestModelServiceV2_UpdateMany(t *testing.T) { assert.Equal(t, len(res), 2) } -func TestModelServiceV2_ReplaceById(t *testing.T) { +func TestModelService_ReplaceById(t *testing.T) { setupTestDB() defer teardownTestDB() svr, err := server.NewGrpcServer() @@ -323,7 +323,7 @@ func TestModelServiceV2_ReplaceById(t *testing.T) { m := models.TestModelV2{ Name: "Test Name", } - modelSvc := service.NewModelServiceV2[models.TestModelV2]() + modelSvc := service.NewModelService[models.TestModelV2]() id, err := modelSvc.InsertOne(m) require.Nil(t, err) m.SetId(id) @@ -333,7 +333,7 @@ func TestModelServiceV2_ReplaceById(t *testing.T) { require.Nil(t, err) c.Connect() - clientSvc := client.NewModelServiceV2[models.TestModelV2]() + clientSvc := client.NewModelService[models.TestModelV2]() m.Name = "New Name" err = clientSvc.ReplaceById(m.Id, m) require.Nil(t, err) @@ -343,7 +343,7 @@ func TestModelServiceV2_ReplaceById(t *testing.T) { assert.Equal(t, res.Name, "New Name") } -func TestModelServiceV2_ReplaceOne(t *testing.T) { +func TestModelService_ReplaceOne(t *testing.T) { setupTestDB() defer teardownTestDB() svr, err := server.NewGrpcServer() @@ -354,7 +354,7 @@ func TestModelServiceV2_ReplaceOne(t *testing.T) { m := models.TestModelV2{ Name: "Test Name", } - modelSvc := service.NewModelServiceV2[models.TestModelV2]() + modelSvc := service.NewModelService[models.TestModelV2]() id, err := modelSvc.InsertOne(m) require.Nil(t, err) m.SetId(id) @@ -364,7 +364,7 @@ func TestModelServiceV2_ReplaceOne(t *testing.T) { require.Nil(t, err) c.Connect() - clientSvc := client.NewModelServiceV2[models.TestModelV2]() + clientSvc := client.NewModelService[models.TestModelV2]() m.Name = "New Name" err = clientSvc.ReplaceOne(bson.M{"name": "Test Name"}, m) require.Nil(t, err) @@ -374,7 +374,7 @@ func TestModelServiceV2_ReplaceOne(t *testing.T) { assert.Equal(t, res.Name, "New Name") } -func TestModelServiceV2_InsertOne(t *testing.T) { +func TestModelService_InsertOne(t *testing.T) { setupTestDB() defer teardownTestDB() svr, err := server.NewGrpcServer() @@ -386,7 +386,7 @@ func TestModelServiceV2_InsertOne(t *testing.T) { require.Nil(t, err) c.Connect() - clientSvc := client.NewModelServiceV2[models.TestModelV2]() + clientSvc := client.NewModelService[models.TestModelV2]() m := models.TestModelV2{ Name: "Test Name", } @@ -398,7 +398,7 @@ func TestModelServiceV2_InsertOne(t *testing.T) { assert.Equal(t, res.Name, m.Name) } -func TestModelServiceV2_InsertMany(t *testing.T) { +func TestModelService_InsertMany(t *testing.T) { setupTestDB() defer teardownTestDB() svr, err := server.NewGrpcServer() @@ -410,7 +410,7 @@ func TestModelServiceV2_InsertMany(t *testing.T) { require.Nil(t, err) c.Connect() - clientSvc := client.NewModelServiceV2[models.TestModelV2]() + clientSvc := client.NewModelService[models.TestModelV2]() testModels := []models.TestModelV2{ {Name: "Test Name 1"}, {Name: "Test Name 2"}, @@ -425,7 +425,7 @@ func TestModelServiceV2_InsertMany(t *testing.T) { } } -func TestModelServiceV2_Count(t *testing.T) { +func TestModelService_Count(t *testing.T) { setupTestDB() defer teardownTestDB() svr, err := server.NewGrpcServer() @@ -433,7 +433,7 @@ func TestModelServiceV2_Count(t *testing.T) { go startSvr(svr) defer stopSvr(svr) - modelSvc := service.NewModelServiceV2[models.TestModelV2]() + modelSvc := service.NewModelService[models.TestModelV2]() for i := 0; i < 5; i++ { _, err = modelSvc.InsertOne(models.TestModelV2{ Name: "Test Name", @@ -446,7 +446,7 @@ func TestModelServiceV2_Count(t *testing.T) { require.Nil(t, err) c.Connect() - clientSvc := client.NewModelServiceV2[models.TestModelV2]() + clientSvc := client.NewModelService[models.TestModelV2]() count, err := clientSvc.Count(bson.M{}) require.Nil(t, err) diff --git a/core/models/service/base_service_v2.go b/core/models/service/base_service.go similarity index 63% rename from core/models/service/base_service_v2.go rename to core/models/service/base_service.go index 3d03a28a..4cc2002d 100644 --- a/core/models/service/base_service_v2.go +++ b/core/models/service/base_service.go @@ -20,11 +20,11 @@ var ( mu sync.Mutex ) -type ModelServiceV2[T any] struct { +type ModelService[T any] struct { col *mongo.Col } -func (svc *ModelServiceV2[T]) GetById(id primitive.ObjectID) (model *T, err error) { +func (svc *ModelService[T]) GetById(id primitive.ObjectID) (model *T, err error) { var result T err = svc.col.FindId(id).One(&result) if err != nil { @@ -33,7 +33,7 @@ func (svc *ModelServiceV2[T]) GetById(id primitive.ObjectID) (model *T, err erro return &result, nil } -func (svc *ModelServiceV2[T]) GetByIdContext(ctx context.Context, id primitive.ObjectID) (model *T, err error) { +func (svc *ModelService[T]) GetByIdContext(ctx context.Context, id primitive.ObjectID) (model *T, err error) { var result T err = svc.col.GetCollection().FindOne(ctx, bson.M{"_id": id}).Decode(&result) if err != nil { @@ -42,7 +42,7 @@ func (svc *ModelServiceV2[T]) GetByIdContext(ctx context.Context, id primitive.O return &result, nil } -func (svc *ModelServiceV2[T]) GetOne(query bson.M, options *mongo.FindOptions) (model *T, err error) { +func (svc *ModelService[T]) GetOne(query bson.M, options *mongo.FindOptions) (model *T, err error) { var result T err = svc.col.Find(query, options).One(&result) if err != nil { @@ -51,7 +51,7 @@ func (svc *ModelServiceV2[T]) GetOne(query bson.M, options *mongo.FindOptions) ( return &result, nil } -func (svc *ModelServiceV2[T]) GetOneContext(ctx context.Context, query bson.M, opts *mongo.FindOptions) (model *T, err error) { +func (svc *ModelService[T]) GetOneContext(ctx context.Context, query bson.M, opts *mongo.FindOptions) (model *T, err error) { var result T _opts := &options.FindOneOptions{} if opts != nil { @@ -70,7 +70,7 @@ func (svc *ModelServiceV2[T]) GetOneContext(ctx context.Context, query bson.M, o return &result, nil } -func (svc *ModelServiceV2[T]) GetMany(query bson.M, options *mongo.FindOptions) (models []T, err error) { +func (svc *ModelService[T]) GetMany(query bson.M, options *mongo.FindOptions) (models []T, err error) { var result []T err = svc.col.Find(query, options).All(&result) if err != nil { @@ -79,7 +79,7 @@ func (svc *ModelServiceV2[T]) GetMany(query bson.M, options *mongo.FindOptions) return result, nil } -func (svc *ModelServiceV2[T]) GetManyContext(ctx context.Context, query bson.M, opts *mongo.FindOptions) (models []T, err error) { +func (svc *ModelService[T]) GetManyContext(ctx context.Context, query bson.M, opts *mongo.FindOptions) (models []T, err error) { var result []T _opts := &options.FindOptions{} if opts != nil { @@ -110,85 +110,85 @@ func (svc *ModelServiceV2[T]) GetManyContext(ctx context.Context, query bson.M, return result, nil } -func (svc *ModelServiceV2[T]) DeleteById(id primitive.ObjectID) (err error) { +func (svc *ModelService[T]) DeleteById(id primitive.ObjectID) (err error) { return svc.col.DeleteId(id) } -func (svc *ModelServiceV2[T]) DeleteByIdContext(ctx context.Context, id primitive.ObjectID) (err error) { +func (svc *ModelService[T]) DeleteByIdContext(ctx context.Context, id primitive.ObjectID) (err error) { _, err = svc.col.GetCollection().DeleteOne(ctx, bson.M{"_id": id}) return err } -func (svc *ModelServiceV2[T]) DeleteOne(query bson.M) (err error) { +func (svc *ModelService[T]) DeleteOne(query bson.M) (err error) { _, err = svc.col.GetCollection().DeleteOne(svc.col.GetContext(), query) return err } -func (svc *ModelServiceV2[T]) DeleteOneContext(ctx context.Context, query bson.M) (err error) { +func (svc *ModelService[T]) DeleteOneContext(ctx context.Context, query bson.M) (err error) { _, err = svc.col.GetCollection().DeleteOne(ctx, query) return err } -func (svc *ModelServiceV2[T]) DeleteMany(query bson.M) (err error) { +func (svc *ModelService[T]) DeleteMany(query bson.M) (err error) { _, err = svc.col.GetCollection().DeleteMany(svc.col.GetContext(), query, nil) return err } -func (svc *ModelServiceV2[T]) DeleteManyContext(ctx context.Context, query bson.M) (err error) { +func (svc *ModelService[T]) DeleteManyContext(ctx context.Context, query bson.M) (err error) { _, err = svc.col.GetCollection().DeleteMany(ctx, query, nil) return err } -func (svc *ModelServiceV2[T]) UpdateById(id primitive.ObjectID, update bson.M) (err error) { +func (svc *ModelService[T]) UpdateById(id primitive.ObjectID, update bson.M) (err error) { return svc.col.UpdateId(id, update) } -func (svc *ModelServiceV2[T]) UpdateByIdContext(ctx context.Context, id primitive.ObjectID, update bson.M) (err error) { +func (svc *ModelService[T]) UpdateByIdContext(ctx context.Context, id primitive.ObjectID, update bson.M) (err error) { _, err = svc.col.GetCollection().UpdateOne(ctx, bson.M{"_id": id}, update) return err } -func (svc *ModelServiceV2[T]) UpdateOne(query bson.M, update bson.M) (err error) { +func (svc *ModelService[T]) UpdateOne(query bson.M, update bson.M) (err error) { _, err = svc.col.GetCollection().UpdateOne(svc.col.GetContext(), query, update) return err } -func (svc *ModelServiceV2[T]) UpdateOneContext(ctx context.Context, query bson.M, update bson.M) (err error) { +func (svc *ModelService[T]) UpdateOneContext(ctx context.Context, query bson.M, update bson.M) (err error) { _, err = svc.col.GetCollection().UpdateOne(ctx, query, update) return err } -func (svc *ModelServiceV2[T]) UpdateMany(query bson.M, update bson.M) (err error) { +func (svc *ModelService[T]) UpdateMany(query bson.M, update bson.M) (err error) { _, err = svc.col.GetCollection().UpdateMany(svc.col.GetContext(), query, update) return err } -func (svc *ModelServiceV2[T]) UpdateManyContext(ctx context.Context, query bson.M, update bson.M) (err error) { +func (svc *ModelService[T]) UpdateManyContext(ctx context.Context, query bson.M, update bson.M) (err error) { _, err = svc.col.GetCollection().UpdateMany(ctx, query, update) return err } -func (svc *ModelServiceV2[T]) ReplaceById(id primitive.ObjectID, model T) (err error) { +func (svc *ModelService[T]) ReplaceById(id primitive.ObjectID, model T) (err error) { _, err = svc.col.GetCollection().ReplaceOne(svc.col.GetContext(), bson.M{"_id": id}, model) return err } -func (svc *ModelServiceV2[T]) ReplaceByIdContext(ctx context.Context, id primitive.ObjectID, model T) (err error) { +func (svc *ModelService[T]) ReplaceByIdContext(ctx context.Context, id primitive.ObjectID, model T) (err error) { _, err = svc.col.GetCollection().ReplaceOne(ctx, bson.M{"_id": id}, model) return err } -func (svc *ModelServiceV2[T]) ReplaceOne(query bson.M, model T) (err error) { +func (svc *ModelService[T]) ReplaceOne(query bson.M, model T) (err error) { _, err = svc.col.GetCollection().ReplaceOne(svc.col.GetContext(), query, model) return err } -func (svc *ModelServiceV2[T]) ReplaceOneContext(ctx context.Context, query bson.M, model T) (err error) { +func (svc *ModelService[T]) ReplaceOneContext(ctx context.Context, query bson.M, model T) (err error) { _, err = svc.col.GetCollection().ReplaceOne(ctx, query, model) return err } -func (svc *ModelServiceV2[T]) InsertOne(model T) (id primitive.ObjectID, err error) { +func (svc *ModelService[T]) InsertOne(model T) (id primitive.ObjectID, err error) { m := any(&model).(interfaces.Model) if m.GetId().IsZero() { m.SetId(primitive.NewObjectID()) @@ -200,7 +200,7 @@ func (svc *ModelServiceV2[T]) InsertOne(model T) (id primitive.ObjectID, err err return res.InsertedID.(primitive.ObjectID), nil } -func (svc *ModelServiceV2[T]) InsertOneContext(ctx context.Context, model T) (id primitive.ObjectID, err error) { +func (svc *ModelService[T]) InsertOneContext(ctx context.Context, model T) (id primitive.ObjectID, err error) { m := any(&model).(interfaces.Model) if m.GetId().IsZero() { m.SetId(primitive.NewObjectID()) @@ -212,7 +212,7 @@ func (svc *ModelServiceV2[T]) InsertOneContext(ctx context.Context, model T) (id return res.InsertedID.(primitive.ObjectID), nil } -func (svc *ModelServiceV2[T]) InsertMany(models []T) (ids []primitive.ObjectID, err error) { +func (svc *ModelService[T]) InsertMany(models []T) (ids []primitive.ObjectID, err error) { var _models []any for _, model := range models { m := any(&model).(interfaces.Model) @@ -231,7 +231,7 @@ func (svc *ModelServiceV2[T]) InsertMany(models []T) (ids []primitive.ObjectID, return ids, nil } -func (svc *ModelServiceV2[T]) InsertManyContext(ctx context.Context, models []T) (ids []primitive.ObjectID, err error) { +func (svc *ModelService[T]) InsertManyContext(ctx context.Context, models []T) (ids []primitive.ObjectID, err error) { var _models []any for _, model := range models { m := any(&model).(interfaces.Model) @@ -250,11 +250,11 @@ func (svc *ModelServiceV2[T]) InsertManyContext(ctx context.Context, models []T) return ids, nil } -func (svc *ModelServiceV2[T]) Count(query bson.M) (total int, err error) { +func (svc *ModelService[T]) Count(query bson.M) (total int, err error) { return svc.col.Count(query) } -func (svc *ModelServiceV2[T]) GetCol() (col *mongo.Col) { +func (svc *ModelService[T]) GetCol() (col *mongo.Col) { return svc.col } @@ -271,8 +271,8 @@ func getCollectionName[T any]() string { return field.Tag.Get("collection") } -// NewModelServiceV2 return singleton instance of ModelServiceV2 -func NewModelServiceV2[T any]() *ModelServiceV2[T] { +// NewModelService return singleton instance of ModelService +func NewModelService[T any]() *ModelService[T] { typeName := fmt.Sprintf("%T", *new(T)) mu.Lock() @@ -282,19 +282,19 @@ func NewModelServiceV2[T any]() *ModelServiceV2[T] { onceMap[typeName] = new(sync.Once) } - var instance *ModelServiceV2[T] + var instance *ModelService[T] onceMap[typeName].Do(func() { collectionName := getCollectionName[T]() collection := mongo.GetMongoCol(collectionName) - instance = &ModelServiceV2[T]{col: collection} + instance = &ModelService[T]{col: collection} instanceMap[typeName] = instance }) - return instanceMap[typeName].(*ModelServiceV2[T]) + return instanceMap[typeName].(*ModelService[T]) } -func NewModelServiceV2WithColName[T any](colName string) *ModelServiceV2[T] { +func NewModelServiceWithColName[T any](colName string) *ModelService[T] { mu.Lock() defer mu.Unlock() @@ -302,13 +302,13 @@ func NewModelServiceV2WithColName[T any](colName string) *ModelServiceV2[T] { onceColNameMap[colName] = new(sync.Once) } - var instance *ModelServiceV2[T] + var instance *ModelService[T] onceColNameMap[colName].Do(func() { collection := mongo.GetMongoCol(colName) - instance = &ModelServiceV2[T]{col: collection} + instance = &ModelService[T]{col: collection} instanceMap[colName] = instance }) - return instanceMap[colName].(*ModelServiceV2[T]) + return instanceMap[colName].(*ModelService[T]) } diff --git a/core/models/service/base_service_v2_test.go b/core/models/service/base_service_test.go similarity index 90% rename from core/models/service/base_service_v2_test.go rename to core/models/service/base_service_test.go index 01fe7b19..d26559b4 100644 --- a/core/models/service/base_service_v2_test.go +++ b/core/models/service/base_service_test.go @@ -41,7 +41,7 @@ func TestModelServiceV2(t *testing.T) { defer teardownTestDB() t.Run("GetById", func(t *testing.T) { - svc := service.NewModelServiceV2[TestModel]() + svc := service.NewModelService[TestModel]() testModel := TestModel{Name: "GetById Test"} id, err := svc.InsertOne(testModel) @@ -54,7 +54,7 @@ func TestModelServiceV2(t *testing.T) { }) t.Run("GetOne", func(t *testing.T) { - svc := service.NewModelServiceV2[TestModel]() + svc := service.NewModelService[TestModel]() testModel := TestModel{Name: "GetOne Test"} _, err := svc.InsertOne(testModel) @@ -67,7 +67,7 @@ func TestModelServiceV2(t *testing.T) { }) t.Run("GetMany", func(t *testing.T) { - svc := service.NewModelServiceV2[TestModel]() + svc := service.NewModelService[TestModel]() testModels := []TestModel{ {Name: "GetMany Test 1"}, {Name: "GetMany Test 2"}, @@ -83,7 +83,7 @@ func TestModelServiceV2(t *testing.T) { }) t.Run("InsertOne", func(t *testing.T) { - svc := service.NewModelServiceV2[TestModel]() + svc := service.NewModelService[TestModel]() testModel := TestModel{Name: "InsertOne Test"} id, err := svc.InsertOne(testModel) @@ -92,7 +92,7 @@ func TestModelServiceV2(t *testing.T) { }) t.Run("InsertMany", func(t *testing.T) { - svc := service.NewModelServiceV2[TestModel]() + svc := service.NewModelService[TestModel]() testModels := []TestModel{ {Name: "InsertMany Test 1"}, {Name: "InsertMany Test 2"}, @@ -104,7 +104,7 @@ func TestModelServiceV2(t *testing.T) { }) t.Run("UpdateById", func(t *testing.T) { - svc := service.NewModelServiceV2[TestModel]() + svc := service.NewModelService[TestModel]() testModel := TestModel{Name: "UpdateById Test"} id, err := svc.InsertOne(testModel) @@ -122,7 +122,7 @@ func TestModelServiceV2(t *testing.T) { }) t.Run("UpdateOne", func(t *testing.T) { - svc := service.NewModelServiceV2[TestModel]() + svc := service.NewModelService[TestModel]() testModel := TestModel{Name: "UpdateOne Test"} _, err := svc.InsertOne(testModel) @@ -140,7 +140,7 @@ func TestModelServiceV2(t *testing.T) { }) t.Run("UpdateMany", func(t *testing.T) { - svc := service.NewModelServiceV2[TestModel]() + svc := service.NewModelService[TestModel]() testModels := []TestModel{ {Name: "UpdateMany Test 1"}, {Name: "UpdateMany Test 2"}, @@ -161,7 +161,7 @@ func TestModelServiceV2(t *testing.T) { }) t.Run("DeleteById", func(t *testing.T) { - svc := service.NewModelServiceV2[TestModel]() + svc := service.NewModelService[TestModel]() testModel := TestModel{Name: "DeleteById Test"} id, err := svc.InsertOne(testModel) @@ -178,7 +178,7 @@ func TestModelServiceV2(t *testing.T) { }) t.Run("DeleteOne", func(t *testing.T) { - svc := service.NewModelServiceV2[TestModel]() + svc := service.NewModelService[TestModel]() testModel := TestModel{Name: "DeleteOne Test"} _, err := svc.InsertOne(testModel) @@ -195,7 +195,7 @@ func TestModelServiceV2(t *testing.T) { }) t.Run("DeleteMany", func(t *testing.T) { - svc := service.NewModelServiceV2[TestModel]() + svc := service.NewModelService[TestModel]() testModels := []TestModel{ {Name: "DeleteMany Test 1"}, {Name: "DeleteMany Test 2"}, @@ -215,7 +215,7 @@ func TestModelServiceV2(t *testing.T) { }) t.Run("Count", func(t *testing.T) { - svc := service.NewModelServiceV2[TestModel]() + svc := service.NewModelService[TestModel]() testModels := []TestModel{ {Name: "Count Test 1"}, {Name: "Count Test 2"}, diff --git a/core/node/service/master_service.go b/core/node/service/master_service.go index 02cf0d52..0f39cf7d 100644 --- a/core/node/service/master_service.go +++ b/core/node/service/master_service.go @@ -133,7 +133,7 @@ func (svc *MasterService) SetMonitorInterval(duration time.Duration) { func (svc *MasterService) Register() (err error) { nodeKey := svc.GetConfigService().GetNodeKey() nodeName := svc.GetConfigService().GetNodeName() - node, err := service.NewModelServiceV2[models2.NodeV2]().GetOne(bson.M{"key": nodeKey}, nil) + node, err := service.NewModelService[models2.NodeV2]().GetOne(bson.M{"key": nodeKey}, nil) if err != nil && err.Error() == mongo2.ErrNoDocuments.Error() { // not exists log.Infof("master[%s] does not exist in db", nodeKey) @@ -149,7 +149,7 @@ func (svc *MasterService) Register() (err error) { } node.SetCreated(primitive.NilObjectID) node.SetUpdated(primitive.NilObjectID) - id, err := service.NewModelServiceV2[models2.NodeV2]().InsertOne(node) + id, err := service.NewModelService[models2.NodeV2]().InsertOne(node) if err != nil { return err } @@ -161,7 +161,7 @@ func (svc *MasterService) Register() (err error) { node.Status = constants.NodeStatusOnline node.Active = true node.ActiveAt = time.Now() - err = service.NewModelServiceV2[models2.NodeV2]().ReplaceById(node.Id, *node) + err = service.NewModelService[models2.NodeV2]().ReplaceById(node.Id, *node) if err != nil { return err } @@ -227,7 +227,7 @@ func (svc *MasterService) getAllWorkerNodes() (nodes []models2.NodeV2, err error "key": bson.M{"$ne": svc.cfgSvc.GetNodeKey()}, // not self "active": true, // active } - nodes, err = service.NewModelServiceV2[models2.NodeV2]().GetMany(query, nil) + nodes, err = service.NewModelService[models2.NodeV2]().GetMany(query, nil) if err != nil { if errors.Is(err, mongo2.ErrNoDocuments) { return nil, nil @@ -239,7 +239,7 @@ func (svc *MasterService) getAllWorkerNodes() (nodes []models2.NodeV2, err error func (svc *MasterService) updateMasterNodeStatus() (err error) { nodeKey := svc.GetConfigService().GetNodeKey() - node, err := service.NewModelServiceV2[models2.NodeV2]().GetOne(bson.M{"key": nodeKey}, nil) + node, err := service.NewModelService[models2.NodeV2]().GetOne(bson.M{"key": nodeKey}, nil) if err != nil { return err } @@ -250,7 +250,7 @@ func (svc *MasterService) updateMasterNodeStatus() (err error) { node.ActiveAt = time.Now() newStatus := node.Status - err = service.NewModelServiceV2[models2.NodeV2]().ReplaceById(node.Id, *node) + err = service.NewModelService[models2.NodeV2]().ReplaceById(node.Id, *node) if err != nil { return err } @@ -268,7 +268,7 @@ func (svc *MasterService) setWorkerNodeOffline(node *models2.NodeV2) { node.Status = constants.NodeStatusOffline node.Active = false err := backoff.Retry(func() error { - return service.NewModelServiceV2[models2.NodeV2]().ReplaceById(node.Id, *node) + return service.NewModelService[models2.NodeV2]().ReplaceById(node.Id, *node) }, backoff.WithMaxRetries(backoff.NewConstantBackOff(1*time.Second), 3)) if err != nil { trace.PrintError(err) @@ -302,12 +302,12 @@ func (svc *MasterService) updateNodeAvailableRunners(node *models2.NodeV2) (err "node_id": node.Id, "status": constants.TaskStatusRunning, } - runningTasksCount, err := service.NewModelServiceV2[models2.TaskV2]().Count(query) + runningTasksCount, err := service.NewModelService[models2.TaskV2]().Count(query) if err != nil { return trace.TraceError(err) } node.AvailableRunners = node.MaxRunners - runningTasksCount - err = service.NewModelServiceV2[models2.NodeV2]().ReplaceById(node.Id, *node) + err = service.NewModelService[models2.NodeV2]().ReplaceById(node.Id, *node) if err != nil { return err } diff --git a/core/node/service/worker_service.go b/core/node/service/worker_service.go index 712c6456..4a7ae399 100644 --- a/core/node/service/worker_service.go +++ b/core/node/service/worker_service.go @@ -90,7 +90,7 @@ func (svc *WorkerService) register() { log.Fatalf("failed to register worker[%s] to master: %v", svc.cfgSvc.GetNodeKey(), err) panic(err) } - svc.n, err = client2.NewModelServiceV2[models.NodeV2]().GetOne(bson.M{"key": svc.GetConfigService().GetNodeKey()}, nil) + svc.n, err = client2.NewModelService[models.NodeV2]().GetOne(bson.M{"key": svc.GetConfigService().GetNodeKey()}, nil) if err != nil { log.Fatalf("failed to get node: %v", err) panic(err) diff --git a/core/notification/service_v2.go b/core/notification/service_v2.go index 377e2e68..1563fd0e 100644 --- a/core/notification/service_v2.go +++ b/core/notification/service_v2.go @@ -28,7 +28,7 @@ func (svc *ServiceV2) Send(s *models.NotificationSettingV2, args ...any) { for _, chId := range s.ChannelIds { go func(chId primitive.ObjectID) { defer wg.Done() - ch, err := service.NewModelServiceV2[models.NotificationChannelV2]().GetById(chId) + ch, err := service.NewModelService[models.NotificationChannelV2]().GetById(chId) if err != nil { log.Errorf("[NotificationServiceV2] get channel error: %v", err) return @@ -362,7 +362,7 @@ func (svc *ServiceV2) getUsernameById(id primitive.ObjectID) (username string) { if id.IsZero() { return "" } - u, err := service.NewModelServiceV2[models.UserV2]().GetById(id) + u, err := service.NewModelService[models.UserV2]().GetById(id) if err != nil { log.Errorf("[NotificationServiceV2] get user error: %v", err) return "" @@ -434,7 +434,7 @@ func (svc *ServiceV2) SendNodeNotification(node *models.NodeV2) { args = append(args, node) // settings - settings, err := service.NewModelServiceV2[models.NotificationSettingV2]().GetMany(bson.M{ + settings, err := service.NewModelService[models.NotificationSettingV2]().GetMany(bson.M{ "enabled": true, "trigger": bson.M{ "$regex": constants.NotificationTriggerPatternNode, @@ -482,7 +482,7 @@ func (svc *ServiceV2) createRequest(s *models.NotificationSettingV2, ch *models. } r.SetCreatedAt(time.Now()) r.SetUpdatedAt(time.Now()) - r.Id, err = service.NewModelServiceV2[models.NotificationRequestV2]().InsertOne(r) + r.Id, err = service.NewModelService[models.NotificationRequestV2]().InsertOne(r) if err != nil { log.Errorf("[NotificationServiceV2] save request error: %v", err) return nil, err @@ -502,7 +502,7 @@ func (svc *ServiceV2) saveRequest(r *models.NotificationRequestV2, err error) { r.Status = StatusSuccess } r.SetUpdatedAt(time.Now()) - err = service.NewModelServiceV2[models.NotificationRequestV2]().ReplaceById(r.Id, *r) + err = service.NewModelService[models.NotificationRequestV2]().ReplaceById(r.Id, *r) if err != nil { log.Errorf("[NotificationServiceV2] save request error: %v", err) } diff --git a/core/schedule/service_v2.go b/core/schedule/service_v2.go index 0b102574..34ea78e3 100644 --- a/core/schedule/service_v2.go +++ b/core/schedule/service_v2.go @@ -19,7 +19,7 @@ import ( type ServiceV2 struct { // dependencies interfaces.WithConfigPath - modelSvc *service.ModelServiceV2[models2.ScheduleV2] + modelSvc *service.ModelService[models2.ScheduleV2] adminSvc *admin.Service // settings variables @@ -191,7 +191,7 @@ func (svc *ServiceV2) schedule(id primitive.ObjectID) (fn func()) { } // spider - spider, err := service.NewModelServiceV2[models2.SpiderV2]().GetById(s.SpiderId) + spider, err := service.NewModelService[models2.SpiderV2]().GetById(s.SpiderId) if err != nil { trace.PrintError(err) return @@ -250,7 +250,7 @@ func NewScheduleServiceV2() (svc2 *ServiceV2, err error) { if err != nil { return nil, err } - svc.modelSvc = service.NewModelServiceV2[models2.ScheduleV2]() + svc.modelSvc = service.NewModelService[models2.ScheduleV2]() // logger svc.logger = NewLogger() diff --git a/core/spider/admin/service.go b/core/spider/admin/service.go index b09a9bd5..94d92d54 100644 --- a/core/spider/admin/service.go +++ b/core/spider/admin/service.go @@ -28,7 +28,7 @@ type Service struct { func (svc *Service) Schedule(id primitive.ObjectID, opts *interfaces.SpiderRunOptions) (taskIds []primitive.ObjectID, err error) { // spider - s, err := service.NewModelServiceV2[models2.SpiderV2]().GetById(id) + s, err := service.NewModelService[models2.SpiderV2]().GetById(id) if err != nil { return nil, err } @@ -95,7 +95,7 @@ func (svc *Service) getNodeIds(opts *interfaces.SpiderRunOptions) (nodeIds []pri "enabled": true, "status": constants.NodeStatusOnline, } - nodes, err := service.NewModelServiceV2[models2.NodeV2]().GetMany(query, nil) + nodes, err := service.NewModelService[models2.NodeV2]().GetMany(query, nil) if err != nil { return nil, err } @@ -119,7 +119,7 @@ func (svc *Service) isMultiTask(opts *interfaces.SpiderRunOptions) (res bool) { "enabled": true, "status": constants.NodeStatusOnline, } - nodes, err := service.NewModelServiceV2[models2.NodeV2]().GetMany(query, nil) + nodes, err := service.NewModelService[models2.NodeV2]().GetMany(query, nil) if err != nil { trace.PrintError(err) return false diff --git a/core/system/service_v2.go b/core/system/service_v2.go index d82a6048..59cfe01f 100644 --- a/core/system/service_v2.go +++ b/core/system/service_v2.go @@ -20,7 +20,7 @@ func (svc *ServiceV2) Init() (err error) { } func (svc *ServiceV2) initData() (err error) { - total, err := service.NewModelServiceV2[models.SettingV2]().Count(bson.M{ + total, err := service.NewModelService[models.SettingV2]().Count(bson.M{ "key": "site_title", }) if err != nil { @@ -40,7 +40,7 @@ func (svc *ServiceV2) initData() (err error) { }, }, } - _, err = service.NewModelServiceV2[models.SettingV2]().InsertMany(settings) + _, err = service.NewModelService[models.SettingV2]().InsertMany(settings) if err != nil { return err } diff --git a/core/task/handler/runner.go b/core/task/handler/runner.go index 34fe048b..7e3bffcf 100644 --- a/core/task/handler/runner.go +++ b/core/task/handler/runner.go @@ -306,7 +306,7 @@ func (r *Runner) configureEnv() { } // global environment variables - envs, err := client.NewModelServiceV2[models.EnvironmentV2]().GetMany(nil, nil) + envs, err := client.NewModelService[models.EnvironmentV2]().GetMany(nil, nil) if err != nil { trace.PrintError(err) return @@ -501,12 +501,12 @@ func (r *Runner) updateTask(status string, e error) (err error) { r.t.Error = e.Error() } if r.svc.GetNodeConfigService().IsMaster() { - err = service.NewModelServiceV2[models.TaskV2]().ReplaceById(r.t.Id, *r.t) + err = service.NewModelService[models.TaskV2]().ReplaceById(r.t.Id, *r.t) if err != nil { return err } } else { - err = client.NewModelServiceV2[models.TaskV2]().ReplaceById(r.t.Id, *r.t) + err = client.NewModelService[models.TaskV2]().ReplaceById(r.t.Id, *r.t) if err != nil { return err } @@ -555,7 +555,7 @@ func (r *Runner) writeLogLines(lines []string) { } func (r *Runner) _updateTaskStat(status string) { - ts, err := client.NewModelServiceV2[models.TaskStatV2]().GetById(r.tid) + ts, err := client.NewModelService[models.TaskStatV2]().GetById(r.tid) if err != nil { trace.PrintError(err) return @@ -576,13 +576,13 @@ func (r *Runner) _updateTaskStat(status string) { ts.TotalDuration = ts.EndTs.Sub(ts.BaseModelV2.CreatedAt).Milliseconds() } if r.svc.GetNodeConfigService().IsMaster() { - err = service.NewModelServiceV2[models.TaskStatV2]().ReplaceById(ts.Id, *ts) + err = service.NewModelService[models.TaskStatV2]().ReplaceById(ts.Id, *ts) if err != nil { trace.PrintError(err) return } } else { - err = client.NewModelServiceV2[models.TaskStatV2]().ReplaceById(ts.Id, *ts) + err = client.NewModelService[models.TaskStatV2]().ReplaceById(ts.Id, *ts) if err != nil { trace.PrintError(err) return @@ -605,7 +605,7 @@ func (r *Runner) sendNotification() { func (r *Runner) _updateSpiderStat(status string) { // task stat - ts, err := client.NewModelServiceV2[models.TaskStatV2]().GetById(r.tid) + ts, err := client.NewModelService[models.TaskStatV2]().GetById(r.tid) if err != nil { trace.PrintError(err) return @@ -643,13 +643,13 @@ func (r *Runner) _updateSpiderStat(status string) { // perform update if r.svc.GetNodeConfigService().IsMaster() { - err = service.NewModelServiceV2[models.SpiderStatV2]().UpdateById(r.s.Id, update) + err = service.NewModelService[models.SpiderStatV2]().UpdateById(r.s.Id, update) if err != nil { trace.PrintError(err) return } } else { - err = client.NewModelServiceV2[models.SpiderStatV2]().UpdateById(r.s.Id, update) + err = client.NewModelService[models.SpiderStatV2]().UpdateById(r.s.Id, update) if err != nil { trace.PrintError(err) return diff --git a/core/task/handler/service.go b/core/task/handler/service.go index 001fbc71..788e0ad6 100644 --- a/core/task/handler/service.go +++ b/core/task/handler/service.go @@ -110,7 +110,7 @@ func (svc *Service) fetchAndRunTasks() { t.Error = err.Error() t.Status = constants.TaskStatusError t.SetUpdated(t.CreatedBy) - _ = client.NewModelServiceV2[models2.TaskV2]().ReplaceById(t.Id, *t) + _ = client.NewModelService[models2.TaskV2]().ReplaceById(t.Id, *t) continue } continue @@ -154,9 +154,9 @@ func (svc *Service) GetCurrentNode() (n *models2.NodeV2, err error) { // current node if svc.cfgSvc.IsMaster() { - n, err = service.NewModelServiceV2[models2.NodeV2]().GetOne(bson.M{"key": nodeKey}, nil) + n, err = service.NewModelService[models2.NodeV2]().GetOne(bson.M{"key": nodeKey}, nil) } else { - n, err = client.NewModelServiceV2[models2.NodeV2]().GetOne(bson.M{"key": nodeKey}, nil) + n, err = client.NewModelService[models2.NodeV2]().GetOne(bson.M{"key": nodeKey}, nil) } if err != nil { return nil, err @@ -167,9 +167,9 @@ func (svc *Service) GetCurrentNode() (n *models2.NodeV2, err error) { func (svc *Service) GetTaskById(id primitive.ObjectID) (t *models2.TaskV2, err error) { if svc.cfgSvc.IsMaster() { - t, err = service.NewModelServiceV2[models2.TaskV2]().GetById(id) + t, err = service.NewModelService[models2.TaskV2]().GetById(id) } else { - t, err = client.NewModelServiceV2[models2.TaskV2]().GetById(id) + t, err = client.NewModelService[models2.TaskV2]().GetById(id) } if err != nil { return nil, err @@ -181,9 +181,9 @@ func (svc *Service) GetTaskById(id primitive.ObjectID) (t *models2.TaskV2, err e func (svc *Service) UpdateTask(t *models2.TaskV2) (err error) { t.SetUpdated(t.CreatedBy) if svc.cfgSvc.IsMaster() { - err = service.NewModelServiceV2[models2.TaskV2]().ReplaceById(t.Id, *t) + err = service.NewModelService[models2.TaskV2]().ReplaceById(t.Id, *t) } else { - err = client.NewModelServiceV2[models2.TaskV2]().ReplaceById(t.Id, *t) + err = client.NewModelService[models2.TaskV2]().ReplaceById(t.Id, *t) } if err != nil { return err @@ -193,9 +193,9 @@ func (svc *Service) UpdateTask(t *models2.TaskV2) (err error) { func (svc *Service) GetSpiderById(id primitive.ObjectID) (s *models2.SpiderV2, err error) { if svc.cfgSvc.IsMaster() { - s, err = service.NewModelServiceV2[models2.SpiderV2]().GetById(id) + s, err = service.NewModelService[models2.SpiderV2]().GetById(id) } else { - s, err = client.NewModelServiceV2[models2.SpiderV2]().GetById(id) + s, err = client.NewModelService[models2.SpiderV2]().GetById(id) } if err != nil { return nil, err @@ -217,13 +217,13 @@ func (svc *Service) getRunnerCount() (count int) { }, } if svc.cfgSvc.IsMaster() { - count, err = service.NewModelServiceV2[models2.TaskV2]().Count(query) + count, err = service.NewModelService[models2.TaskV2]().Count(query) if err != nil { trace.PrintError(err) return } } else { - count, err = client.NewModelServiceV2[models2.TaskV2]().Count(query) + count, err = client.NewModelService[models2.TaskV2]().Count(query) if err != nil { trace.PrintError(err) return @@ -273,9 +273,9 @@ func (svc *Service) updateNodeStatus() (err error) { // save node n.SetUpdated(n.CreatedBy) if svc.cfgSvc.IsMaster() { - err = service.NewModelServiceV2[models2.NodeV2]().ReplaceById(n.Id, *n) + err = service.NewModelService[models2.NodeV2]().ReplaceById(n.Id, *n) } else { - err = client.NewModelServiceV2[models2.NodeV2]().ReplaceById(n.Id, *n) + err = client.NewModelService[models2.NodeV2]().ReplaceById(n.Id, *n) } if err != nil { return err diff --git a/core/task/scheduler/service.go b/core/task/scheduler/service.go index c739c870..18a78757 100644 --- a/core/task/scheduler/service.go +++ b/core/task/scheduler/service.go @@ -44,7 +44,7 @@ func (svc *Service) Enqueue(t *models2.TaskV2, by primitive.ObjectID) (t2 *model t.SetUpdated(by) // add task - taskModelSvc := service.NewModelServiceV2[models2.TaskV2]() + taskModelSvc := service.NewModelService[models2.TaskV2]() t.Id, err = taskModelSvc.InsertOne(*t) if err != nil { return nil, err @@ -57,7 +57,7 @@ func (svc *Service) Enqueue(t *models2.TaskV2, by primitive.ObjectID) (t2 *model ts.SetUpdated(by) // add task stat - _, err = service.NewModelServiceV2[models2.TaskStatV2]().InsertOne(ts) + _, err = service.NewModelService[models2.TaskStatV2]().InsertOne(ts) if err != nil { return nil, trace.TraceError(err) } @@ -68,7 +68,7 @@ func (svc *Service) Enqueue(t *models2.TaskV2, by primitive.ObjectID) (t2 *model func (svc *Service) Cancel(id, by primitive.ObjectID, force bool) (err error) { // task - t, err := service.NewModelServiceV2[models2.TaskV2]().GetById(id) + t, err := service.NewModelService[models2.TaskV2]().GetById(id) if err != nil { log.Errorf("task not found: %s", id.Hex()) return err @@ -145,18 +145,18 @@ func (svc *Service) SaveTask(t *models2.TaskV2, by primitive.ObjectID) (err erro if t.Id.IsZero() { t.SetCreated(by) t.SetUpdated(by) - _, err = service.NewModelServiceV2[models2.TaskV2]().InsertOne(*t) + _, err = service.NewModelService[models2.TaskV2]().InsertOne(*t) return err } else { t.SetUpdated(by) - return service.NewModelServiceV2[models2.TaskV2]().ReplaceById(t.Id, *t) + return service.NewModelService[models2.TaskV2]().ReplaceById(t.Id, *t) } } // initTaskStatus initialize task status of existing tasks func (svc *Service) initTaskStatus() { // set status of running tasks as TaskStatusAbnormal - runningTasks, err := service.NewModelServiceV2[models2.TaskV2]().GetMany(bson.M{ + runningTasks, err := service.NewModelService[models2.TaskV2]().GetMany(bson.M{ "status": bson.M{ "$in": []string{ constants.TaskStatusPending, @@ -186,7 +186,7 @@ func (svc *Service) isMasterNode(t *models2.TaskV2) (ok bool, err error) { if t.NodeId.IsZero() { return false, trace.TraceError(errors.ErrorTaskNoNodeId) } - n, err := service.NewModelServiceV2[models2.NodeV2]().GetById(t.NodeId) + n, err := service.NewModelService[models2.NodeV2]().GetById(t.NodeId) if err != nil { if errors2.Is(err, mongo2.ErrNoDocuments) { return false, trace.TraceError(errors.ErrorTaskNodeNotFound) @@ -199,7 +199,7 @@ func (svc *Service) isMasterNode(t *models2.TaskV2) (ok bool, err error) { func (svc *Service) cleanupTasks() { for { // task stats over 30 days ago - taskStats, err := service.NewModelServiceV2[models2.TaskStatV2]().GetMany(bson.M{ + taskStats, err := service.NewModelService[models2.TaskStatV2]().GetMany(bson.M{ "created_ts": bson.M{ "$lt": time.Now().Add(-30 * 24 * time.Hour), }, @@ -217,14 +217,14 @@ func (svc *Service) cleanupTasks() { if len(ids) > 0 { // remove tasks - if err := service.NewModelServiceV2[models2.TaskV2]().DeleteMany(bson.M{ + if err := service.NewModelService[models2.TaskV2]().DeleteMany(bson.M{ "_id": bson.M{"$in": ids}, }); err != nil { trace.PrintError(err) } // remove task stats - if err := service.NewModelServiceV2[models2.TaskStatV2]().DeleteMany(bson.M{ + if err := service.NewModelService[models2.TaskStatV2]().DeleteMany(bson.M{ "_id": bson.M{"$in": ids}, }); err != nil { trace.PrintError(err) diff --git a/core/task/stats/service.go b/core/task/stats/service.go index f88633b6..805ed81c 100644 --- a/core/task/stats/service.go +++ b/core/task/stats/service.go @@ -98,13 +98,13 @@ func (svc *Service) getDatabaseServiceItem(taskId primitive.ObjectID) (item *dat } // task - t, err := service.NewModelServiceV2[models2.TaskV2]().GetById(taskId) + t, err := service.NewModelService[models2.TaskV2]().GetById(taskId) if err != nil { return nil, err } // spider - s, err := service.NewModelServiceV2[models2.SpiderV2]().GetById(t.SpiderId) + s, err := service.NewModelService[models2.SpiderV2]().GetById(t.SpiderId) if err != nil { return nil, err } @@ -137,7 +137,7 @@ func (svc *Service) getDatabaseServiceItem(taskId primitive.ObjectID) (item *dat } func (svc *Service) updateTaskStats(id primitive.ObjectID, resultCount int) { - err := service.NewModelServiceV2[models2.TaskStatV2]().UpdateById(id, bson.M{ + err := service.NewModelService[models2.TaskStatV2]().UpdateById(id, bson.M{ "$inc": bson.M{ "result_count": resultCount, }, diff --git a/core/user/service_v2.go b/core/user/service_v2.go index eb618a16..eef97051 100644 --- a/core/user/service_v2.go +++ b/core/user/service_v2.go @@ -20,7 +20,7 @@ import ( type ServiceV2 struct { jwtSecret string jwtSigningMethod jwt.SigningMethod - modelSvc *service.ModelServiceV2[models.UserV2] + modelSvc *service.ModelService[models.UserV2] } func (svc *ServiceV2) Init() (err error) { @@ -171,7 +171,7 @@ func (svc *ServiceV2) getSecretFunc() jwt.Keyfunc { func newUserServiceV2() (svc *ServiceV2, err error) { // service svc = &ServiceV2{ - modelSvc: service.NewModelServiceV2[models.UserV2](), + modelSvc: service.NewModelService[models.UserV2](), jwtSecret: "crawlab", jwtSigningMethod: jwt.SigningMethodHS256, } diff --git a/grpc/LICENSE b/grpc/LICENSE deleted file mode 100644 index 3c0946b9..00000000 --- a/grpc/LICENSE +++ /dev/null @@ -1,29 +0,0 @@ -BSD 3-Clause License - -Copyright (c) 2021, Crawlab Team -All rights reserved. - -Redistribution and use in source and binary forms, with or without -modification, are permitted provided that the following conditions are met: - -1. Redistributions of source code must retain the above copyright notice, this - list of conditions and the following disclaimer. - -2. Redistributions in binary form must reproduce the above copyright notice, - this list of conditions and the following disclaimer in the documentation - and/or other materials provided with the distribution. - -3. Neither the name of the copyright holder nor the names of its - contributors may be used to endorse or promote products derived from - this software without specific prior written permission. - -THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" -AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE -IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE -DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE -FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL -DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR -SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER -CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, -OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE -OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. diff --git a/grpc/README.md b/grpc/README.md deleted file mode 100644 index 207b4216..00000000 --- a/grpc/README.md +++ /dev/null @@ -1,2 +0,0 @@ -# crawlab-grpc -gRPC for Crawlab diff --git a/grpc/dependency_service.pb.go b/grpc/dependency_service.pb.go new file mode 100644 index 00000000..29aa3727 --- /dev/null +++ b/grpc/dependency_service.pb.go @@ -0,0 +1,564 @@ +// Code generated by protoc-gen-go. DO NOT EDIT. +// versions: +// protoc-gen-go v1.34.2 +// protoc v5.27.2 +// source: services/dependency_service.proto + +package grpc + +import ( + protoreflect "google.golang.org/protobuf/reflect/protoreflect" + protoimpl "google.golang.org/protobuf/runtime/protoimpl" + reflect "reflect" + sync "sync" +) + +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) +) + +type DependencyServiceCode int32 + +const ( + DependencyServiceCode_SYNC DependencyServiceCode = 0 + DependencyServiceCode_INSTALL DependencyServiceCode = 1 + DependencyServiceCode_UNINSTALL DependencyServiceCode = 2 +) + +// Enum value maps for DependencyServiceCode. +var ( + DependencyServiceCode_name = map[int32]string{ + 0: "SYNC", + 1: "INSTALL", + 2: "UNINSTALL", + } + DependencyServiceCode_value = map[string]int32{ + "SYNC": 0, + "INSTALL": 1, + "UNINSTALL": 2, + } +) + +func (x DependencyServiceCode) Enum() *DependencyServiceCode { + p := new(DependencyServiceCode) + *p = x + return p +} + +func (x DependencyServiceCode) String() string { + return protoimpl.X.EnumStringOf(x.Descriptor(), protoreflect.EnumNumber(x)) +} + +func (DependencyServiceCode) Descriptor() protoreflect.EnumDescriptor { + return file_services_dependency_service_proto_enumTypes[0].Descriptor() +} + +func (DependencyServiceCode) Type() protoreflect.EnumType { + return &file_services_dependency_service_proto_enumTypes[0] +} + +func (x DependencyServiceCode) Number() protoreflect.EnumNumber { + return protoreflect.EnumNumber(x) +} + +// Deprecated: Use DependencyServiceCode.Descriptor instead. +func (DependencyServiceCode) EnumDescriptor() ([]byte, []int) { + return file_services_dependency_service_proto_rawDescGZIP(), []int{0} +} + +type Dependency struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + Name string `protobuf:"bytes,1,opt,name=name,proto3" json:"name,omitempty"` + Version string `protobuf:"bytes,2,opt,name=version,proto3" json:"version,omitempty"` +} + +func (x *Dependency) Reset() { + *x = Dependency{} + if protoimpl.UnsafeEnabled { + mi := &file_services_dependency_service_proto_msgTypes[0] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *Dependency) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*Dependency) ProtoMessage() {} + +func (x *Dependency) ProtoReflect() protoreflect.Message { + mi := &file_services_dependency_service_proto_msgTypes[0] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use Dependency.ProtoReflect.Descriptor instead. +func (*Dependency) Descriptor() ([]byte, []int) { + return file_services_dependency_service_proto_rawDescGZIP(), []int{0} +} + +func (x *Dependency) GetName() string { + if x != nil { + return x.Name + } + return "" +} + +func (x *Dependency) GetVersion() string { + if x != nil { + return x.Version + } + return "" +} + +type DependencyServiceConnectRequest struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + NodeKey string `protobuf:"bytes,1,opt,name=node_key,json=nodeKey,proto3" json:"node_key,omitempty"` +} + +func (x *DependencyServiceConnectRequest) Reset() { + *x = DependencyServiceConnectRequest{} + if protoimpl.UnsafeEnabled { + mi := &file_services_dependency_service_proto_msgTypes[1] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *DependencyServiceConnectRequest) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*DependencyServiceConnectRequest) ProtoMessage() {} + +func (x *DependencyServiceConnectRequest) ProtoReflect() protoreflect.Message { + mi := &file_services_dependency_service_proto_msgTypes[1] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use DependencyServiceConnectRequest.ProtoReflect.Descriptor instead. +func (*DependencyServiceConnectRequest) Descriptor() ([]byte, []int) { + return file_services_dependency_service_proto_rawDescGZIP(), []int{1} +} + +func (x *DependencyServiceConnectRequest) GetNodeKey() string { + if x != nil { + return x.NodeKey + } + return "" +} + +type DependencyServiceConnectResponse struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + Code DependencyServiceCode `protobuf:"varint,1,opt,name=code,proto3,enum=grpc.DependencyServiceCode" json:"code,omitempty"` + TaskId string `protobuf:"bytes,2,opt,name=task_id,json=taskId,proto3" json:"task_id,omitempty"` + Lang string `protobuf:"bytes,3,opt,name=lang,proto3" json:"lang,omitempty"` + Proxy string `protobuf:"bytes,4,opt,name=proxy,proto3" json:"proxy,omitempty"` + Dependencies []*Dependency `protobuf:"bytes,5,rep,name=dependencies,proto3" json:"dependencies,omitempty"` +} + +func (x *DependencyServiceConnectResponse) Reset() { + *x = DependencyServiceConnectResponse{} + if protoimpl.UnsafeEnabled { + mi := &file_services_dependency_service_proto_msgTypes[2] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *DependencyServiceConnectResponse) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*DependencyServiceConnectResponse) ProtoMessage() {} + +func (x *DependencyServiceConnectResponse) ProtoReflect() protoreflect.Message { + mi := &file_services_dependency_service_proto_msgTypes[2] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use DependencyServiceConnectResponse.ProtoReflect.Descriptor instead. +func (*DependencyServiceConnectResponse) Descriptor() ([]byte, []int) { + return file_services_dependency_service_proto_rawDescGZIP(), []int{2} +} + +func (x *DependencyServiceConnectResponse) GetCode() DependencyServiceCode { + if x != nil { + return x.Code + } + return DependencyServiceCode_SYNC +} + +func (x *DependencyServiceConnectResponse) GetTaskId() string { + if x != nil { + return x.TaskId + } + return "" +} + +func (x *DependencyServiceConnectResponse) GetLang() string { + if x != nil { + return x.Lang + } + return "" +} + +func (x *DependencyServiceConnectResponse) GetProxy() string { + if x != nil { + return x.Proxy + } + return "" +} + +func (x *DependencyServiceConnectResponse) GetDependencies() []*Dependency { + if x != nil { + return x.Dependencies + } + return nil +} + +type DependencyServiceSyncRequest struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + NodeKey string `protobuf:"bytes,1,opt,name=node_key,json=nodeKey,proto3" json:"node_key,omitempty"` + Lang string `protobuf:"bytes,2,opt,name=lang,proto3" json:"lang,omitempty"` + Dependencies []*Dependency `protobuf:"bytes,3,rep,name=dependencies,proto3" json:"dependencies,omitempty"` +} + +func (x *DependencyServiceSyncRequest) Reset() { + *x = DependencyServiceSyncRequest{} + if protoimpl.UnsafeEnabled { + mi := &file_services_dependency_service_proto_msgTypes[3] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *DependencyServiceSyncRequest) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*DependencyServiceSyncRequest) ProtoMessage() {} + +func (x *DependencyServiceSyncRequest) ProtoReflect() protoreflect.Message { + mi := &file_services_dependency_service_proto_msgTypes[3] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use DependencyServiceSyncRequest.ProtoReflect.Descriptor instead. +func (*DependencyServiceSyncRequest) Descriptor() ([]byte, []int) { + return file_services_dependency_service_proto_rawDescGZIP(), []int{3} +} + +func (x *DependencyServiceSyncRequest) GetNodeKey() string { + if x != nil { + return x.NodeKey + } + return "" +} + +func (x *DependencyServiceSyncRequest) GetLang() string { + if x != nil { + return x.Lang + } + return "" +} + +func (x *DependencyServiceSyncRequest) GetDependencies() []*Dependency { + if x != nil { + return x.Dependencies + } + return nil +} + +type DependencyServiceUpdateTaskLogRequest struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + TaskId string `protobuf:"bytes,1,opt,name=task_id,json=taskId,proto3" json:"task_id,omitempty"` + LogLines []string `protobuf:"bytes,2,rep,name=log_lines,json=logLines,proto3" json:"log_lines,omitempty"` +} + +func (x *DependencyServiceUpdateTaskLogRequest) Reset() { + *x = DependencyServiceUpdateTaskLogRequest{} + if protoimpl.UnsafeEnabled { + mi := &file_services_dependency_service_proto_msgTypes[4] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *DependencyServiceUpdateTaskLogRequest) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*DependencyServiceUpdateTaskLogRequest) ProtoMessage() {} + +func (x *DependencyServiceUpdateTaskLogRequest) ProtoReflect() protoreflect.Message { + mi := &file_services_dependency_service_proto_msgTypes[4] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use DependencyServiceUpdateTaskLogRequest.ProtoReflect.Descriptor instead. +func (*DependencyServiceUpdateTaskLogRequest) Descriptor() ([]byte, []int) { + return file_services_dependency_service_proto_rawDescGZIP(), []int{4} +} + +func (x *DependencyServiceUpdateTaskLogRequest) GetTaskId() string { + if x != nil { + return x.TaskId + } + return "" +} + +func (x *DependencyServiceUpdateTaskLogRequest) GetLogLines() []string { + if x != nil { + return x.LogLines + } + return nil +} + +var File_services_dependency_service_proto protoreflect.FileDescriptor + +var file_services_dependency_service_proto_rawDesc = []byte{ + 0x0a, 0x21, 0x73, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x73, 0x2f, 0x64, 0x65, 0x70, 0x65, 0x6e, + 0x64, 0x65, 0x6e, 0x63, 0x79, 0x5f, 0x73, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x2e, 0x70, 0x72, + 0x6f, 0x74, 0x6f, 0x12, 0x04, 0x67, 0x72, 0x70, 0x63, 0x1a, 0x15, 0x65, 0x6e, 0x74, 0x69, 0x74, + 0x79, 0x2f, 0x72, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, + 0x22, 0x3a, 0x0a, 0x0a, 0x44, 0x65, 0x70, 0x65, 0x6e, 0x64, 0x65, 0x6e, 0x63, 0x79, 0x12, 0x12, + 0x0a, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, 0x6e, 0x61, + 0x6d, 0x65, 0x12, 0x18, 0x0a, 0x07, 0x76, 0x65, 0x72, 0x73, 0x69, 0x6f, 0x6e, 0x18, 0x02, 0x20, + 0x01, 0x28, 0x09, 0x52, 0x07, 0x76, 0x65, 0x72, 0x73, 0x69, 0x6f, 0x6e, 0x22, 0x3c, 0x0a, 0x1f, + 0x44, 0x65, 0x70, 0x65, 0x6e, 0x64, 0x65, 0x6e, 0x63, 0x79, 0x53, 0x65, 0x72, 0x76, 0x69, 0x63, + 0x65, 0x43, 0x6f, 0x6e, 0x6e, 0x65, 0x63, 0x74, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, + 0x19, 0x0a, 0x08, 0x6e, 0x6f, 0x64, 0x65, 0x5f, 0x6b, 0x65, 0x79, 0x18, 0x01, 0x20, 0x01, 0x28, + 0x09, 0x52, 0x07, 0x6e, 0x6f, 0x64, 0x65, 0x4b, 0x65, 0x79, 0x22, 0xcc, 0x01, 0x0a, 0x20, 0x44, + 0x65, 0x70, 0x65, 0x6e, 0x64, 0x65, 0x6e, 0x63, 0x79, 0x53, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, + 0x43, 0x6f, 0x6e, 0x6e, 0x65, 0x63, 0x74, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, + 0x2f, 0x0a, 0x04, 0x63, 0x6f, 0x64, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0e, 0x32, 0x1b, 0x2e, + 0x67, 0x72, 0x70, 0x63, 0x2e, 0x44, 0x65, 0x70, 0x65, 0x6e, 0x64, 0x65, 0x6e, 0x63, 0x79, 0x53, + 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x43, 0x6f, 0x64, 0x65, 0x52, 0x04, 0x63, 0x6f, 0x64, 0x65, + 0x12, 0x17, 0x0a, 0x07, 0x74, 0x61, 0x73, 0x6b, 0x5f, 0x69, 0x64, 0x18, 0x02, 0x20, 0x01, 0x28, + 0x09, 0x52, 0x06, 0x74, 0x61, 0x73, 0x6b, 0x49, 0x64, 0x12, 0x12, 0x0a, 0x04, 0x6c, 0x61, 0x6e, + 0x67, 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, 0x6c, 0x61, 0x6e, 0x67, 0x12, 0x14, 0x0a, + 0x05, 0x70, 0x72, 0x6f, 0x78, 0x79, 0x18, 0x04, 0x20, 0x01, 0x28, 0x09, 0x52, 0x05, 0x70, 0x72, + 0x6f, 0x78, 0x79, 0x12, 0x34, 0x0a, 0x0c, 0x64, 0x65, 0x70, 0x65, 0x6e, 0x64, 0x65, 0x6e, 0x63, + 0x69, 0x65, 0x73, 0x18, 0x05, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x10, 0x2e, 0x67, 0x72, 0x70, 0x63, + 0x2e, 0x44, 0x65, 0x70, 0x65, 0x6e, 0x64, 0x65, 0x6e, 0x63, 0x79, 0x52, 0x0c, 0x64, 0x65, 0x70, + 0x65, 0x6e, 0x64, 0x65, 0x6e, 0x63, 0x69, 0x65, 0x73, 0x22, 0x83, 0x01, 0x0a, 0x1c, 0x44, 0x65, + 0x70, 0x65, 0x6e, 0x64, 0x65, 0x6e, 0x63, 0x79, 0x53, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x53, + 0x79, 0x6e, 0x63, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x19, 0x0a, 0x08, 0x6e, 0x6f, + 0x64, 0x65, 0x5f, 0x6b, 0x65, 0x79, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x07, 0x6e, 0x6f, + 0x64, 0x65, 0x4b, 0x65, 0x79, 0x12, 0x12, 0x0a, 0x04, 0x6c, 0x61, 0x6e, 0x67, 0x18, 0x02, 0x20, + 0x01, 0x28, 0x09, 0x52, 0x04, 0x6c, 0x61, 0x6e, 0x67, 0x12, 0x34, 0x0a, 0x0c, 0x64, 0x65, 0x70, + 0x65, 0x6e, 0x64, 0x65, 0x6e, 0x63, 0x69, 0x65, 0x73, 0x18, 0x03, 0x20, 0x03, 0x28, 0x0b, 0x32, + 0x10, 0x2e, 0x67, 0x72, 0x70, 0x63, 0x2e, 0x44, 0x65, 0x70, 0x65, 0x6e, 0x64, 0x65, 0x6e, 0x63, + 0x79, 0x52, 0x0c, 0x64, 0x65, 0x70, 0x65, 0x6e, 0x64, 0x65, 0x6e, 0x63, 0x69, 0x65, 0x73, 0x22, + 0x5d, 0x0a, 0x25, 0x44, 0x65, 0x70, 0x65, 0x6e, 0x64, 0x65, 0x6e, 0x63, 0x79, 0x53, 0x65, 0x72, + 0x76, 0x69, 0x63, 0x65, 0x55, 0x70, 0x64, 0x61, 0x74, 0x65, 0x54, 0x61, 0x73, 0x6b, 0x4c, 0x6f, + 0x67, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x17, 0x0a, 0x07, 0x74, 0x61, 0x73, 0x6b, + 0x5f, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x06, 0x74, 0x61, 0x73, 0x6b, 0x49, + 0x64, 0x12, 0x1b, 0x0a, 0x09, 0x6c, 0x6f, 0x67, 0x5f, 0x6c, 0x69, 0x6e, 0x65, 0x73, 0x18, 0x02, + 0x20, 0x03, 0x28, 0x09, 0x52, 0x08, 0x6c, 0x6f, 0x67, 0x4c, 0x69, 0x6e, 0x65, 0x73, 0x2a, 0x3d, + 0x0a, 0x15, 0x44, 0x65, 0x70, 0x65, 0x6e, 0x64, 0x65, 0x6e, 0x63, 0x79, 0x53, 0x65, 0x72, 0x76, + 0x69, 0x63, 0x65, 0x43, 0x6f, 0x64, 0x65, 0x12, 0x08, 0x0a, 0x04, 0x53, 0x59, 0x4e, 0x43, 0x10, + 0x00, 0x12, 0x0b, 0x0a, 0x07, 0x49, 0x4e, 0x53, 0x54, 0x41, 0x4c, 0x4c, 0x10, 0x01, 0x12, 0x0d, + 0x0a, 0x09, 0x55, 0x4e, 0x49, 0x4e, 0x53, 0x54, 0x41, 0x4c, 0x4c, 0x10, 0x02, 0x32, 0x81, 0x02, + 0x0a, 0x11, 0x44, 0x65, 0x70, 0x65, 0x6e, 0x64, 0x65, 0x6e, 0x63, 0x79, 0x53, 0x65, 0x72, 0x76, + 0x69, 0x63, 0x65, 0x12, 0x5c, 0x0a, 0x07, 0x43, 0x6f, 0x6e, 0x6e, 0x65, 0x63, 0x74, 0x12, 0x25, + 0x2e, 0x67, 0x72, 0x70, 0x63, 0x2e, 0x44, 0x65, 0x70, 0x65, 0x6e, 0x64, 0x65, 0x6e, 0x63, 0x79, + 0x53, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x43, 0x6f, 0x6e, 0x6e, 0x65, 0x63, 0x74, 0x52, 0x65, + 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x26, 0x2e, 0x67, 0x72, 0x70, 0x63, 0x2e, 0x44, 0x65, 0x70, + 0x65, 0x6e, 0x64, 0x65, 0x6e, 0x63, 0x79, 0x53, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x43, 0x6f, + 0x6e, 0x6e, 0x65, 0x63, 0x74, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x00, 0x30, + 0x01, 0x12, 0x3c, 0x0a, 0x04, 0x53, 0x79, 0x6e, 0x63, 0x12, 0x22, 0x2e, 0x67, 0x72, 0x70, 0x63, + 0x2e, 0x44, 0x65, 0x70, 0x65, 0x6e, 0x64, 0x65, 0x6e, 0x63, 0x79, 0x53, 0x65, 0x72, 0x76, 0x69, + 0x63, 0x65, 0x53, 0x79, 0x6e, 0x63, 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, + 0x50, 0x0a, 0x0d, 0x55, 0x70, 0x64, 0x61, 0x74, 0x65, 0x54, 0x61, 0x73, 0x6b, 0x4c, 0x6f, 0x67, + 0x12, 0x2b, 0x2e, 0x67, 0x72, 0x70, 0x63, 0x2e, 0x44, 0x65, 0x70, 0x65, 0x6e, 0x64, 0x65, 0x6e, + 0x63, 0x79, 0x53, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x55, 0x70, 0x64, 0x61, 0x74, 0x65, 0x54, + 0x61, 0x73, 0x6b, 0x4c, 0x6f, 0x67, 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, 0x28, + 0x01, 0x42, 0x08, 0x5a, 0x06, 0x2e, 0x3b, 0x67, 0x72, 0x70, 0x63, 0x62, 0x06, 0x70, 0x72, 0x6f, + 0x74, 0x6f, 0x33, +} + +var ( + file_services_dependency_service_proto_rawDescOnce sync.Once + file_services_dependency_service_proto_rawDescData = file_services_dependency_service_proto_rawDesc +) + +func file_services_dependency_service_proto_rawDescGZIP() []byte { + file_services_dependency_service_proto_rawDescOnce.Do(func() { + file_services_dependency_service_proto_rawDescData = protoimpl.X.CompressGZIP(file_services_dependency_service_proto_rawDescData) + }) + return file_services_dependency_service_proto_rawDescData +} + +var file_services_dependency_service_proto_enumTypes = make([]protoimpl.EnumInfo, 1) +var file_services_dependency_service_proto_msgTypes = make([]protoimpl.MessageInfo, 5) +var file_services_dependency_service_proto_goTypes = []any{ + (DependencyServiceCode)(0), // 0: grpc.DependencyServiceCode + (*Dependency)(nil), // 1: grpc.Dependency + (*DependencyServiceConnectRequest)(nil), // 2: grpc.DependencyServiceConnectRequest + (*DependencyServiceConnectResponse)(nil), // 3: grpc.DependencyServiceConnectResponse + (*DependencyServiceSyncRequest)(nil), // 4: grpc.DependencyServiceSyncRequest + (*DependencyServiceUpdateTaskLogRequest)(nil), // 5: grpc.DependencyServiceUpdateTaskLogRequest + (*Response)(nil), // 6: grpc.Response +} +var file_services_dependency_service_proto_depIdxs = []int32{ + 0, // 0: grpc.DependencyServiceConnectResponse.code:type_name -> grpc.DependencyServiceCode + 1, // 1: grpc.DependencyServiceConnectResponse.dependencies:type_name -> grpc.Dependency + 1, // 2: grpc.DependencyServiceSyncRequest.dependencies:type_name -> grpc.Dependency + 2, // 3: grpc.DependencyService.Connect:input_type -> grpc.DependencyServiceConnectRequest + 4, // 4: grpc.DependencyService.Sync:input_type -> grpc.DependencyServiceSyncRequest + 5, // 5: grpc.DependencyService.UpdateTaskLog:input_type -> grpc.DependencyServiceUpdateTaskLogRequest + 3, // 6: grpc.DependencyService.Connect:output_type -> grpc.DependencyServiceConnectResponse + 6, // 7: grpc.DependencyService.Sync:output_type -> grpc.Response + 6, // 8: grpc.DependencyService.UpdateTaskLog:output_type -> grpc.Response + 6, // [6:9] is the sub-list for method output_type + 3, // [3:6] is the sub-list for method input_type + 3, // [3:3] is the sub-list for extension type_name + 3, // [3:3] is the sub-list for extension extendee + 0, // [0:3] is the sub-list for field type_name +} + +func init() { file_services_dependency_service_proto_init() } +func file_services_dependency_service_proto_init() { + if File_services_dependency_service_proto != nil { + return + } + file_entity_response_proto_init() + if !protoimpl.UnsafeEnabled { + file_services_dependency_service_proto_msgTypes[0].Exporter = func(v any, i int) any { + switch v := v.(*Dependency); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_services_dependency_service_proto_msgTypes[1].Exporter = func(v any, i int) any { + switch v := v.(*DependencyServiceConnectRequest); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_services_dependency_service_proto_msgTypes[2].Exporter = func(v any, i int) any { + switch v := v.(*DependencyServiceConnectResponse); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_services_dependency_service_proto_msgTypes[3].Exporter = func(v any, i int) any { + switch v := v.(*DependencyServiceSyncRequest); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_services_dependency_service_proto_msgTypes[4].Exporter = func(v any, i int) any { + switch v := v.(*DependencyServiceUpdateTaskLogRequest); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + } + type x struct{} + out := protoimpl.TypeBuilder{ + File: protoimpl.DescBuilder{ + GoPackagePath: reflect.TypeOf(x{}).PkgPath(), + RawDescriptor: file_services_dependency_service_proto_rawDesc, + NumEnums: 1, + NumMessages: 5, + NumExtensions: 0, + NumServices: 1, + }, + GoTypes: file_services_dependency_service_proto_goTypes, + DependencyIndexes: file_services_dependency_service_proto_depIdxs, + EnumInfos: file_services_dependency_service_proto_enumTypes, + MessageInfos: file_services_dependency_service_proto_msgTypes, + }.Build() + File_services_dependency_service_proto = out.File + file_services_dependency_service_proto_rawDesc = nil + file_services_dependency_service_proto_goTypes = nil + file_services_dependency_service_proto_depIdxs = nil +} diff --git a/grpc/dependency_service_grpc.pb.go b/grpc/dependency_service_grpc.pb.go new file mode 100644 index 00000000..d43edfbb --- /dev/null +++ b/grpc/dependency_service_grpc.pb.go @@ -0,0 +1,248 @@ +// Code generated by protoc-gen-go-grpc. DO NOT EDIT. +// versions: +// - protoc-gen-go-grpc v1.4.0 +// - protoc v5.27.2 +// source: services/dependency_service.proto + +package grpc + +import ( + context "context" + grpc "google.golang.org/grpc" + codes "google.golang.org/grpc/codes" + status "google.golang.org/grpc/status" +) + +// This is a compile-time assertion to ensure that this generated file +// is compatible with the grpc package it is being compiled against. +// Requires gRPC-Go v1.62.0 or later. +const _ = grpc.SupportPackageIsVersion8 + +const ( + DependencyService_Connect_FullMethodName = "/grpc.DependencyService/Connect" + DependencyService_Sync_FullMethodName = "/grpc.DependencyService/Sync" + DependencyService_UpdateTaskLog_FullMethodName = "/grpc.DependencyService/UpdateTaskLog" +) + +// DependencyServiceClient is the client API for DependencyService service. +// +// For semantics around ctx use and closing/ending streaming RPCs, please refer to https://pkg.go.dev/google.golang.org/grpc/?tab=doc#ClientConn.NewStream. +type DependencyServiceClient interface { + Connect(ctx context.Context, in *DependencyServiceConnectRequest, opts ...grpc.CallOption) (DependencyService_ConnectClient, error) + Sync(ctx context.Context, in *DependencyServiceSyncRequest, opts ...grpc.CallOption) (*Response, error) + UpdateTaskLog(ctx context.Context, opts ...grpc.CallOption) (DependencyService_UpdateTaskLogClient, error) +} + +type dependencyServiceClient struct { + cc grpc.ClientConnInterface +} + +func NewDependencyServiceClient(cc grpc.ClientConnInterface) DependencyServiceClient { + return &dependencyServiceClient{cc} +} + +func (c *dependencyServiceClient) Connect(ctx context.Context, in *DependencyServiceConnectRequest, opts ...grpc.CallOption) (DependencyService_ConnectClient, error) { + cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...) + stream, err := c.cc.NewStream(ctx, &DependencyService_ServiceDesc.Streams[0], DependencyService_Connect_FullMethodName, cOpts...) + if err != nil { + return nil, err + } + x := &dependencyServiceConnectClient{ClientStream: stream} + if err := x.ClientStream.SendMsg(in); err != nil { + return nil, err + } + if err := x.ClientStream.CloseSend(); err != nil { + return nil, err + } + return x, nil +} + +type DependencyService_ConnectClient interface { + Recv() (*DependencyServiceConnectResponse, error) + grpc.ClientStream +} + +type dependencyServiceConnectClient struct { + grpc.ClientStream +} + +func (x *dependencyServiceConnectClient) Recv() (*DependencyServiceConnectResponse, error) { + m := new(DependencyServiceConnectResponse) + if err := x.ClientStream.RecvMsg(m); err != nil { + return nil, err + } + return m, nil +} + +func (c *dependencyServiceClient) Sync(ctx context.Context, in *DependencyServiceSyncRequest, opts ...grpc.CallOption) (*Response, error) { + cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...) + out := new(Response) + err := c.cc.Invoke(ctx, DependencyService_Sync_FullMethodName, in, out, cOpts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *dependencyServiceClient) UpdateTaskLog(ctx context.Context, opts ...grpc.CallOption) (DependencyService_UpdateTaskLogClient, error) { + cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...) + stream, err := c.cc.NewStream(ctx, &DependencyService_ServiceDesc.Streams[1], DependencyService_UpdateTaskLog_FullMethodName, cOpts...) + if err != nil { + return nil, err + } + x := &dependencyServiceUpdateTaskLogClient{ClientStream: stream} + return x, nil +} + +type DependencyService_UpdateTaskLogClient interface { + Send(*DependencyServiceUpdateTaskLogRequest) error + CloseAndRecv() (*Response, error) + grpc.ClientStream +} + +type dependencyServiceUpdateTaskLogClient struct { + grpc.ClientStream +} + +func (x *dependencyServiceUpdateTaskLogClient) Send(m *DependencyServiceUpdateTaskLogRequest) error { + return x.ClientStream.SendMsg(m) +} + +func (x *dependencyServiceUpdateTaskLogClient) CloseAndRecv() (*Response, error) { + if err := x.ClientStream.CloseSend(); err != nil { + return nil, err + } + m := new(Response) + if err := x.ClientStream.RecvMsg(m); err != nil { + return nil, err + } + return m, nil +} + +// DependencyServiceServer is the server API for DependencyService service. +// All implementations must embed UnimplementedDependencyServiceServer +// for forward compatibility +type DependencyServiceServer interface { + Connect(*DependencyServiceConnectRequest, DependencyService_ConnectServer) error + Sync(context.Context, *DependencyServiceSyncRequest) (*Response, error) + UpdateTaskLog(DependencyService_UpdateTaskLogServer) error + mustEmbedUnimplementedDependencyServiceServer() +} + +// UnimplementedDependencyServiceServer must be embedded to have forward compatible implementations. +type UnimplementedDependencyServiceServer struct { +} + +func (UnimplementedDependencyServiceServer) Connect(*DependencyServiceConnectRequest, DependencyService_ConnectServer) error { + return status.Errorf(codes.Unimplemented, "method Connect not implemented") +} +func (UnimplementedDependencyServiceServer) Sync(context.Context, *DependencyServiceSyncRequest) (*Response, error) { + return nil, status.Errorf(codes.Unimplemented, "method Sync not implemented") +} +func (UnimplementedDependencyServiceServer) UpdateTaskLog(DependencyService_UpdateTaskLogServer) error { + return status.Errorf(codes.Unimplemented, "method UpdateTaskLog not implemented") +} +func (UnimplementedDependencyServiceServer) mustEmbedUnimplementedDependencyServiceServer() {} + +// UnsafeDependencyServiceServer may be embedded to opt out of forward compatibility for this service. +// Use of this interface is not recommended, as added methods to DependencyServiceServer will +// result in compilation errors. +type UnsafeDependencyServiceServer interface { + mustEmbedUnimplementedDependencyServiceServer() +} + +func RegisterDependencyServiceServer(s grpc.ServiceRegistrar, srv DependencyServiceServer) { + s.RegisterService(&DependencyService_ServiceDesc, srv) +} + +func _DependencyService_Connect_Handler(srv interface{}, stream grpc.ServerStream) error { + m := new(DependencyServiceConnectRequest) + if err := stream.RecvMsg(m); err != nil { + return err + } + return srv.(DependencyServiceServer).Connect(m, &dependencyServiceConnectServer{ServerStream: stream}) +} + +type DependencyService_ConnectServer interface { + Send(*DependencyServiceConnectResponse) error + grpc.ServerStream +} + +type dependencyServiceConnectServer struct { + grpc.ServerStream +} + +func (x *dependencyServiceConnectServer) Send(m *DependencyServiceConnectResponse) error { + return x.ServerStream.SendMsg(m) +} + +func _DependencyService_Sync_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(DependencyServiceSyncRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(DependencyServiceServer).Sync(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: DependencyService_Sync_FullMethodName, + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(DependencyServiceServer).Sync(ctx, req.(*DependencyServiceSyncRequest)) + } + return interceptor(ctx, in, info, handler) +} + +func _DependencyService_UpdateTaskLog_Handler(srv interface{}, stream grpc.ServerStream) error { + return srv.(DependencyServiceServer).UpdateTaskLog(&dependencyServiceUpdateTaskLogServer{ServerStream: stream}) +} + +type DependencyService_UpdateTaskLogServer interface { + SendAndClose(*Response) error + Recv() (*DependencyServiceUpdateTaskLogRequest, error) + grpc.ServerStream +} + +type dependencyServiceUpdateTaskLogServer struct { + grpc.ServerStream +} + +func (x *dependencyServiceUpdateTaskLogServer) SendAndClose(m *Response) error { + return x.ServerStream.SendMsg(m) +} + +func (x *dependencyServiceUpdateTaskLogServer) Recv() (*DependencyServiceUpdateTaskLogRequest, error) { + m := new(DependencyServiceUpdateTaskLogRequest) + if err := x.ServerStream.RecvMsg(m); err != nil { + return nil, err + } + return m, nil +} + +// DependencyService_ServiceDesc is the grpc.ServiceDesc for DependencyService service. +// It's only intended for direct use with grpc.RegisterService, +// and not to be introspected or modified (even as a copy) +var DependencyService_ServiceDesc = grpc.ServiceDesc{ + ServiceName: "grpc.DependencyService", + HandlerType: (*DependencyServiceServer)(nil), + Methods: []grpc.MethodDesc{ + { + MethodName: "Sync", + Handler: _DependencyService_Sync_Handler, + }, + }, + Streams: []grpc.StreamDesc{ + { + StreamName: "Connect", + Handler: _DependencyService_Connect_Handler, + ServerStreams: true, + }, + { + StreamName: "UpdateTaskLog", + Handler: _DependencyService_UpdateTaskLog_Handler, + ClientStreams: true, + }, + }, + Metadata: "services/dependency_service.proto", +} diff --git a/grpc/dependency_service_v2.pb.go b/grpc/dependency_service_v2.pb.go deleted file mode 100644 index 092c0762..00000000 --- a/grpc/dependency_service_v2.pb.go +++ /dev/null @@ -1,565 +0,0 @@ -// Code generated by protoc-gen-go. DO NOT EDIT. -// versions: -// protoc-gen-go v1.34.2 -// protoc v5.27.2 -// source: services/dependency_service_v2.proto - -package grpc - -import ( - protoreflect "google.golang.org/protobuf/reflect/protoreflect" - protoimpl "google.golang.org/protobuf/runtime/protoimpl" - reflect "reflect" - sync "sync" -) - -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) -) - -type DependencyServiceV2Code int32 - -const ( - DependencyServiceV2Code_SYNC DependencyServiceV2Code = 0 - DependencyServiceV2Code_INSTALL DependencyServiceV2Code = 1 - DependencyServiceV2Code_UNINSTALL DependencyServiceV2Code = 2 -) - -// Enum value maps for DependencyServiceV2Code. -var ( - DependencyServiceV2Code_name = map[int32]string{ - 0: "SYNC", - 1: "INSTALL", - 2: "UNINSTALL", - } - DependencyServiceV2Code_value = map[string]int32{ - "SYNC": 0, - "INSTALL": 1, - "UNINSTALL": 2, - } -) - -func (x DependencyServiceV2Code) Enum() *DependencyServiceV2Code { - p := new(DependencyServiceV2Code) - *p = x - return p -} - -func (x DependencyServiceV2Code) String() string { - return protoimpl.X.EnumStringOf(x.Descriptor(), protoreflect.EnumNumber(x)) -} - -func (DependencyServiceV2Code) Descriptor() protoreflect.EnumDescriptor { - return file_services_dependency_service_v2_proto_enumTypes[0].Descriptor() -} - -func (DependencyServiceV2Code) Type() protoreflect.EnumType { - return &file_services_dependency_service_v2_proto_enumTypes[0] -} - -func (x DependencyServiceV2Code) Number() protoreflect.EnumNumber { - return protoreflect.EnumNumber(x) -} - -// Deprecated: Use DependencyServiceV2Code.Descriptor instead. -func (DependencyServiceV2Code) EnumDescriptor() ([]byte, []int) { - return file_services_dependency_service_v2_proto_rawDescGZIP(), []int{0} -} - -type Dependency struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - - Name string `protobuf:"bytes,1,opt,name=name,proto3" json:"name,omitempty"` - Version string `protobuf:"bytes,2,opt,name=version,proto3" json:"version,omitempty"` -} - -func (x *Dependency) Reset() { - *x = Dependency{} - if protoimpl.UnsafeEnabled { - mi := &file_services_dependency_service_v2_proto_msgTypes[0] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } -} - -func (x *Dependency) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*Dependency) ProtoMessage() {} - -func (x *Dependency) ProtoReflect() protoreflect.Message { - mi := &file_services_dependency_service_v2_proto_msgTypes[0] - if protoimpl.UnsafeEnabled && x != nil { - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - if ms.LoadMessageInfo() == nil { - ms.StoreMessageInfo(mi) - } - return ms - } - return mi.MessageOf(x) -} - -// Deprecated: Use Dependency.ProtoReflect.Descriptor instead. -func (*Dependency) Descriptor() ([]byte, []int) { - return file_services_dependency_service_v2_proto_rawDescGZIP(), []int{0} -} - -func (x *Dependency) GetName() string { - if x != nil { - return x.Name - } - return "" -} - -func (x *Dependency) GetVersion() string { - if x != nil { - return x.Version - } - return "" -} - -type DependencyServiceV2ConnectRequest struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - - NodeKey string `protobuf:"bytes,1,opt,name=node_key,json=nodeKey,proto3" json:"node_key,omitempty"` -} - -func (x *DependencyServiceV2ConnectRequest) Reset() { - *x = DependencyServiceV2ConnectRequest{} - if protoimpl.UnsafeEnabled { - mi := &file_services_dependency_service_v2_proto_msgTypes[1] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } -} - -func (x *DependencyServiceV2ConnectRequest) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*DependencyServiceV2ConnectRequest) ProtoMessage() {} - -func (x *DependencyServiceV2ConnectRequest) ProtoReflect() protoreflect.Message { - mi := &file_services_dependency_service_v2_proto_msgTypes[1] - if protoimpl.UnsafeEnabled && x != nil { - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - if ms.LoadMessageInfo() == nil { - ms.StoreMessageInfo(mi) - } - return ms - } - return mi.MessageOf(x) -} - -// Deprecated: Use DependencyServiceV2ConnectRequest.ProtoReflect.Descriptor instead. -func (*DependencyServiceV2ConnectRequest) Descriptor() ([]byte, []int) { - return file_services_dependency_service_v2_proto_rawDescGZIP(), []int{1} -} - -func (x *DependencyServiceV2ConnectRequest) GetNodeKey() string { - if x != nil { - return x.NodeKey - } - return "" -} - -type DependencyServiceV2ConnectResponse struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - - Code DependencyServiceV2Code `protobuf:"varint,1,opt,name=code,proto3,enum=grpc.DependencyServiceV2Code" json:"code,omitempty"` - TaskId string `protobuf:"bytes,2,opt,name=task_id,json=taskId,proto3" json:"task_id,omitempty"` - Lang string `protobuf:"bytes,3,opt,name=lang,proto3" json:"lang,omitempty"` - Proxy string `protobuf:"bytes,4,opt,name=proxy,proto3" json:"proxy,omitempty"` - Dependencies []*Dependency `protobuf:"bytes,5,rep,name=dependencies,proto3" json:"dependencies,omitempty"` -} - -func (x *DependencyServiceV2ConnectResponse) Reset() { - *x = DependencyServiceV2ConnectResponse{} - if protoimpl.UnsafeEnabled { - mi := &file_services_dependency_service_v2_proto_msgTypes[2] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } -} - -func (x *DependencyServiceV2ConnectResponse) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*DependencyServiceV2ConnectResponse) ProtoMessage() {} - -func (x *DependencyServiceV2ConnectResponse) ProtoReflect() protoreflect.Message { - mi := &file_services_dependency_service_v2_proto_msgTypes[2] - if protoimpl.UnsafeEnabled && x != nil { - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - if ms.LoadMessageInfo() == nil { - ms.StoreMessageInfo(mi) - } - return ms - } - return mi.MessageOf(x) -} - -// Deprecated: Use DependencyServiceV2ConnectResponse.ProtoReflect.Descriptor instead. -func (*DependencyServiceV2ConnectResponse) Descriptor() ([]byte, []int) { - return file_services_dependency_service_v2_proto_rawDescGZIP(), []int{2} -} - -func (x *DependencyServiceV2ConnectResponse) GetCode() DependencyServiceV2Code { - if x != nil { - return x.Code - } - return DependencyServiceV2Code_SYNC -} - -func (x *DependencyServiceV2ConnectResponse) GetTaskId() string { - if x != nil { - return x.TaskId - } - return "" -} - -func (x *DependencyServiceV2ConnectResponse) GetLang() string { - if x != nil { - return x.Lang - } - return "" -} - -func (x *DependencyServiceV2ConnectResponse) GetProxy() string { - if x != nil { - return x.Proxy - } - return "" -} - -func (x *DependencyServiceV2ConnectResponse) GetDependencies() []*Dependency { - if x != nil { - return x.Dependencies - } - return nil -} - -type DependencyServiceV2SyncRequest struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - - NodeKey string `protobuf:"bytes,1,opt,name=node_key,json=nodeKey,proto3" json:"node_key,omitempty"` - Lang string `protobuf:"bytes,2,opt,name=lang,proto3" json:"lang,omitempty"` - Dependencies []*Dependency `protobuf:"bytes,3,rep,name=dependencies,proto3" json:"dependencies,omitempty"` -} - -func (x *DependencyServiceV2SyncRequest) Reset() { - *x = DependencyServiceV2SyncRequest{} - if protoimpl.UnsafeEnabled { - mi := &file_services_dependency_service_v2_proto_msgTypes[3] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } -} - -func (x *DependencyServiceV2SyncRequest) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*DependencyServiceV2SyncRequest) ProtoMessage() {} - -func (x *DependencyServiceV2SyncRequest) ProtoReflect() protoreflect.Message { - mi := &file_services_dependency_service_v2_proto_msgTypes[3] - if protoimpl.UnsafeEnabled && x != nil { - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - if ms.LoadMessageInfo() == nil { - ms.StoreMessageInfo(mi) - } - return ms - } - return mi.MessageOf(x) -} - -// Deprecated: Use DependencyServiceV2SyncRequest.ProtoReflect.Descriptor instead. -func (*DependencyServiceV2SyncRequest) Descriptor() ([]byte, []int) { - return file_services_dependency_service_v2_proto_rawDescGZIP(), []int{3} -} - -func (x *DependencyServiceV2SyncRequest) GetNodeKey() string { - if x != nil { - return x.NodeKey - } - return "" -} - -func (x *DependencyServiceV2SyncRequest) GetLang() string { - if x != nil { - return x.Lang - } - return "" -} - -func (x *DependencyServiceV2SyncRequest) GetDependencies() []*Dependency { - if x != nil { - return x.Dependencies - } - return nil -} - -type DependencyServiceV2UpdateTaskLogRequest struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - - TaskId string `protobuf:"bytes,1,opt,name=task_id,json=taskId,proto3" json:"task_id,omitempty"` - LogLines []string `protobuf:"bytes,2,rep,name=log_lines,json=logLines,proto3" json:"log_lines,omitempty"` -} - -func (x *DependencyServiceV2UpdateTaskLogRequest) Reset() { - *x = DependencyServiceV2UpdateTaskLogRequest{} - if protoimpl.UnsafeEnabled { - mi := &file_services_dependency_service_v2_proto_msgTypes[4] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } -} - -func (x *DependencyServiceV2UpdateTaskLogRequest) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*DependencyServiceV2UpdateTaskLogRequest) ProtoMessage() {} - -func (x *DependencyServiceV2UpdateTaskLogRequest) ProtoReflect() protoreflect.Message { - mi := &file_services_dependency_service_v2_proto_msgTypes[4] - if protoimpl.UnsafeEnabled && x != nil { - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - if ms.LoadMessageInfo() == nil { - ms.StoreMessageInfo(mi) - } - return ms - } - return mi.MessageOf(x) -} - -// Deprecated: Use DependencyServiceV2UpdateTaskLogRequest.ProtoReflect.Descriptor instead. -func (*DependencyServiceV2UpdateTaskLogRequest) Descriptor() ([]byte, []int) { - return file_services_dependency_service_v2_proto_rawDescGZIP(), []int{4} -} - -func (x *DependencyServiceV2UpdateTaskLogRequest) GetTaskId() string { - if x != nil { - return x.TaskId - } - return "" -} - -func (x *DependencyServiceV2UpdateTaskLogRequest) GetLogLines() []string { - if x != nil { - return x.LogLines - } - return nil -} - -var File_services_dependency_service_v2_proto protoreflect.FileDescriptor - -var file_services_dependency_service_v2_proto_rawDesc = []byte{ - 0x0a, 0x24, 0x73, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x73, 0x2f, 0x64, 0x65, 0x70, 0x65, 0x6e, - 0x64, 0x65, 0x6e, 0x63, 0x79, 0x5f, 0x73, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x5f, 0x76, 0x32, - 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x12, 0x04, 0x67, 0x72, 0x70, 0x63, 0x1a, 0x15, 0x65, 0x6e, - 0x74, 0x69, 0x74, 0x79, 0x2f, 0x72, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x2e, 0x70, 0x72, - 0x6f, 0x74, 0x6f, 0x22, 0x3a, 0x0a, 0x0a, 0x44, 0x65, 0x70, 0x65, 0x6e, 0x64, 0x65, 0x6e, 0x63, - 0x79, 0x12, 0x12, 0x0a, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, - 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x12, 0x18, 0x0a, 0x07, 0x76, 0x65, 0x72, 0x73, 0x69, 0x6f, 0x6e, - 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x07, 0x76, 0x65, 0x72, 0x73, 0x69, 0x6f, 0x6e, 0x22, - 0x3e, 0x0a, 0x21, 0x44, 0x65, 0x70, 0x65, 0x6e, 0x64, 0x65, 0x6e, 0x63, 0x79, 0x53, 0x65, 0x72, - 0x76, 0x69, 0x63, 0x65, 0x56, 0x32, 0x43, 0x6f, 0x6e, 0x6e, 0x65, 0x63, 0x74, 0x52, 0x65, 0x71, - 0x75, 0x65, 0x73, 0x74, 0x12, 0x19, 0x0a, 0x08, 0x6e, 0x6f, 0x64, 0x65, 0x5f, 0x6b, 0x65, 0x79, - 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x07, 0x6e, 0x6f, 0x64, 0x65, 0x4b, 0x65, 0x79, 0x22, - 0xd0, 0x01, 0x0a, 0x22, 0x44, 0x65, 0x70, 0x65, 0x6e, 0x64, 0x65, 0x6e, 0x63, 0x79, 0x53, 0x65, - 0x72, 0x76, 0x69, 0x63, 0x65, 0x56, 0x32, 0x43, 0x6f, 0x6e, 0x6e, 0x65, 0x63, 0x74, 0x52, 0x65, - 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x31, 0x0a, 0x04, 0x63, 0x6f, 0x64, 0x65, 0x18, 0x01, - 0x20, 0x01, 0x28, 0x0e, 0x32, 0x1d, 0x2e, 0x67, 0x72, 0x70, 0x63, 0x2e, 0x44, 0x65, 0x70, 0x65, - 0x6e, 0x64, 0x65, 0x6e, 0x63, 0x79, 0x53, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x56, 0x32, 0x43, - 0x6f, 0x64, 0x65, 0x52, 0x04, 0x63, 0x6f, 0x64, 0x65, 0x12, 0x17, 0x0a, 0x07, 0x74, 0x61, 0x73, - 0x6b, 0x5f, 0x69, 0x64, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x06, 0x74, 0x61, 0x73, 0x6b, - 0x49, 0x64, 0x12, 0x12, 0x0a, 0x04, 0x6c, 0x61, 0x6e, 0x67, 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, - 0x52, 0x04, 0x6c, 0x61, 0x6e, 0x67, 0x12, 0x14, 0x0a, 0x05, 0x70, 0x72, 0x6f, 0x78, 0x79, 0x18, - 0x04, 0x20, 0x01, 0x28, 0x09, 0x52, 0x05, 0x70, 0x72, 0x6f, 0x78, 0x79, 0x12, 0x34, 0x0a, 0x0c, - 0x64, 0x65, 0x70, 0x65, 0x6e, 0x64, 0x65, 0x6e, 0x63, 0x69, 0x65, 0x73, 0x18, 0x05, 0x20, 0x03, - 0x28, 0x0b, 0x32, 0x10, 0x2e, 0x67, 0x72, 0x70, 0x63, 0x2e, 0x44, 0x65, 0x70, 0x65, 0x6e, 0x64, - 0x65, 0x6e, 0x63, 0x79, 0x52, 0x0c, 0x64, 0x65, 0x70, 0x65, 0x6e, 0x64, 0x65, 0x6e, 0x63, 0x69, - 0x65, 0x73, 0x22, 0x85, 0x01, 0x0a, 0x1e, 0x44, 0x65, 0x70, 0x65, 0x6e, 0x64, 0x65, 0x6e, 0x63, - 0x79, 0x53, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x56, 0x32, 0x53, 0x79, 0x6e, 0x63, 0x52, 0x65, - 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x19, 0x0a, 0x08, 0x6e, 0x6f, 0x64, 0x65, 0x5f, 0x6b, 0x65, - 0x79, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x07, 0x6e, 0x6f, 0x64, 0x65, 0x4b, 0x65, 0x79, - 0x12, 0x12, 0x0a, 0x04, 0x6c, 0x61, 0x6e, 0x67, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, - 0x6c, 0x61, 0x6e, 0x67, 0x12, 0x34, 0x0a, 0x0c, 0x64, 0x65, 0x70, 0x65, 0x6e, 0x64, 0x65, 0x6e, - 0x63, 0x69, 0x65, 0x73, 0x18, 0x03, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x10, 0x2e, 0x67, 0x72, 0x70, - 0x63, 0x2e, 0x44, 0x65, 0x70, 0x65, 0x6e, 0x64, 0x65, 0x6e, 0x63, 0x79, 0x52, 0x0c, 0x64, 0x65, - 0x70, 0x65, 0x6e, 0x64, 0x65, 0x6e, 0x63, 0x69, 0x65, 0x73, 0x22, 0x5f, 0x0a, 0x27, 0x44, 0x65, - 0x70, 0x65, 0x6e, 0x64, 0x65, 0x6e, 0x63, 0x79, 0x53, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x56, - 0x32, 0x55, 0x70, 0x64, 0x61, 0x74, 0x65, 0x54, 0x61, 0x73, 0x6b, 0x4c, 0x6f, 0x67, 0x52, 0x65, - 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x17, 0x0a, 0x07, 0x74, 0x61, 0x73, 0x6b, 0x5f, 0x69, 0x64, - 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x06, 0x74, 0x61, 0x73, 0x6b, 0x49, 0x64, 0x12, 0x1b, - 0x0a, 0x09, 0x6c, 0x6f, 0x67, 0x5f, 0x6c, 0x69, 0x6e, 0x65, 0x73, 0x18, 0x02, 0x20, 0x03, 0x28, - 0x09, 0x52, 0x08, 0x6c, 0x6f, 0x67, 0x4c, 0x69, 0x6e, 0x65, 0x73, 0x2a, 0x3f, 0x0a, 0x17, 0x44, - 0x65, 0x70, 0x65, 0x6e, 0x64, 0x65, 0x6e, 0x63, 0x79, 0x53, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, - 0x56, 0x32, 0x43, 0x6f, 0x64, 0x65, 0x12, 0x08, 0x0a, 0x04, 0x53, 0x59, 0x4e, 0x43, 0x10, 0x00, - 0x12, 0x0b, 0x0a, 0x07, 0x49, 0x4e, 0x53, 0x54, 0x41, 0x4c, 0x4c, 0x10, 0x01, 0x12, 0x0d, 0x0a, - 0x09, 0x55, 0x4e, 0x49, 0x4e, 0x53, 0x54, 0x41, 0x4c, 0x4c, 0x10, 0x02, 0x32, 0x8b, 0x02, 0x0a, - 0x13, 0x44, 0x65, 0x70, 0x65, 0x6e, 0x64, 0x65, 0x6e, 0x63, 0x79, 0x53, 0x65, 0x72, 0x76, 0x69, - 0x63, 0x65, 0x56, 0x32, 0x12, 0x60, 0x0a, 0x07, 0x43, 0x6f, 0x6e, 0x6e, 0x65, 0x63, 0x74, 0x12, - 0x27, 0x2e, 0x67, 0x72, 0x70, 0x63, 0x2e, 0x44, 0x65, 0x70, 0x65, 0x6e, 0x64, 0x65, 0x6e, 0x63, - 0x79, 0x53, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x56, 0x32, 0x43, 0x6f, 0x6e, 0x6e, 0x65, 0x63, - 0x74, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x28, 0x2e, 0x67, 0x72, 0x70, 0x63, 0x2e, - 0x44, 0x65, 0x70, 0x65, 0x6e, 0x64, 0x65, 0x6e, 0x63, 0x79, 0x53, 0x65, 0x72, 0x76, 0x69, 0x63, - 0x65, 0x56, 0x32, 0x43, 0x6f, 0x6e, 0x6e, 0x65, 0x63, 0x74, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, - 0x73, 0x65, 0x22, 0x00, 0x30, 0x01, 0x12, 0x3e, 0x0a, 0x04, 0x53, 0x79, 0x6e, 0x63, 0x12, 0x24, - 0x2e, 0x67, 0x72, 0x70, 0x63, 0x2e, 0x44, 0x65, 0x70, 0x65, 0x6e, 0x64, 0x65, 0x6e, 0x63, 0x79, - 0x53, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x56, 0x32, 0x53, 0x79, 0x6e, 0x63, 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, 0x52, 0x0a, 0x0d, 0x55, 0x70, 0x64, 0x61, 0x74, 0x65, - 0x54, 0x61, 0x73, 0x6b, 0x4c, 0x6f, 0x67, 0x12, 0x2d, 0x2e, 0x67, 0x72, 0x70, 0x63, 0x2e, 0x44, - 0x65, 0x70, 0x65, 0x6e, 0x64, 0x65, 0x6e, 0x63, 0x79, 0x53, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, - 0x56, 0x32, 0x55, 0x70, 0x64, 0x61, 0x74, 0x65, 0x54, 0x61, 0x73, 0x6b, 0x4c, 0x6f, 0x67, 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, 0x28, 0x01, 0x42, 0x08, 0x5a, 0x06, 0x2e, 0x3b, - 0x67, 0x72, 0x70, 0x63, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, -} - -var ( - file_services_dependency_service_v2_proto_rawDescOnce sync.Once - file_services_dependency_service_v2_proto_rawDescData = file_services_dependency_service_v2_proto_rawDesc -) - -func file_services_dependency_service_v2_proto_rawDescGZIP() []byte { - file_services_dependency_service_v2_proto_rawDescOnce.Do(func() { - file_services_dependency_service_v2_proto_rawDescData = protoimpl.X.CompressGZIP(file_services_dependency_service_v2_proto_rawDescData) - }) - return file_services_dependency_service_v2_proto_rawDescData -} - -var file_services_dependency_service_v2_proto_enumTypes = make([]protoimpl.EnumInfo, 1) -var file_services_dependency_service_v2_proto_msgTypes = make([]protoimpl.MessageInfo, 5) -var file_services_dependency_service_v2_proto_goTypes = []any{ - (DependencyServiceV2Code)(0), // 0: grpc.DependencyServiceV2Code - (*Dependency)(nil), // 1: grpc.Dependency - (*DependencyServiceV2ConnectRequest)(nil), // 2: grpc.DependencyServiceV2ConnectRequest - (*DependencyServiceV2ConnectResponse)(nil), // 3: grpc.DependencyServiceV2ConnectResponse - (*DependencyServiceV2SyncRequest)(nil), // 4: grpc.DependencyServiceV2SyncRequest - (*DependencyServiceV2UpdateTaskLogRequest)(nil), // 5: grpc.DependencyServiceV2UpdateTaskLogRequest - (*Response)(nil), // 6: grpc.Response -} -var file_services_dependency_service_v2_proto_depIdxs = []int32{ - 0, // 0: grpc.DependencyServiceV2ConnectResponse.code:type_name -> grpc.DependencyServiceV2Code - 1, // 1: grpc.DependencyServiceV2ConnectResponse.dependencies:type_name -> grpc.Dependency - 1, // 2: grpc.DependencyServiceV2SyncRequest.dependencies:type_name -> grpc.Dependency - 2, // 3: grpc.DependencyServiceV2.Connect:input_type -> grpc.DependencyServiceV2ConnectRequest - 4, // 4: grpc.DependencyServiceV2.Sync:input_type -> grpc.DependencyServiceV2SyncRequest - 5, // 5: grpc.DependencyServiceV2.UpdateTaskLog:input_type -> grpc.DependencyServiceV2UpdateTaskLogRequest - 3, // 6: grpc.DependencyServiceV2.Connect:output_type -> grpc.DependencyServiceV2ConnectResponse - 6, // 7: grpc.DependencyServiceV2.Sync:output_type -> grpc.Response - 6, // 8: grpc.DependencyServiceV2.UpdateTaskLog:output_type -> grpc.Response - 6, // [6:9] is the sub-list for method output_type - 3, // [3:6] is the sub-list for method input_type - 3, // [3:3] is the sub-list for extension type_name - 3, // [3:3] is the sub-list for extension extendee - 0, // [0:3] is the sub-list for field type_name -} - -func init() { file_services_dependency_service_v2_proto_init() } -func file_services_dependency_service_v2_proto_init() { - if File_services_dependency_service_v2_proto != nil { - return - } - file_entity_response_proto_init() - if !protoimpl.UnsafeEnabled { - file_services_dependency_service_v2_proto_msgTypes[0].Exporter = func(v any, i int) any { - switch v := v.(*Dependency); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_services_dependency_service_v2_proto_msgTypes[1].Exporter = func(v any, i int) any { - switch v := v.(*DependencyServiceV2ConnectRequest); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_services_dependency_service_v2_proto_msgTypes[2].Exporter = func(v any, i int) any { - switch v := v.(*DependencyServiceV2ConnectResponse); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_services_dependency_service_v2_proto_msgTypes[3].Exporter = func(v any, i int) any { - switch v := v.(*DependencyServiceV2SyncRequest); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_services_dependency_service_v2_proto_msgTypes[4].Exporter = func(v any, i int) any { - switch v := v.(*DependencyServiceV2UpdateTaskLogRequest); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - } - type x struct{} - out := protoimpl.TypeBuilder{ - File: protoimpl.DescBuilder{ - GoPackagePath: reflect.TypeOf(x{}).PkgPath(), - RawDescriptor: file_services_dependency_service_v2_proto_rawDesc, - NumEnums: 1, - NumMessages: 5, - NumExtensions: 0, - NumServices: 1, - }, - GoTypes: file_services_dependency_service_v2_proto_goTypes, - DependencyIndexes: file_services_dependency_service_v2_proto_depIdxs, - EnumInfos: file_services_dependency_service_v2_proto_enumTypes, - MessageInfos: file_services_dependency_service_v2_proto_msgTypes, - }.Build() - File_services_dependency_service_v2_proto = out.File - file_services_dependency_service_v2_proto_rawDesc = nil - file_services_dependency_service_v2_proto_goTypes = nil - file_services_dependency_service_v2_proto_depIdxs = nil -} diff --git a/grpc/dependency_service_v2_grpc.pb.go b/grpc/dependency_service_v2_grpc.pb.go deleted file mode 100644 index b9ce366c..00000000 --- a/grpc/dependency_service_v2_grpc.pb.go +++ /dev/null @@ -1,248 +0,0 @@ -// Code generated by protoc-gen-go-grpc. DO NOT EDIT. -// versions: -// - protoc-gen-go-grpc v1.4.0 -// - protoc v5.27.2 -// source: services/dependency_service_v2.proto - -package grpc - -import ( - context "context" - grpc "google.golang.org/grpc" - codes "google.golang.org/grpc/codes" - status "google.golang.org/grpc/status" -) - -// This is a compile-time assertion to ensure that this generated file -// is compatible with the grpc package it is being compiled against. -// Requires gRPC-Go v1.62.0 or later. -const _ = grpc.SupportPackageIsVersion8 - -const ( - DependencyServiceV2_Connect_FullMethodName = "/grpc.DependencyServiceV2/Connect" - DependencyServiceV2_Sync_FullMethodName = "/grpc.DependencyServiceV2/Sync" - DependencyServiceV2_UpdateTaskLog_FullMethodName = "/grpc.DependencyServiceV2/UpdateTaskLog" -) - -// DependencyServiceV2Client is the client API for DependencyServiceV2 service. -// -// For semantics around ctx use and closing/ending streaming RPCs, please refer to https://pkg.go.dev/google.golang.org/grpc/?tab=doc#ClientConn.NewStream. -type DependencyServiceV2Client interface { - Connect(ctx context.Context, in *DependencyServiceV2ConnectRequest, opts ...grpc.CallOption) (DependencyServiceV2_ConnectClient, error) - Sync(ctx context.Context, in *DependencyServiceV2SyncRequest, opts ...grpc.CallOption) (*Response, error) - UpdateTaskLog(ctx context.Context, opts ...grpc.CallOption) (DependencyServiceV2_UpdateTaskLogClient, error) -} - -type dependencyServiceV2Client struct { - cc grpc.ClientConnInterface -} - -func NewDependencyServiceV2Client(cc grpc.ClientConnInterface) DependencyServiceV2Client { - return &dependencyServiceV2Client{cc} -} - -func (c *dependencyServiceV2Client) Connect(ctx context.Context, in *DependencyServiceV2ConnectRequest, opts ...grpc.CallOption) (DependencyServiceV2_ConnectClient, error) { - cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...) - stream, err := c.cc.NewStream(ctx, &DependencyServiceV2_ServiceDesc.Streams[0], DependencyServiceV2_Connect_FullMethodName, cOpts...) - if err != nil { - return nil, err - } - x := &dependencyServiceV2ConnectClient{ClientStream: stream} - if err := x.ClientStream.SendMsg(in); err != nil { - return nil, err - } - if err := x.ClientStream.CloseSend(); err != nil { - return nil, err - } - return x, nil -} - -type DependencyServiceV2_ConnectClient interface { - Recv() (*DependencyServiceV2ConnectResponse, error) - grpc.ClientStream -} - -type dependencyServiceV2ConnectClient struct { - grpc.ClientStream -} - -func (x *dependencyServiceV2ConnectClient) Recv() (*DependencyServiceV2ConnectResponse, error) { - m := new(DependencyServiceV2ConnectResponse) - if err := x.ClientStream.RecvMsg(m); err != nil { - return nil, err - } - return m, nil -} - -func (c *dependencyServiceV2Client) Sync(ctx context.Context, in *DependencyServiceV2SyncRequest, opts ...grpc.CallOption) (*Response, error) { - cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...) - out := new(Response) - err := c.cc.Invoke(ctx, DependencyServiceV2_Sync_FullMethodName, in, out, cOpts...) - if err != nil { - return nil, err - } - return out, nil -} - -func (c *dependencyServiceV2Client) UpdateTaskLog(ctx context.Context, opts ...grpc.CallOption) (DependencyServiceV2_UpdateTaskLogClient, error) { - cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...) - stream, err := c.cc.NewStream(ctx, &DependencyServiceV2_ServiceDesc.Streams[1], DependencyServiceV2_UpdateTaskLog_FullMethodName, cOpts...) - if err != nil { - return nil, err - } - x := &dependencyServiceV2UpdateTaskLogClient{ClientStream: stream} - return x, nil -} - -type DependencyServiceV2_UpdateTaskLogClient interface { - Send(*DependencyServiceV2UpdateTaskLogRequest) error - CloseAndRecv() (*Response, error) - grpc.ClientStream -} - -type dependencyServiceV2UpdateTaskLogClient struct { - grpc.ClientStream -} - -func (x *dependencyServiceV2UpdateTaskLogClient) Send(m *DependencyServiceV2UpdateTaskLogRequest) error { - return x.ClientStream.SendMsg(m) -} - -func (x *dependencyServiceV2UpdateTaskLogClient) CloseAndRecv() (*Response, error) { - if err := x.ClientStream.CloseSend(); err != nil { - return nil, err - } - m := new(Response) - if err := x.ClientStream.RecvMsg(m); err != nil { - return nil, err - } - return m, nil -} - -// DependencyServiceV2Server is the server API for DependencyServiceV2 service. -// All implementations must embed UnimplementedDependencyServiceV2Server -// for forward compatibility -type DependencyServiceV2Server interface { - Connect(*DependencyServiceV2ConnectRequest, DependencyServiceV2_ConnectServer) error - Sync(context.Context, *DependencyServiceV2SyncRequest) (*Response, error) - UpdateTaskLog(DependencyServiceV2_UpdateTaskLogServer) error - mustEmbedUnimplementedDependencyServiceV2Server() -} - -// UnimplementedDependencyServiceV2Server must be embedded to have forward compatible implementations. -type UnimplementedDependencyServiceV2Server struct { -} - -func (UnimplementedDependencyServiceV2Server) Connect(*DependencyServiceV2ConnectRequest, DependencyServiceV2_ConnectServer) error { - return status.Errorf(codes.Unimplemented, "method Connect not implemented") -} -func (UnimplementedDependencyServiceV2Server) Sync(context.Context, *DependencyServiceV2SyncRequest) (*Response, error) { - return nil, status.Errorf(codes.Unimplemented, "method Sync not implemented") -} -func (UnimplementedDependencyServiceV2Server) UpdateTaskLog(DependencyServiceV2_UpdateTaskLogServer) error { - return status.Errorf(codes.Unimplemented, "method UpdateTaskLog not implemented") -} -func (UnimplementedDependencyServiceV2Server) mustEmbedUnimplementedDependencyServiceV2Server() {} - -// UnsafeDependencyServiceV2Server may be embedded to opt out of forward compatibility for this service. -// Use of this interface is not recommended, as added methods to DependencyServiceV2Server will -// result in compilation errors. -type UnsafeDependencyServiceV2Server interface { - mustEmbedUnimplementedDependencyServiceV2Server() -} - -func RegisterDependencyServiceV2Server(s grpc.ServiceRegistrar, srv DependencyServiceV2Server) { - s.RegisterService(&DependencyServiceV2_ServiceDesc, srv) -} - -func _DependencyServiceV2_Connect_Handler(srv interface{}, stream grpc.ServerStream) error { - m := new(DependencyServiceV2ConnectRequest) - if err := stream.RecvMsg(m); err != nil { - return err - } - return srv.(DependencyServiceV2Server).Connect(m, &dependencyServiceV2ConnectServer{ServerStream: stream}) -} - -type DependencyServiceV2_ConnectServer interface { - Send(*DependencyServiceV2ConnectResponse) error - grpc.ServerStream -} - -type dependencyServiceV2ConnectServer struct { - grpc.ServerStream -} - -func (x *dependencyServiceV2ConnectServer) Send(m *DependencyServiceV2ConnectResponse) error { - return x.ServerStream.SendMsg(m) -} - -func _DependencyServiceV2_Sync_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { - in := new(DependencyServiceV2SyncRequest) - if err := dec(in); err != nil { - return nil, err - } - if interceptor == nil { - return srv.(DependencyServiceV2Server).Sync(ctx, in) - } - info := &grpc.UnaryServerInfo{ - Server: srv, - FullMethod: DependencyServiceV2_Sync_FullMethodName, - } - handler := func(ctx context.Context, req interface{}) (interface{}, error) { - return srv.(DependencyServiceV2Server).Sync(ctx, req.(*DependencyServiceV2SyncRequest)) - } - return interceptor(ctx, in, info, handler) -} - -func _DependencyServiceV2_UpdateTaskLog_Handler(srv interface{}, stream grpc.ServerStream) error { - return srv.(DependencyServiceV2Server).UpdateTaskLog(&dependencyServiceV2UpdateTaskLogServer{ServerStream: stream}) -} - -type DependencyServiceV2_UpdateTaskLogServer interface { - SendAndClose(*Response) error - Recv() (*DependencyServiceV2UpdateTaskLogRequest, error) - grpc.ServerStream -} - -type dependencyServiceV2UpdateTaskLogServer struct { - grpc.ServerStream -} - -func (x *dependencyServiceV2UpdateTaskLogServer) SendAndClose(m *Response) error { - return x.ServerStream.SendMsg(m) -} - -func (x *dependencyServiceV2UpdateTaskLogServer) Recv() (*DependencyServiceV2UpdateTaskLogRequest, error) { - m := new(DependencyServiceV2UpdateTaskLogRequest) - if err := x.ServerStream.RecvMsg(m); err != nil { - return nil, err - } - return m, nil -} - -// DependencyServiceV2_ServiceDesc is the grpc.ServiceDesc for DependencyServiceV2 service. -// It's only intended for direct use with grpc.RegisterService, -// and not to be introspected or modified (even as a copy) -var DependencyServiceV2_ServiceDesc = grpc.ServiceDesc{ - ServiceName: "grpc.DependencyServiceV2", - HandlerType: (*DependencyServiceV2Server)(nil), - Methods: []grpc.MethodDesc{ - { - MethodName: "Sync", - Handler: _DependencyServiceV2_Sync_Handler, - }, - }, - Streams: []grpc.StreamDesc{ - { - StreamName: "Connect", - Handler: _DependencyServiceV2_Connect_Handler, - ServerStreams: true, - }, - { - StreamName: "UpdateTaskLog", - Handler: _DependencyServiceV2_UpdateTaskLog_Handler, - ClientStreams: true, - }, - }, - Metadata: "services/dependency_service_v2.proto", -} diff --git a/grpc/metric_service.pb.go b/grpc/metric_service.pb.go new file mode 100644 index 00000000..63375fea --- /dev/null +++ b/grpc/metric_service.pb.go @@ -0,0 +1,311 @@ +// Code generated by protoc-gen-go. DO NOT EDIT. +// versions: +// protoc-gen-go v1.34.2 +// protoc v5.27.2 +// source: services/metric_service.proto + +package grpc + +import ( + protoreflect "google.golang.org/protobuf/reflect/protoreflect" + protoimpl "google.golang.org/protobuf/runtime/protoimpl" + reflect "reflect" + sync "sync" +) + +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) +) + +type MetricServiceSendRequest struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + Type string `protobuf:"bytes,1,opt,name=type,proto3" json:"type,omitempty"` + NodeKey string `protobuf:"bytes,2,opt,name=node_key,json=nodeKey,proto3" json:"node_key,omitempty"` + Timestamp int64 `protobuf:"varint,3,opt,name=timestamp,proto3" json:"timestamp,omitempty"` + CpuUsagePercent float32 `protobuf:"fixed32,4,opt,name=cpu_usage_percent,json=cpuUsagePercent,proto3" json:"cpu_usage_percent,omitempty"` + TotalMemory uint64 `protobuf:"varint,5,opt,name=total_memory,json=totalMemory,proto3" json:"total_memory,omitempty"` + AvailableMemory uint64 `protobuf:"varint,6,opt,name=available_memory,json=availableMemory,proto3" json:"available_memory,omitempty"` + UsedMemory uint64 `protobuf:"varint,7,opt,name=used_memory,json=usedMemory,proto3" json:"used_memory,omitempty"` + UsedMemoryPercent float32 `protobuf:"fixed32,8,opt,name=used_memory_percent,json=usedMemoryPercent,proto3" json:"used_memory_percent,omitempty"` + TotalDisk uint64 `protobuf:"varint,9,opt,name=total_disk,json=totalDisk,proto3" json:"total_disk,omitempty"` + AvailableDisk uint64 `protobuf:"varint,10,opt,name=available_disk,json=availableDisk,proto3" json:"available_disk,omitempty"` + UsedDisk uint64 `protobuf:"varint,11,opt,name=used_disk,json=usedDisk,proto3" json:"used_disk,omitempty"` + UsedDiskPercent float32 `protobuf:"fixed32,12,opt,name=used_disk_percent,json=usedDiskPercent,proto3" json:"used_disk_percent,omitempty"` + DiskReadBytesRate float32 `protobuf:"fixed32,15,opt,name=disk_read_bytes_rate,json=diskReadBytesRate,proto3" json:"disk_read_bytes_rate,omitempty"` + DiskWriteBytesRate float32 `protobuf:"fixed32,16,opt,name=disk_write_bytes_rate,json=diskWriteBytesRate,proto3" json:"disk_write_bytes_rate,omitempty"` + NetworkBytesSentRate float32 `protobuf:"fixed32,17,opt,name=network_bytes_sent_rate,json=networkBytesSentRate,proto3" json:"network_bytes_sent_rate,omitempty"` + NetworkBytesRecvRate float32 `protobuf:"fixed32,18,opt,name=network_bytes_recv_rate,json=networkBytesRecvRate,proto3" json:"network_bytes_recv_rate,omitempty"` +} + +func (x *MetricServiceSendRequest) Reset() { + *x = MetricServiceSendRequest{} + if protoimpl.UnsafeEnabled { + mi := &file_services_metric_service_proto_msgTypes[0] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *MetricServiceSendRequest) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*MetricServiceSendRequest) ProtoMessage() {} + +func (x *MetricServiceSendRequest) ProtoReflect() protoreflect.Message { + mi := &file_services_metric_service_proto_msgTypes[0] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use MetricServiceSendRequest.ProtoReflect.Descriptor instead. +func (*MetricServiceSendRequest) Descriptor() ([]byte, []int) { + return file_services_metric_service_proto_rawDescGZIP(), []int{0} +} + +func (x *MetricServiceSendRequest) GetType() string { + if x != nil { + return x.Type + } + return "" +} + +func (x *MetricServiceSendRequest) GetNodeKey() string { + if x != nil { + return x.NodeKey + } + return "" +} + +func (x *MetricServiceSendRequest) GetTimestamp() int64 { + if x != nil { + return x.Timestamp + } + return 0 +} + +func (x *MetricServiceSendRequest) GetCpuUsagePercent() float32 { + if x != nil { + return x.CpuUsagePercent + } + return 0 +} + +func (x *MetricServiceSendRequest) GetTotalMemory() uint64 { + if x != nil { + return x.TotalMemory + } + return 0 +} + +func (x *MetricServiceSendRequest) GetAvailableMemory() uint64 { + if x != nil { + return x.AvailableMemory + } + return 0 +} + +func (x *MetricServiceSendRequest) GetUsedMemory() uint64 { + if x != nil { + return x.UsedMemory + } + return 0 +} + +func (x *MetricServiceSendRequest) GetUsedMemoryPercent() float32 { + if x != nil { + return x.UsedMemoryPercent + } + return 0 +} + +func (x *MetricServiceSendRequest) GetTotalDisk() uint64 { + if x != nil { + return x.TotalDisk + } + return 0 +} + +func (x *MetricServiceSendRequest) GetAvailableDisk() uint64 { + if x != nil { + return x.AvailableDisk + } + return 0 +} + +func (x *MetricServiceSendRequest) GetUsedDisk() uint64 { + if x != nil { + return x.UsedDisk + } + return 0 +} + +func (x *MetricServiceSendRequest) GetUsedDiskPercent() float32 { + if x != nil { + return x.UsedDiskPercent + } + return 0 +} + +func (x *MetricServiceSendRequest) GetDiskReadBytesRate() float32 { + if x != nil { + return x.DiskReadBytesRate + } + return 0 +} + +func (x *MetricServiceSendRequest) GetDiskWriteBytesRate() float32 { + if x != nil { + return x.DiskWriteBytesRate + } + return 0 +} + +func (x *MetricServiceSendRequest) GetNetworkBytesSentRate() float32 { + if x != nil { + return x.NetworkBytesSentRate + } + return 0 +} + +func (x *MetricServiceSendRequest) GetNetworkBytesRecvRate() float32 { + if x != nil { + return x.NetworkBytesRecvRate + } + return 0 +} + +var File_services_metric_service_proto protoreflect.FileDescriptor + +var file_services_metric_service_proto_rawDesc = []byte{ + 0x0a, 0x1d, 0x73, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x73, 0x2f, 0x6d, 0x65, 0x74, 0x72, 0x69, + 0x63, 0x5f, 0x73, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x12, + 0x04, 0x67, 0x72, 0x70, 0x63, 0x1a, 0x15, 0x65, 0x6e, 0x74, 0x69, 0x74, 0x79, 0x2f, 0x72, 0x65, + 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x22, 0x93, 0x05, 0x0a, + 0x18, 0x4d, 0x65, 0x74, 0x72, 0x69, 0x63, 0x53, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x53, 0x65, + 0x6e, 0x64, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x12, 0x0a, 0x04, 0x74, 0x79, 0x70, + 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, 0x74, 0x79, 0x70, 0x65, 0x12, 0x19, 0x0a, + 0x08, 0x6e, 0x6f, 0x64, 0x65, 0x5f, 0x6b, 0x65, 0x79, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, + 0x07, 0x6e, 0x6f, 0x64, 0x65, 0x4b, 0x65, 0x79, 0x12, 0x1c, 0x0a, 0x09, 0x74, 0x69, 0x6d, 0x65, + 0x73, 0x74, 0x61, 0x6d, 0x70, 0x18, 0x03, 0x20, 0x01, 0x28, 0x03, 0x52, 0x09, 0x74, 0x69, 0x6d, + 0x65, 0x73, 0x74, 0x61, 0x6d, 0x70, 0x12, 0x2a, 0x0a, 0x11, 0x63, 0x70, 0x75, 0x5f, 0x75, 0x73, + 0x61, 0x67, 0x65, 0x5f, 0x70, 0x65, 0x72, 0x63, 0x65, 0x6e, 0x74, 0x18, 0x04, 0x20, 0x01, 0x28, + 0x02, 0x52, 0x0f, 0x63, 0x70, 0x75, 0x55, 0x73, 0x61, 0x67, 0x65, 0x50, 0x65, 0x72, 0x63, 0x65, + 0x6e, 0x74, 0x12, 0x21, 0x0a, 0x0c, 0x74, 0x6f, 0x74, 0x61, 0x6c, 0x5f, 0x6d, 0x65, 0x6d, 0x6f, + 0x72, 0x79, 0x18, 0x05, 0x20, 0x01, 0x28, 0x04, 0x52, 0x0b, 0x74, 0x6f, 0x74, 0x61, 0x6c, 0x4d, + 0x65, 0x6d, 0x6f, 0x72, 0x79, 0x12, 0x29, 0x0a, 0x10, 0x61, 0x76, 0x61, 0x69, 0x6c, 0x61, 0x62, + 0x6c, 0x65, 0x5f, 0x6d, 0x65, 0x6d, 0x6f, 0x72, 0x79, 0x18, 0x06, 0x20, 0x01, 0x28, 0x04, 0x52, + 0x0f, 0x61, 0x76, 0x61, 0x69, 0x6c, 0x61, 0x62, 0x6c, 0x65, 0x4d, 0x65, 0x6d, 0x6f, 0x72, 0x79, + 0x12, 0x1f, 0x0a, 0x0b, 0x75, 0x73, 0x65, 0x64, 0x5f, 0x6d, 0x65, 0x6d, 0x6f, 0x72, 0x79, 0x18, + 0x07, 0x20, 0x01, 0x28, 0x04, 0x52, 0x0a, 0x75, 0x73, 0x65, 0x64, 0x4d, 0x65, 0x6d, 0x6f, 0x72, + 0x79, 0x12, 0x2e, 0x0a, 0x13, 0x75, 0x73, 0x65, 0x64, 0x5f, 0x6d, 0x65, 0x6d, 0x6f, 0x72, 0x79, + 0x5f, 0x70, 0x65, 0x72, 0x63, 0x65, 0x6e, 0x74, 0x18, 0x08, 0x20, 0x01, 0x28, 0x02, 0x52, 0x11, + 0x75, 0x73, 0x65, 0x64, 0x4d, 0x65, 0x6d, 0x6f, 0x72, 0x79, 0x50, 0x65, 0x72, 0x63, 0x65, 0x6e, + 0x74, 0x12, 0x1d, 0x0a, 0x0a, 0x74, 0x6f, 0x74, 0x61, 0x6c, 0x5f, 0x64, 0x69, 0x73, 0x6b, 0x18, + 0x09, 0x20, 0x01, 0x28, 0x04, 0x52, 0x09, 0x74, 0x6f, 0x74, 0x61, 0x6c, 0x44, 0x69, 0x73, 0x6b, + 0x12, 0x25, 0x0a, 0x0e, 0x61, 0x76, 0x61, 0x69, 0x6c, 0x61, 0x62, 0x6c, 0x65, 0x5f, 0x64, 0x69, + 0x73, 0x6b, 0x18, 0x0a, 0x20, 0x01, 0x28, 0x04, 0x52, 0x0d, 0x61, 0x76, 0x61, 0x69, 0x6c, 0x61, + 0x62, 0x6c, 0x65, 0x44, 0x69, 0x73, 0x6b, 0x12, 0x1b, 0x0a, 0x09, 0x75, 0x73, 0x65, 0x64, 0x5f, + 0x64, 0x69, 0x73, 0x6b, 0x18, 0x0b, 0x20, 0x01, 0x28, 0x04, 0x52, 0x08, 0x75, 0x73, 0x65, 0x64, + 0x44, 0x69, 0x73, 0x6b, 0x12, 0x2a, 0x0a, 0x11, 0x75, 0x73, 0x65, 0x64, 0x5f, 0x64, 0x69, 0x73, + 0x6b, 0x5f, 0x70, 0x65, 0x72, 0x63, 0x65, 0x6e, 0x74, 0x18, 0x0c, 0x20, 0x01, 0x28, 0x02, 0x52, + 0x0f, 0x75, 0x73, 0x65, 0x64, 0x44, 0x69, 0x73, 0x6b, 0x50, 0x65, 0x72, 0x63, 0x65, 0x6e, 0x74, + 0x12, 0x2f, 0x0a, 0x14, 0x64, 0x69, 0x73, 0x6b, 0x5f, 0x72, 0x65, 0x61, 0x64, 0x5f, 0x62, 0x79, + 0x74, 0x65, 0x73, 0x5f, 0x72, 0x61, 0x74, 0x65, 0x18, 0x0f, 0x20, 0x01, 0x28, 0x02, 0x52, 0x11, + 0x64, 0x69, 0x73, 0x6b, 0x52, 0x65, 0x61, 0x64, 0x42, 0x79, 0x74, 0x65, 0x73, 0x52, 0x61, 0x74, + 0x65, 0x12, 0x31, 0x0a, 0x15, 0x64, 0x69, 0x73, 0x6b, 0x5f, 0x77, 0x72, 0x69, 0x74, 0x65, 0x5f, + 0x62, 0x79, 0x74, 0x65, 0x73, 0x5f, 0x72, 0x61, 0x74, 0x65, 0x18, 0x10, 0x20, 0x01, 0x28, 0x02, + 0x52, 0x12, 0x64, 0x69, 0x73, 0x6b, 0x57, 0x72, 0x69, 0x74, 0x65, 0x42, 0x79, 0x74, 0x65, 0x73, + 0x52, 0x61, 0x74, 0x65, 0x12, 0x35, 0x0a, 0x17, 0x6e, 0x65, 0x74, 0x77, 0x6f, 0x72, 0x6b, 0x5f, + 0x62, 0x79, 0x74, 0x65, 0x73, 0x5f, 0x73, 0x65, 0x6e, 0x74, 0x5f, 0x72, 0x61, 0x74, 0x65, 0x18, + 0x11, 0x20, 0x01, 0x28, 0x02, 0x52, 0x14, 0x6e, 0x65, 0x74, 0x77, 0x6f, 0x72, 0x6b, 0x42, 0x79, + 0x74, 0x65, 0x73, 0x53, 0x65, 0x6e, 0x74, 0x52, 0x61, 0x74, 0x65, 0x12, 0x35, 0x0a, 0x17, 0x6e, + 0x65, 0x74, 0x77, 0x6f, 0x72, 0x6b, 0x5f, 0x62, 0x79, 0x74, 0x65, 0x73, 0x5f, 0x72, 0x65, 0x63, + 0x76, 0x5f, 0x72, 0x61, 0x74, 0x65, 0x18, 0x12, 0x20, 0x01, 0x28, 0x02, 0x52, 0x14, 0x6e, 0x65, + 0x74, 0x77, 0x6f, 0x72, 0x6b, 0x42, 0x79, 0x74, 0x65, 0x73, 0x52, 0x65, 0x63, 0x76, 0x52, 0x61, + 0x74, 0x65, 0x32, 0x49, 0x0a, 0x0d, 0x4d, 0x65, 0x74, 0x72, 0x69, 0x63, 0x53, 0x65, 0x72, 0x76, + 0x69, 0x63, 0x65, 0x12, 0x38, 0x0a, 0x04, 0x53, 0x65, 0x6e, 0x64, 0x12, 0x1e, 0x2e, 0x67, 0x72, + 0x70, 0x63, 0x2e, 0x4d, 0x65, 0x74, 0x72, 0x69, 0x63, 0x53, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, + 0x53, 0x65, 0x6e, 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, 0x42, 0x08, 0x5a, + 0x06, 0x2e, 0x3b, 0x67, 0x72, 0x70, 0x63, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, +} + +var ( + file_services_metric_service_proto_rawDescOnce sync.Once + file_services_metric_service_proto_rawDescData = file_services_metric_service_proto_rawDesc +) + +func file_services_metric_service_proto_rawDescGZIP() []byte { + file_services_metric_service_proto_rawDescOnce.Do(func() { + file_services_metric_service_proto_rawDescData = protoimpl.X.CompressGZIP(file_services_metric_service_proto_rawDescData) + }) + return file_services_metric_service_proto_rawDescData +} + +var file_services_metric_service_proto_msgTypes = make([]protoimpl.MessageInfo, 1) +var file_services_metric_service_proto_goTypes = []any{ + (*MetricServiceSendRequest)(nil), // 0: grpc.MetricServiceSendRequest + (*Response)(nil), // 1: grpc.Response +} +var file_services_metric_service_proto_depIdxs = []int32{ + 0, // 0: grpc.MetricService.Send:input_type -> grpc.MetricServiceSendRequest + 1, // 1: grpc.MetricService.Send:output_type -> grpc.Response + 1, // [1:2] is the sub-list for method output_type + 0, // [0:1] 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_metric_service_proto_init() } +func file_services_metric_service_proto_init() { + if File_services_metric_service_proto != nil { + return + } + file_entity_response_proto_init() + if !protoimpl.UnsafeEnabled { + file_services_metric_service_proto_msgTypes[0].Exporter = func(v any, i int) any { + switch v := v.(*MetricServiceSendRequest); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + } + type x struct{} + out := protoimpl.TypeBuilder{ + File: protoimpl.DescBuilder{ + GoPackagePath: reflect.TypeOf(x{}).PkgPath(), + RawDescriptor: file_services_metric_service_proto_rawDesc, + NumEnums: 0, + NumMessages: 1, + NumExtensions: 0, + NumServices: 1, + }, + GoTypes: file_services_metric_service_proto_goTypes, + DependencyIndexes: file_services_metric_service_proto_depIdxs, + MessageInfos: file_services_metric_service_proto_msgTypes, + }.Build() + File_services_metric_service_proto = out.File + file_services_metric_service_proto_rawDesc = nil + file_services_metric_service_proto_goTypes = nil + file_services_metric_service_proto_depIdxs = nil +} diff --git a/grpc/metric_service_grpc.pb.go b/grpc/metric_service_grpc.pb.go new file mode 100644 index 00000000..43f4f71c --- /dev/null +++ b/grpc/metric_service_grpc.pb.go @@ -0,0 +1,110 @@ +// Code generated by protoc-gen-go-grpc. DO NOT EDIT. +// versions: +// - protoc-gen-go-grpc v1.4.0 +// - protoc v5.27.2 +// source: services/metric_service.proto + +package grpc + +import ( + context "context" + grpc "google.golang.org/grpc" + codes "google.golang.org/grpc/codes" + status "google.golang.org/grpc/status" +) + +// This is a compile-time assertion to ensure that this generated file +// is compatible with the grpc package it is being compiled against. +// Requires gRPC-Go v1.62.0 or later. +const _ = grpc.SupportPackageIsVersion8 + +const ( + MetricService_Send_FullMethodName = "/grpc.MetricService/Send" +) + +// MetricServiceClient is the client API for MetricService service. +// +// For semantics around ctx use and closing/ending streaming RPCs, please refer to https://pkg.go.dev/google.golang.org/grpc/?tab=doc#ClientConn.NewStream. +type MetricServiceClient interface { + Send(ctx context.Context, in *MetricServiceSendRequest, opts ...grpc.CallOption) (*Response, error) +} + +type metricServiceClient struct { + cc grpc.ClientConnInterface +} + +func NewMetricServiceClient(cc grpc.ClientConnInterface) MetricServiceClient { + return &metricServiceClient{cc} +} + +func (c *metricServiceClient) Send(ctx context.Context, in *MetricServiceSendRequest, opts ...grpc.CallOption) (*Response, error) { + cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...) + out := new(Response) + err := c.cc.Invoke(ctx, MetricService_Send_FullMethodName, in, out, cOpts...) + if err != nil { + return nil, err + } + return out, nil +} + +// MetricServiceServer is the server API for MetricService service. +// All implementations must embed UnimplementedMetricServiceServer +// for forward compatibility +type MetricServiceServer interface { + Send(context.Context, *MetricServiceSendRequest) (*Response, error) + mustEmbedUnimplementedMetricServiceServer() +} + +// UnimplementedMetricServiceServer must be embedded to have forward compatible implementations. +type UnimplementedMetricServiceServer struct { +} + +func (UnimplementedMetricServiceServer) Send(context.Context, *MetricServiceSendRequest) (*Response, error) { + return nil, status.Errorf(codes.Unimplemented, "method Send not implemented") +} +func (UnimplementedMetricServiceServer) mustEmbedUnimplementedMetricServiceServer() {} + +// UnsafeMetricServiceServer may be embedded to opt out of forward compatibility for this service. +// Use of this interface is not recommended, as added methods to MetricServiceServer will +// result in compilation errors. +type UnsafeMetricServiceServer interface { + mustEmbedUnimplementedMetricServiceServer() +} + +func RegisterMetricServiceServer(s grpc.ServiceRegistrar, srv MetricServiceServer) { + s.RegisterService(&MetricService_ServiceDesc, srv) +} + +func _MetricService_Send_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(MetricServiceSendRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(MetricServiceServer).Send(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: MetricService_Send_FullMethodName, + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(MetricServiceServer).Send(ctx, req.(*MetricServiceSendRequest)) + } + return interceptor(ctx, in, info, handler) +} + +// MetricService_ServiceDesc is the grpc.ServiceDesc for MetricService service. +// It's only intended for direct use with grpc.RegisterService, +// and not to be introspected or modified (even as a copy) +var MetricService_ServiceDesc = grpc.ServiceDesc{ + ServiceName: "grpc.MetricService", + HandlerType: (*MetricServiceServer)(nil), + Methods: []grpc.MethodDesc{ + { + MethodName: "Send", + Handler: _MetricService_Send_Handler, + }, + }, + Streams: []grpc.StreamDesc{}, + Metadata: "services/metric_service.proto", +} diff --git a/grpc/metric_service_v2.pb.go b/grpc/metric_service_v2.pb.go deleted file mode 100644 index 72025065..00000000 --- a/grpc/metric_service_v2.pb.go +++ /dev/null @@ -1,312 +0,0 @@ -// Code generated by protoc-gen-go. DO NOT EDIT. -// versions: -// protoc-gen-go v1.34.2 -// protoc v5.27.2 -// source: services/metric_service_v2.proto - -package grpc - -import ( - protoreflect "google.golang.org/protobuf/reflect/protoreflect" - protoimpl "google.golang.org/protobuf/runtime/protoimpl" - reflect "reflect" - sync "sync" -) - -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) -) - -type MetricServiceV2SendRequest struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - - Type string `protobuf:"bytes,1,opt,name=type,proto3" json:"type,omitempty"` - NodeKey string `protobuf:"bytes,2,opt,name=node_key,json=nodeKey,proto3" json:"node_key,omitempty"` - Timestamp int64 `protobuf:"varint,3,opt,name=timestamp,proto3" json:"timestamp,omitempty"` - CpuUsagePercent float32 `protobuf:"fixed32,4,opt,name=cpu_usage_percent,json=cpuUsagePercent,proto3" json:"cpu_usage_percent,omitempty"` - TotalMemory uint64 `protobuf:"varint,5,opt,name=total_memory,json=totalMemory,proto3" json:"total_memory,omitempty"` - AvailableMemory uint64 `protobuf:"varint,6,opt,name=available_memory,json=availableMemory,proto3" json:"available_memory,omitempty"` - UsedMemory uint64 `protobuf:"varint,7,opt,name=used_memory,json=usedMemory,proto3" json:"used_memory,omitempty"` - UsedMemoryPercent float32 `protobuf:"fixed32,8,opt,name=used_memory_percent,json=usedMemoryPercent,proto3" json:"used_memory_percent,omitempty"` - TotalDisk uint64 `protobuf:"varint,9,opt,name=total_disk,json=totalDisk,proto3" json:"total_disk,omitempty"` - AvailableDisk uint64 `protobuf:"varint,10,opt,name=available_disk,json=availableDisk,proto3" json:"available_disk,omitempty"` - UsedDisk uint64 `protobuf:"varint,11,opt,name=used_disk,json=usedDisk,proto3" json:"used_disk,omitempty"` - UsedDiskPercent float32 `protobuf:"fixed32,12,opt,name=used_disk_percent,json=usedDiskPercent,proto3" json:"used_disk_percent,omitempty"` - DiskReadBytesRate float32 `protobuf:"fixed32,15,opt,name=disk_read_bytes_rate,json=diskReadBytesRate,proto3" json:"disk_read_bytes_rate,omitempty"` - DiskWriteBytesRate float32 `protobuf:"fixed32,16,opt,name=disk_write_bytes_rate,json=diskWriteBytesRate,proto3" json:"disk_write_bytes_rate,omitempty"` - NetworkBytesSentRate float32 `protobuf:"fixed32,17,opt,name=network_bytes_sent_rate,json=networkBytesSentRate,proto3" json:"network_bytes_sent_rate,omitempty"` - NetworkBytesRecvRate float32 `protobuf:"fixed32,18,opt,name=network_bytes_recv_rate,json=networkBytesRecvRate,proto3" json:"network_bytes_recv_rate,omitempty"` -} - -func (x *MetricServiceV2SendRequest) Reset() { - *x = MetricServiceV2SendRequest{} - if protoimpl.UnsafeEnabled { - mi := &file_services_metric_service_v2_proto_msgTypes[0] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } -} - -func (x *MetricServiceV2SendRequest) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*MetricServiceV2SendRequest) ProtoMessage() {} - -func (x *MetricServiceV2SendRequest) ProtoReflect() protoreflect.Message { - mi := &file_services_metric_service_v2_proto_msgTypes[0] - if protoimpl.UnsafeEnabled && x != nil { - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - if ms.LoadMessageInfo() == nil { - ms.StoreMessageInfo(mi) - } - return ms - } - return mi.MessageOf(x) -} - -// Deprecated: Use MetricServiceV2SendRequest.ProtoReflect.Descriptor instead. -func (*MetricServiceV2SendRequest) Descriptor() ([]byte, []int) { - return file_services_metric_service_v2_proto_rawDescGZIP(), []int{0} -} - -func (x *MetricServiceV2SendRequest) GetType() string { - if x != nil { - return x.Type - } - return "" -} - -func (x *MetricServiceV2SendRequest) GetNodeKey() string { - if x != nil { - return x.NodeKey - } - return "" -} - -func (x *MetricServiceV2SendRequest) GetTimestamp() int64 { - if x != nil { - return x.Timestamp - } - return 0 -} - -func (x *MetricServiceV2SendRequest) GetCpuUsagePercent() float32 { - if x != nil { - return x.CpuUsagePercent - } - return 0 -} - -func (x *MetricServiceV2SendRequest) GetTotalMemory() uint64 { - if x != nil { - return x.TotalMemory - } - return 0 -} - -func (x *MetricServiceV2SendRequest) GetAvailableMemory() uint64 { - if x != nil { - return x.AvailableMemory - } - return 0 -} - -func (x *MetricServiceV2SendRequest) GetUsedMemory() uint64 { - if x != nil { - return x.UsedMemory - } - return 0 -} - -func (x *MetricServiceV2SendRequest) GetUsedMemoryPercent() float32 { - if x != nil { - return x.UsedMemoryPercent - } - return 0 -} - -func (x *MetricServiceV2SendRequest) GetTotalDisk() uint64 { - if x != nil { - return x.TotalDisk - } - return 0 -} - -func (x *MetricServiceV2SendRequest) GetAvailableDisk() uint64 { - if x != nil { - return x.AvailableDisk - } - return 0 -} - -func (x *MetricServiceV2SendRequest) GetUsedDisk() uint64 { - if x != nil { - return x.UsedDisk - } - return 0 -} - -func (x *MetricServiceV2SendRequest) GetUsedDiskPercent() float32 { - if x != nil { - return x.UsedDiskPercent - } - return 0 -} - -func (x *MetricServiceV2SendRequest) GetDiskReadBytesRate() float32 { - if x != nil { - return x.DiskReadBytesRate - } - return 0 -} - -func (x *MetricServiceV2SendRequest) GetDiskWriteBytesRate() float32 { - if x != nil { - return x.DiskWriteBytesRate - } - return 0 -} - -func (x *MetricServiceV2SendRequest) GetNetworkBytesSentRate() float32 { - if x != nil { - return x.NetworkBytesSentRate - } - return 0 -} - -func (x *MetricServiceV2SendRequest) GetNetworkBytesRecvRate() float32 { - if x != nil { - return x.NetworkBytesRecvRate - } - return 0 -} - -var File_services_metric_service_v2_proto protoreflect.FileDescriptor - -var file_services_metric_service_v2_proto_rawDesc = []byte{ - 0x0a, 0x20, 0x73, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x73, 0x2f, 0x6d, 0x65, 0x74, 0x72, 0x69, - 0x63, 0x5f, 0x73, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x5f, 0x76, 0x32, 0x2e, 0x70, 0x72, 0x6f, - 0x74, 0x6f, 0x12, 0x04, 0x67, 0x72, 0x70, 0x63, 0x1a, 0x15, 0x65, 0x6e, 0x74, 0x69, 0x74, 0x79, - 0x2f, 0x72, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x22, - 0x95, 0x05, 0x0a, 0x1a, 0x4d, 0x65, 0x74, 0x72, 0x69, 0x63, 0x53, 0x65, 0x72, 0x76, 0x69, 0x63, - 0x65, 0x56, 0x32, 0x53, 0x65, 0x6e, 0x64, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x12, - 0x0a, 0x04, 0x74, 0x79, 0x70, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, 0x74, 0x79, - 0x70, 0x65, 0x12, 0x19, 0x0a, 0x08, 0x6e, 0x6f, 0x64, 0x65, 0x5f, 0x6b, 0x65, 0x79, 0x18, 0x02, - 0x20, 0x01, 0x28, 0x09, 0x52, 0x07, 0x6e, 0x6f, 0x64, 0x65, 0x4b, 0x65, 0x79, 0x12, 0x1c, 0x0a, - 0x09, 0x74, 0x69, 0x6d, 0x65, 0x73, 0x74, 0x61, 0x6d, 0x70, 0x18, 0x03, 0x20, 0x01, 0x28, 0x03, - 0x52, 0x09, 0x74, 0x69, 0x6d, 0x65, 0x73, 0x74, 0x61, 0x6d, 0x70, 0x12, 0x2a, 0x0a, 0x11, 0x63, - 0x70, 0x75, 0x5f, 0x75, 0x73, 0x61, 0x67, 0x65, 0x5f, 0x70, 0x65, 0x72, 0x63, 0x65, 0x6e, 0x74, - 0x18, 0x04, 0x20, 0x01, 0x28, 0x02, 0x52, 0x0f, 0x63, 0x70, 0x75, 0x55, 0x73, 0x61, 0x67, 0x65, - 0x50, 0x65, 0x72, 0x63, 0x65, 0x6e, 0x74, 0x12, 0x21, 0x0a, 0x0c, 0x74, 0x6f, 0x74, 0x61, 0x6c, - 0x5f, 0x6d, 0x65, 0x6d, 0x6f, 0x72, 0x79, 0x18, 0x05, 0x20, 0x01, 0x28, 0x04, 0x52, 0x0b, 0x74, - 0x6f, 0x74, 0x61, 0x6c, 0x4d, 0x65, 0x6d, 0x6f, 0x72, 0x79, 0x12, 0x29, 0x0a, 0x10, 0x61, 0x76, - 0x61, 0x69, 0x6c, 0x61, 0x62, 0x6c, 0x65, 0x5f, 0x6d, 0x65, 0x6d, 0x6f, 0x72, 0x79, 0x18, 0x06, - 0x20, 0x01, 0x28, 0x04, 0x52, 0x0f, 0x61, 0x76, 0x61, 0x69, 0x6c, 0x61, 0x62, 0x6c, 0x65, 0x4d, - 0x65, 0x6d, 0x6f, 0x72, 0x79, 0x12, 0x1f, 0x0a, 0x0b, 0x75, 0x73, 0x65, 0x64, 0x5f, 0x6d, 0x65, - 0x6d, 0x6f, 0x72, 0x79, 0x18, 0x07, 0x20, 0x01, 0x28, 0x04, 0x52, 0x0a, 0x75, 0x73, 0x65, 0x64, - 0x4d, 0x65, 0x6d, 0x6f, 0x72, 0x79, 0x12, 0x2e, 0x0a, 0x13, 0x75, 0x73, 0x65, 0x64, 0x5f, 0x6d, - 0x65, 0x6d, 0x6f, 0x72, 0x79, 0x5f, 0x70, 0x65, 0x72, 0x63, 0x65, 0x6e, 0x74, 0x18, 0x08, 0x20, - 0x01, 0x28, 0x02, 0x52, 0x11, 0x75, 0x73, 0x65, 0x64, 0x4d, 0x65, 0x6d, 0x6f, 0x72, 0x79, 0x50, - 0x65, 0x72, 0x63, 0x65, 0x6e, 0x74, 0x12, 0x1d, 0x0a, 0x0a, 0x74, 0x6f, 0x74, 0x61, 0x6c, 0x5f, - 0x64, 0x69, 0x73, 0x6b, 0x18, 0x09, 0x20, 0x01, 0x28, 0x04, 0x52, 0x09, 0x74, 0x6f, 0x74, 0x61, - 0x6c, 0x44, 0x69, 0x73, 0x6b, 0x12, 0x25, 0x0a, 0x0e, 0x61, 0x76, 0x61, 0x69, 0x6c, 0x61, 0x62, - 0x6c, 0x65, 0x5f, 0x64, 0x69, 0x73, 0x6b, 0x18, 0x0a, 0x20, 0x01, 0x28, 0x04, 0x52, 0x0d, 0x61, - 0x76, 0x61, 0x69, 0x6c, 0x61, 0x62, 0x6c, 0x65, 0x44, 0x69, 0x73, 0x6b, 0x12, 0x1b, 0x0a, 0x09, - 0x75, 0x73, 0x65, 0x64, 0x5f, 0x64, 0x69, 0x73, 0x6b, 0x18, 0x0b, 0x20, 0x01, 0x28, 0x04, 0x52, - 0x08, 0x75, 0x73, 0x65, 0x64, 0x44, 0x69, 0x73, 0x6b, 0x12, 0x2a, 0x0a, 0x11, 0x75, 0x73, 0x65, - 0x64, 0x5f, 0x64, 0x69, 0x73, 0x6b, 0x5f, 0x70, 0x65, 0x72, 0x63, 0x65, 0x6e, 0x74, 0x18, 0x0c, - 0x20, 0x01, 0x28, 0x02, 0x52, 0x0f, 0x75, 0x73, 0x65, 0x64, 0x44, 0x69, 0x73, 0x6b, 0x50, 0x65, - 0x72, 0x63, 0x65, 0x6e, 0x74, 0x12, 0x2f, 0x0a, 0x14, 0x64, 0x69, 0x73, 0x6b, 0x5f, 0x72, 0x65, - 0x61, 0x64, 0x5f, 0x62, 0x79, 0x74, 0x65, 0x73, 0x5f, 0x72, 0x61, 0x74, 0x65, 0x18, 0x0f, 0x20, - 0x01, 0x28, 0x02, 0x52, 0x11, 0x64, 0x69, 0x73, 0x6b, 0x52, 0x65, 0x61, 0x64, 0x42, 0x79, 0x74, - 0x65, 0x73, 0x52, 0x61, 0x74, 0x65, 0x12, 0x31, 0x0a, 0x15, 0x64, 0x69, 0x73, 0x6b, 0x5f, 0x77, - 0x72, 0x69, 0x74, 0x65, 0x5f, 0x62, 0x79, 0x74, 0x65, 0x73, 0x5f, 0x72, 0x61, 0x74, 0x65, 0x18, - 0x10, 0x20, 0x01, 0x28, 0x02, 0x52, 0x12, 0x64, 0x69, 0x73, 0x6b, 0x57, 0x72, 0x69, 0x74, 0x65, - 0x42, 0x79, 0x74, 0x65, 0x73, 0x52, 0x61, 0x74, 0x65, 0x12, 0x35, 0x0a, 0x17, 0x6e, 0x65, 0x74, - 0x77, 0x6f, 0x72, 0x6b, 0x5f, 0x62, 0x79, 0x74, 0x65, 0x73, 0x5f, 0x73, 0x65, 0x6e, 0x74, 0x5f, - 0x72, 0x61, 0x74, 0x65, 0x18, 0x11, 0x20, 0x01, 0x28, 0x02, 0x52, 0x14, 0x6e, 0x65, 0x74, 0x77, - 0x6f, 0x72, 0x6b, 0x42, 0x79, 0x74, 0x65, 0x73, 0x53, 0x65, 0x6e, 0x74, 0x52, 0x61, 0x74, 0x65, - 0x12, 0x35, 0x0a, 0x17, 0x6e, 0x65, 0x74, 0x77, 0x6f, 0x72, 0x6b, 0x5f, 0x62, 0x79, 0x74, 0x65, - 0x73, 0x5f, 0x72, 0x65, 0x63, 0x76, 0x5f, 0x72, 0x61, 0x74, 0x65, 0x18, 0x12, 0x20, 0x01, 0x28, - 0x02, 0x52, 0x14, 0x6e, 0x65, 0x74, 0x77, 0x6f, 0x72, 0x6b, 0x42, 0x79, 0x74, 0x65, 0x73, 0x52, - 0x65, 0x63, 0x76, 0x52, 0x61, 0x74, 0x65, 0x32, 0x4d, 0x0a, 0x0f, 0x4d, 0x65, 0x74, 0x72, 0x69, - 0x63, 0x53, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x56, 0x32, 0x12, 0x3a, 0x0a, 0x04, 0x53, 0x65, - 0x6e, 0x64, 0x12, 0x20, 0x2e, 0x67, 0x72, 0x70, 0x63, 0x2e, 0x4d, 0x65, 0x74, 0x72, 0x69, 0x63, - 0x53, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x56, 0x32, 0x53, 0x65, 0x6e, 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, 0x42, 0x08, 0x5a, 0x06, 0x2e, 0x3b, 0x67, 0x72, 0x70, 0x63, - 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, -} - -var ( - file_services_metric_service_v2_proto_rawDescOnce sync.Once - file_services_metric_service_v2_proto_rawDescData = file_services_metric_service_v2_proto_rawDesc -) - -func file_services_metric_service_v2_proto_rawDescGZIP() []byte { - file_services_metric_service_v2_proto_rawDescOnce.Do(func() { - file_services_metric_service_v2_proto_rawDescData = protoimpl.X.CompressGZIP(file_services_metric_service_v2_proto_rawDescData) - }) - return file_services_metric_service_v2_proto_rawDescData -} - -var file_services_metric_service_v2_proto_msgTypes = make([]protoimpl.MessageInfo, 1) -var file_services_metric_service_v2_proto_goTypes = []any{ - (*MetricServiceV2SendRequest)(nil), // 0: grpc.MetricServiceV2SendRequest - (*Response)(nil), // 1: grpc.Response -} -var file_services_metric_service_v2_proto_depIdxs = []int32{ - 0, // 0: grpc.MetricServiceV2.Send:input_type -> grpc.MetricServiceV2SendRequest - 1, // 1: grpc.MetricServiceV2.Send:output_type -> grpc.Response - 1, // [1:2] is the sub-list for method output_type - 0, // [0:1] 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_metric_service_v2_proto_init() } -func file_services_metric_service_v2_proto_init() { - if File_services_metric_service_v2_proto != nil { - return - } - file_entity_response_proto_init() - if !protoimpl.UnsafeEnabled { - file_services_metric_service_v2_proto_msgTypes[0].Exporter = func(v any, i int) any { - switch v := v.(*MetricServiceV2SendRequest); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - } - type x struct{} - out := protoimpl.TypeBuilder{ - File: protoimpl.DescBuilder{ - GoPackagePath: reflect.TypeOf(x{}).PkgPath(), - RawDescriptor: file_services_metric_service_v2_proto_rawDesc, - NumEnums: 0, - NumMessages: 1, - NumExtensions: 0, - NumServices: 1, - }, - GoTypes: file_services_metric_service_v2_proto_goTypes, - DependencyIndexes: file_services_metric_service_v2_proto_depIdxs, - MessageInfos: file_services_metric_service_v2_proto_msgTypes, - }.Build() - File_services_metric_service_v2_proto = out.File - file_services_metric_service_v2_proto_rawDesc = nil - file_services_metric_service_v2_proto_goTypes = nil - file_services_metric_service_v2_proto_depIdxs = nil -} diff --git a/grpc/metric_service_v2_grpc.pb.go b/grpc/metric_service_v2_grpc.pb.go deleted file mode 100644 index af8e8773..00000000 --- a/grpc/metric_service_v2_grpc.pb.go +++ /dev/null @@ -1,110 +0,0 @@ -// Code generated by protoc-gen-go-grpc. DO NOT EDIT. -// versions: -// - protoc-gen-go-grpc v1.4.0 -// - protoc v5.27.2 -// source: services/metric_service_v2.proto - -package grpc - -import ( - context "context" - grpc "google.golang.org/grpc" - codes "google.golang.org/grpc/codes" - status "google.golang.org/grpc/status" -) - -// This is a compile-time assertion to ensure that this generated file -// is compatible with the grpc package it is being compiled against. -// Requires gRPC-Go v1.62.0 or later. -const _ = grpc.SupportPackageIsVersion8 - -const ( - MetricServiceV2_Send_FullMethodName = "/grpc.MetricServiceV2/Send" -) - -// MetricServiceV2Client is the client API for MetricServiceV2 service. -// -// For semantics around ctx use and closing/ending streaming RPCs, please refer to https://pkg.go.dev/google.golang.org/grpc/?tab=doc#ClientConn.NewStream. -type MetricServiceV2Client interface { - Send(ctx context.Context, in *MetricServiceV2SendRequest, opts ...grpc.CallOption) (*Response, error) -} - -type metricServiceV2Client struct { - cc grpc.ClientConnInterface -} - -func NewMetricServiceV2Client(cc grpc.ClientConnInterface) MetricServiceV2Client { - return &metricServiceV2Client{cc} -} - -func (c *metricServiceV2Client) Send(ctx context.Context, in *MetricServiceV2SendRequest, opts ...grpc.CallOption) (*Response, error) { - cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...) - out := new(Response) - err := c.cc.Invoke(ctx, MetricServiceV2_Send_FullMethodName, in, out, cOpts...) - if err != nil { - return nil, err - } - return out, nil -} - -// MetricServiceV2Server is the server API for MetricServiceV2 service. -// All implementations must embed UnimplementedMetricServiceV2Server -// for forward compatibility -type MetricServiceV2Server interface { - Send(context.Context, *MetricServiceV2SendRequest) (*Response, error) - mustEmbedUnimplementedMetricServiceV2Server() -} - -// UnimplementedMetricServiceV2Server must be embedded to have forward compatible implementations. -type UnimplementedMetricServiceV2Server struct { -} - -func (UnimplementedMetricServiceV2Server) Send(context.Context, *MetricServiceV2SendRequest) (*Response, error) { - return nil, status.Errorf(codes.Unimplemented, "method Send not implemented") -} -func (UnimplementedMetricServiceV2Server) mustEmbedUnimplementedMetricServiceV2Server() {} - -// UnsafeMetricServiceV2Server may be embedded to opt out of forward compatibility for this service. -// Use of this interface is not recommended, as added methods to MetricServiceV2Server will -// result in compilation errors. -type UnsafeMetricServiceV2Server interface { - mustEmbedUnimplementedMetricServiceV2Server() -} - -func RegisterMetricServiceV2Server(s grpc.ServiceRegistrar, srv MetricServiceV2Server) { - s.RegisterService(&MetricServiceV2_ServiceDesc, srv) -} - -func _MetricServiceV2_Send_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { - in := new(MetricServiceV2SendRequest) - if err := dec(in); err != nil { - return nil, err - } - if interceptor == nil { - return srv.(MetricServiceV2Server).Send(ctx, in) - } - info := &grpc.UnaryServerInfo{ - Server: srv, - FullMethod: MetricServiceV2_Send_FullMethodName, - } - handler := func(ctx context.Context, req interface{}) (interface{}, error) { - return srv.(MetricServiceV2Server).Send(ctx, req.(*MetricServiceV2SendRequest)) - } - return interceptor(ctx, in, info, handler) -} - -// MetricServiceV2_ServiceDesc is the grpc.ServiceDesc for MetricServiceV2 service. -// It's only intended for direct use with grpc.RegisterService, -// and not to be introspected or modified (even as a copy) -var MetricServiceV2_ServiceDesc = grpc.ServiceDesc{ - ServiceName: "grpc.MetricServiceV2", - HandlerType: (*MetricServiceV2Server)(nil), - Methods: []grpc.MethodDesc{ - { - MethodName: "Send", - Handler: _MetricServiceV2_Send_Handler, - }, - }, - Streams: []grpc.StreamDesc{}, - Metadata: "services/metric_service_v2.proto", -} diff --git a/grpc/model_base_service.pb.go b/grpc/model_base_service.pb.go new file mode 100644 index 00000000..76230aa8 --- /dev/null +++ b/grpc/model_base_service.pb.go @@ -0,0 +1,171 @@ +// Code generated by protoc-gen-go. DO NOT EDIT. +// versions: +// protoc-gen-go v1.34.2 +// protoc v5.27.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, 0xb6, 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, 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 + (*ModelServiceCountRequest)(nil), // 13: grpc.ModelServiceCountRequest + (*Response)(nil), // 14: 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.Count:input_type -> grpc.ModelServiceCountRequest + 14, // 14: grpc.ModelBaseService.GetById:output_type -> grpc.Response + 14, // 15: grpc.ModelBaseService.GetOne:output_type -> grpc.Response + 14, // 16: grpc.ModelBaseService.GetMany:output_type -> grpc.Response + 14, // 17: grpc.ModelBaseService.DeleteById:output_type -> grpc.Response + 14, // 18: grpc.ModelBaseService.DeleteOne:output_type -> grpc.Response + 14, // 19: grpc.ModelBaseService.DeleteMany:output_type -> grpc.Response + 14, // 20: grpc.ModelBaseService.UpdateById:output_type -> grpc.Response + 14, // 21: grpc.ModelBaseService.UpdateOne:output_type -> grpc.Response + 14, // 22: grpc.ModelBaseService.UpdateMany:output_type -> grpc.Response + 14, // 23: grpc.ModelBaseService.ReplaceById:output_type -> grpc.Response + 14, // 24: grpc.ModelBaseService.ReplaceOne:output_type -> grpc.Response + 14, // 25: grpc.ModelBaseService.InsertOne:output_type -> grpc.Response + 14, // 26: grpc.ModelBaseService.InsertMany:output_type -> grpc.Response + 14, // 27: grpc.ModelBaseService.Count:output_type -> grpc.Response + 14, // [14:28] is the sub-list for method output_type + 0, // [0:14] 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 +} diff --git a/grpc/model_base_service_grpc.pb.go b/grpc/model_base_service_grpc.pb.go new file mode 100644 index 00000000..8a595b7c --- /dev/null +++ b/grpc/model_base_service_grpc.pb.go @@ -0,0 +1,604 @@ +// Code generated by protoc-gen-go-grpc. DO NOT EDIT. +// versions: +// - protoc-gen-go-grpc v1.4.0 +// - protoc v5.27.2 +// source: services/model_base_service.proto + +package grpc + +import ( + context "context" + grpc "google.golang.org/grpc" + codes "google.golang.org/grpc/codes" + status "google.golang.org/grpc/status" +) + +// This is a compile-time assertion to ensure that this generated file +// is compatible with the grpc package it is being compiled against. +// Requires gRPC-Go v1.62.0 or later. +const _ = grpc.SupportPackageIsVersion8 + +const ( + ModelBaseService_GetById_FullMethodName = "/grpc.ModelBaseService/GetById" + ModelBaseService_GetOne_FullMethodName = "/grpc.ModelBaseService/GetOne" + ModelBaseService_GetMany_FullMethodName = "/grpc.ModelBaseService/GetMany" + ModelBaseService_DeleteById_FullMethodName = "/grpc.ModelBaseService/DeleteById" + ModelBaseService_DeleteOne_FullMethodName = "/grpc.ModelBaseService/DeleteOne" + ModelBaseService_DeleteMany_FullMethodName = "/grpc.ModelBaseService/DeleteMany" + ModelBaseService_UpdateById_FullMethodName = "/grpc.ModelBaseService/UpdateById" + ModelBaseService_UpdateOne_FullMethodName = "/grpc.ModelBaseService/UpdateOne" + ModelBaseService_UpdateMany_FullMethodName = "/grpc.ModelBaseService/UpdateMany" + ModelBaseService_ReplaceById_FullMethodName = "/grpc.ModelBaseService/ReplaceById" + ModelBaseService_ReplaceOne_FullMethodName = "/grpc.ModelBaseService/ReplaceOne" + ModelBaseService_InsertOne_FullMethodName = "/grpc.ModelBaseService/InsertOne" + ModelBaseService_InsertMany_FullMethodName = "/grpc.ModelBaseService/InsertMany" + ModelBaseService_Count_FullMethodName = "/grpc.ModelBaseService/Count" +) + +// ModelBaseServiceClient is the client API for ModelBaseService service. +// +// For semantics around ctx use and closing/ending streaming RPCs, please refer to https://pkg.go.dev/google.golang.org/grpc/?tab=doc#ClientConn.NewStream. +type ModelBaseServiceClient interface { + GetById(ctx context.Context, in *ModelServiceGetByIdRequest, opts ...grpc.CallOption) (*Response, error) + GetOne(ctx context.Context, in *ModelServiceGetOneRequest, opts ...grpc.CallOption) (*Response, error) + GetMany(ctx context.Context, in *ModelServiceGetManyRequest, opts ...grpc.CallOption) (*Response, error) + DeleteById(ctx context.Context, in *ModelServiceDeleteByIdRequest, opts ...grpc.CallOption) (*Response, error) + DeleteOne(ctx context.Context, in *ModelServiceDeleteOneRequest, opts ...grpc.CallOption) (*Response, error) + DeleteMany(ctx context.Context, in *ModelServiceDeleteManyRequest, opts ...grpc.CallOption) (*Response, error) + UpdateById(ctx context.Context, in *ModelServiceUpdateByIdRequest, opts ...grpc.CallOption) (*Response, error) + UpdateOne(ctx context.Context, in *ModelServiceUpdateOneRequest, opts ...grpc.CallOption) (*Response, error) + UpdateMany(ctx context.Context, in *ModelServiceUpdateManyRequest, opts ...grpc.CallOption) (*Response, error) + ReplaceById(ctx context.Context, in *ModelServiceReplaceByIdRequest, opts ...grpc.CallOption) (*Response, error) + ReplaceOne(ctx context.Context, in *ModelServiceReplaceOneRequest, opts ...grpc.CallOption) (*Response, error) + InsertOne(ctx context.Context, in *ModelServiceInsertOneRequest, opts ...grpc.CallOption) (*Response, error) + InsertMany(ctx context.Context, in *ModelServiceInsertManyRequest, opts ...grpc.CallOption) (*Response, error) + Count(ctx context.Context, in *ModelServiceCountRequest, opts ...grpc.CallOption) (*Response, error) +} + +type modelBaseServiceClient struct { + cc grpc.ClientConnInterface +} + +func NewModelBaseServiceClient(cc grpc.ClientConnInterface) ModelBaseServiceClient { + return &modelBaseServiceClient{cc} +} + +func (c *modelBaseServiceClient) GetById(ctx context.Context, in *ModelServiceGetByIdRequest, opts ...grpc.CallOption) (*Response, error) { + cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...) + out := new(Response) + err := c.cc.Invoke(ctx, ModelBaseService_GetById_FullMethodName, in, out, cOpts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *modelBaseServiceClient) GetOne(ctx context.Context, in *ModelServiceGetOneRequest, opts ...grpc.CallOption) (*Response, error) { + cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...) + out := new(Response) + err := c.cc.Invoke(ctx, ModelBaseService_GetOne_FullMethodName, in, out, cOpts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *modelBaseServiceClient) GetMany(ctx context.Context, in *ModelServiceGetManyRequest, opts ...grpc.CallOption) (*Response, error) { + cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...) + out := new(Response) + err := c.cc.Invoke(ctx, ModelBaseService_GetMany_FullMethodName, in, out, cOpts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *modelBaseServiceClient) DeleteById(ctx context.Context, in *ModelServiceDeleteByIdRequest, opts ...grpc.CallOption) (*Response, error) { + cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...) + out := new(Response) + err := c.cc.Invoke(ctx, ModelBaseService_DeleteById_FullMethodName, in, out, cOpts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *modelBaseServiceClient) DeleteOne(ctx context.Context, in *ModelServiceDeleteOneRequest, opts ...grpc.CallOption) (*Response, error) { + cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...) + out := new(Response) + err := c.cc.Invoke(ctx, ModelBaseService_DeleteOne_FullMethodName, in, out, cOpts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *modelBaseServiceClient) DeleteMany(ctx context.Context, in *ModelServiceDeleteManyRequest, opts ...grpc.CallOption) (*Response, error) { + cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...) + out := new(Response) + err := c.cc.Invoke(ctx, ModelBaseService_DeleteMany_FullMethodName, in, out, cOpts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *modelBaseServiceClient) UpdateById(ctx context.Context, in *ModelServiceUpdateByIdRequest, opts ...grpc.CallOption) (*Response, error) { + cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...) + out := new(Response) + err := c.cc.Invoke(ctx, ModelBaseService_UpdateById_FullMethodName, in, out, cOpts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *modelBaseServiceClient) UpdateOne(ctx context.Context, in *ModelServiceUpdateOneRequest, opts ...grpc.CallOption) (*Response, error) { + cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...) + out := new(Response) + err := c.cc.Invoke(ctx, ModelBaseService_UpdateOne_FullMethodName, in, out, cOpts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *modelBaseServiceClient) UpdateMany(ctx context.Context, in *ModelServiceUpdateManyRequest, opts ...grpc.CallOption) (*Response, error) { + cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...) + out := new(Response) + err := c.cc.Invoke(ctx, ModelBaseService_UpdateMany_FullMethodName, in, out, cOpts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *modelBaseServiceClient) ReplaceById(ctx context.Context, in *ModelServiceReplaceByIdRequest, opts ...grpc.CallOption) (*Response, error) { + cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...) + out := new(Response) + err := c.cc.Invoke(ctx, ModelBaseService_ReplaceById_FullMethodName, in, out, cOpts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *modelBaseServiceClient) ReplaceOne(ctx context.Context, in *ModelServiceReplaceOneRequest, opts ...grpc.CallOption) (*Response, error) { + cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...) + out := new(Response) + err := c.cc.Invoke(ctx, ModelBaseService_ReplaceOne_FullMethodName, in, out, cOpts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *modelBaseServiceClient) InsertOne(ctx context.Context, in *ModelServiceInsertOneRequest, opts ...grpc.CallOption) (*Response, error) { + cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...) + out := new(Response) + err := c.cc.Invoke(ctx, ModelBaseService_InsertOne_FullMethodName, in, out, cOpts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *modelBaseServiceClient) InsertMany(ctx context.Context, in *ModelServiceInsertManyRequest, opts ...grpc.CallOption) (*Response, error) { + cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...) + out := new(Response) + err := c.cc.Invoke(ctx, ModelBaseService_InsertMany_FullMethodName, in, out, cOpts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *modelBaseServiceClient) Count(ctx context.Context, in *ModelServiceCountRequest, opts ...grpc.CallOption) (*Response, error) { + cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...) + out := new(Response) + err := c.cc.Invoke(ctx, ModelBaseService_Count_FullMethodName, in, out, cOpts...) + if err != nil { + return nil, err + } + return out, nil +} + +// ModelBaseServiceServer is the server API for ModelBaseService service. +// All implementations must embed UnimplementedModelBaseServiceServer +// for forward compatibility +type ModelBaseServiceServer interface { + GetById(context.Context, *ModelServiceGetByIdRequest) (*Response, error) + GetOne(context.Context, *ModelServiceGetOneRequest) (*Response, error) + GetMany(context.Context, *ModelServiceGetManyRequest) (*Response, error) + DeleteById(context.Context, *ModelServiceDeleteByIdRequest) (*Response, error) + DeleteOne(context.Context, *ModelServiceDeleteOneRequest) (*Response, error) + DeleteMany(context.Context, *ModelServiceDeleteManyRequest) (*Response, error) + UpdateById(context.Context, *ModelServiceUpdateByIdRequest) (*Response, error) + UpdateOne(context.Context, *ModelServiceUpdateOneRequest) (*Response, error) + UpdateMany(context.Context, *ModelServiceUpdateManyRequest) (*Response, error) + ReplaceById(context.Context, *ModelServiceReplaceByIdRequest) (*Response, error) + ReplaceOne(context.Context, *ModelServiceReplaceOneRequest) (*Response, error) + InsertOne(context.Context, *ModelServiceInsertOneRequest) (*Response, error) + InsertMany(context.Context, *ModelServiceInsertManyRequest) (*Response, error) + Count(context.Context, *ModelServiceCountRequest) (*Response, error) + mustEmbedUnimplementedModelBaseServiceServer() +} + +// UnimplementedModelBaseServiceServer must be embedded to have forward compatible implementations. +type UnimplementedModelBaseServiceServer struct { +} + +func (UnimplementedModelBaseServiceServer) GetById(context.Context, *ModelServiceGetByIdRequest) (*Response, error) { + return nil, status.Errorf(codes.Unimplemented, "method GetById not implemented") +} +func (UnimplementedModelBaseServiceServer) GetOne(context.Context, *ModelServiceGetOneRequest) (*Response, error) { + return nil, status.Errorf(codes.Unimplemented, "method GetOne not implemented") +} +func (UnimplementedModelBaseServiceServer) GetMany(context.Context, *ModelServiceGetManyRequest) (*Response, error) { + return nil, status.Errorf(codes.Unimplemented, "method GetMany not implemented") +} +func (UnimplementedModelBaseServiceServer) DeleteById(context.Context, *ModelServiceDeleteByIdRequest) (*Response, error) { + return nil, status.Errorf(codes.Unimplemented, "method DeleteById not implemented") +} +func (UnimplementedModelBaseServiceServer) DeleteOne(context.Context, *ModelServiceDeleteOneRequest) (*Response, error) { + return nil, status.Errorf(codes.Unimplemented, "method DeleteOne not implemented") +} +func (UnimplementedModelBaseServiceServer) DeleteMany(context.Context, *ModelServiceDeleteManyRequest) (*Response, error) { + return nil, status.Errorf(codes.Unimplemented, "method DeleteMany not implemented") +} +func (UnimplementedModelBaseServiceServer) UpdateById(context.Context, *ModelServiceUpdateByIdRequest) (*Response, error) { + return nil, status.Errorf(codes.Unimplemented, "method UpdateById not implemented") +} +func (UnimplementedModelBaseServiceServer) UpdateOne(context.Context, *ModelServiceUpdateOneRequest) (*Response, error) { + return nil, status.Errorf(codes.Unimplemented, "method UpdateOne not implemented") +} +func (UnimplementedModelBaseServiceServer) UpdateMany(context.Context, *ModelServiceUpdateManyRequest) (*Response, error) { + return nil, status.Errorf(codes.Unimplemented, "method UpdateMany not implemented") +} +func (UnimplementedModelBaseServiceServer) ReplaceById(context.Context, *ModelServiceReplaceByIdRequest) (*Response, error) { + return nil, status.Errorf(codes.Unimplemented, "method ReplaceById not implemented") +} +func (UnimplementedModelBaseServiceServer) ReplaceOne(context.Context, *ModelServiceReplaceOneRequest) (*Response, error) { + return nil, status.Errorf(codes.Unimplemented, "method ReplaceOne not implemented") +} +func (UnimplementedModelBaseServiceServer) InsertOne(context.Context, *ModelServiceInsertOneRequest) (*Response, error) { + return nil, status.Errorf(codes.Unimplemented, "method InsertOne not implemented") +} +func (UnimplementedModelBaseServiceServer) InsertMany(context.Context, *ModelServiceInsertManyRequest) (*Response, error) { + return nil, status.Errorf(codes.Unimplemented, "method InsertMany not implemented") +} +func (UnimplementedModelBaseServiceServer) Count(context.Context, *ModelServiceCountRequest) (*Response, error) { + return nil, status.Errorf(codes.Unimplemented, "method Count not implemented") +} +func (UnimplementedModelBaseServiceServer) mustEmbedUnimplementedModelBaseServiceServer() {} + +// UnsafeModelBaseServiceServer may be embedded to opt out of forward compatibility for this service. +// Use of this interface is not recommended, as added methods to ModelBaseServiceServer will +// result in compilation errors. +type UnsafeModelBaseServiceServer interface { + mustEmbedUnimplementedModelBaseServiceServer() +} + +func RegisterModelBaseServiceServer(s grpc.ServiceRegistrar, srv ModelBaseServiceServer) { + s.RegisterService(&ModelBaseService_ServiceDesc, srv) +} + +func _ModelBaseService_GetById_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(ModelServiceGetByIdRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(ModelBaseServiceServer).GetById(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: ModelBaseService_GetById_FullMethodName, + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(ModelBaseServiceServer).GetById(ctx, req.(*ModelServiceGetByIdRequest)) + } + return interceptor(ctx, in, info, handler) +} + +func _ModelBaseService_GetOne_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(ModelServiceGetOneRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(ModelBaseServiceServer).GetOne(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: ModelBaseService_GetOne_FullMethodName, + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(ModelBaseServiceServer).GetOne(ctx, req.(*ModelServiceGetOneRequest)) + } + return interceptor(ctx, in, info, handler) +} + +func _ModelBaseService_GetMany_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(ModelServiceGetManyRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(ModelBaseServiceServer).GetMany(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: ModelBaseService_GetMany_FullMethodName, + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(ModelBaseServiceServer).GetMany(ctx, req.(*ModelServiceGetManyRequest)) + } + return interceptor(ctx, in, info, handler) +} + +func _ModelBaseService_DeleteById_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(ModelServiceDeleteByIdRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(ModelBaseServiceServer).DeleteById(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: ModelBaseService_DeleteById_FullMethodName, + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(ModelBaseServiceServer).DeleteById(ctx, req.(*ModelServiceDeleteByIdRequest)) + } + return interceptor(ctx, in, info, handler) +} + +func _ModelBaseService_DeleteOne_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(ModelServiceDeleteOneRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(ModelBaseServiceServer).DeleteOne(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: ModelBaseService_DeleteOne_FullMethodName, + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(ModelBaseServiceServer).DeleteOne(ctx, req.(*ModelServiceDeleteOneRequest)) + } + return interceptor(ctx, in, info, handler) +} + +func _ModelBaseService_DeleteMany_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(ModelServiceDeleteManyRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(ModelBaseServiceServer).DeleteMany(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: ModelBaseService_DeleteMany_FullMethodName, + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(ModelBaseServiceServer).DeleteMany(ctx, req.(*ModelServiceDeleteManyRequest)) + } + return interceptor(ctx, in, info, handler) +} + +func _ModelBaseService_UpdateById_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(ModelServiceUpdateByIdRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(ModelBaseServiceServer).UpdateById(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: ModelBaseService_UpdateById_FullMethodName, + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(ModelBaseServiceServer).UpdateById(ctx, req.(*ModelServiceUpdateByIdRequest)) + } + return interceptor(ctx, in, info, handler) +} + +func _ModelBaseService_UpdateOne_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(ModelServiceUpdateOneRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(ModelBaseServiceServer).UpdateOne(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: ModelBaseService_UpdateOne_FullMethodName, + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(ModelBaseServiceServer).UpdateOne(ctx, req.(*ModelServiceUpdateOneRequest)) + } + return interceptor(ctx, in, info, handler) +} + +func _ModelBaseService_UpdateMany_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(ModelServiceUpdateManyRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(ModelBaseServiceServer).UpdateMany(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: ModelBaseService_UpdateMany_FullMethodName, + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(ModelBaseServiceServer).UpdateMany(ctx, req.(*ModelServiceUpdateManyRequest)) + } + return interceptor(ctx, in, info, handler) +} + +func _ModelBaseService_ReplaceById_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(ModelServiceReplaceByIdRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(ModelBaseServiceServer).ReplaceById(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: ModelBaseService_ReplaceById_FullMethodName, + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(ModelBaseServiceServer).ReplaceById(ctx, req.(*ModelServiceReplaceByIdRequest)) + } + return interceptor(ctx, in, info, handler) +} + +func _ModelBaseService_ReplaceOne_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(ModelServiceReplaceOneRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(ModelBaseServiceServer).ReplaceOne(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: ModelBaseService_ReplaceOne_FullMethodName, + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(ModelBaseServiceServer).ReplaceOne(ctx, req.(*ModelServiceReplaceOneRequest)) + } + return interceptor(ctx, in, info, handler) +} + +func _ModelBaseService_InsertOne_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(ModelServiceInsertOneRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(ModelBaseServiceServer).InsertOne(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: ModelBaseService_InsertOne_FullMethodName, + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(ModelBaseServiceServer).InsertOne(ctx, req.(*ModelServiceInsertOneRequest)) + } + return interceptor(ctx, in, info, handler) +} + +func _ModelBaseService_InsertMany_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(ModelServiceInsertManyRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(ModelBaseServiceServer).InsertMany(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: ModelBaseService_InsertMany_FullMethodName, + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(ModelBaseServiceServer).InsertMany(ctx, req.(*ModelServiceInsertManyRequest)) + } + return interceptor(ctx, in, info, handler) +} + +func _ModelBaseService_Count_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(ModelServiceCountRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(ModelBaseServiceServer).Count(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: ModelBaseService_Count_FullMethodName, + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(ModelBaseServiceServer).Count(ctx, req.(*ModelServiceCountRequest)) + } + return interceptor(ctx, in, info, handler) +} + +// ModelBaseService_ServiceDesc is the grpc.ServiceDesc for ModelBaseService service. +// It's only intended for direct use with grpc.RegisterService, +// and not to be introspected or modified (even as a copy) +var ModelBaseService_ServiceDesc = grpc.ServiceDesc{ + ServiceName: "grpc.ModelBaseService", + HandlerType: (*ModelBaseServiceServer)(nil), + Methods: []grpc.MethodDesc{ + { + MethodName: "GetById", + Handler: _ModelBaseService_GetById_Handler, + }, + { + MethodName: "GetOne", + Handler: _ModelBaseService_GetOne_Handler, + }, + { + MethodName: "GetMany", + Handler: _ModelBaseService_GetMany_Handler, + }, + { + MethodName: "DeleteById", + Handler: _ModelBaseService_DeleteById_Handler, + }, + { + MethodName: "DeleteOne", + Handler: _ModelBaseService_DeleteOne_Handler, + }, + { + MethodName: "DeleteMany", + Handler: _ModelBaseService_DeleteMany_Handler, + }, + { + MethodName: "UpdateById", + Handler: _ModelBaseService_UpdateById_Handler, + }, + { + MethodName: "UpdateOne", + Handler: _ModelBaseService_UpdateOne_Handler, + }, + { + MethodName: "UpdateMany", + Handler: _ModelBaseService_UpdateMany_Handler, + }, + { + MethodName: "ReplaceById", + Handler: _ModelBaseService_ReplaceById_Handler, + }, + { + MethodName: "ReplaceOne", + Handler: _ModelBaseService_ReplaceOne_Handler, + }, + { + MethodName: "InsertOne", + Handler: _ModelBaseService_InsertOne_Handler, + }, + { + MethodName: "InsertMany", + Handler: _ModelBaseService_InsertMany_Handler, + }, + { + MethodName: "Count", + Handler: _ModelBaseService_Count_Handler, + }, + }, + Streams: []grpc.StreamDesc{}, + Metadata: "services/model_base_service.proto", +} diff --git a/grpc/model_base_service_v2.pb.go b/grpc/model_base_service_v2.pb.go deleted file mode 100644 index c6eca7cb..00000000 --- a/grpc/model_base_service_v2.pb.go +++ /dev/null @@ -1,174 +0,0 @@ -// Code generated by protoc-gen-go. DO NOT EDIT. -// versions: -// protoc-gen-go v1.34.2 -// protoc v5.27.2 -// source: services/model_base_service_v2.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_v2_proto protoreflect.FileDescriptor - -var file_services_model_base_service_v2_proto_rawDesc = []byte{ - 0x0a, 0x24, 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, 0x5f, 0x76, 0x32, - 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x12, 0x04, 0x67, 0x72, 0x70, 0x63, 0x1a, 0x25, 0x65, 0x6e, - 0x74, 0x69, 0x74, 0x79, 0x2f, 0x6d, 0x6f, 0x64, 0x65, 0x6c, 0x5f, 0x73, 0x65, 0x72, 0x76, 0x69, - 0x63, 0x65, 0x5f, 0x76, 0x32, 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, 0xd4, 0x07, 0x0a, 0x12, 0x4d, - 0x6f, 0x64, 0x65, 0x6c, 0x42, 0x61, 0x73, 0x65, 0x53, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x56, - 0x32, 0x12, 0x3f, 0x0a, 0x07, 0x47, 0x65, 0x74, 0x42, 0x79, 0x49, 0x64, 0x12, 0x22, 0x2e, 0x67, - 0x72, 0x70, 0x63, 0x2e, 0x4d, 0x6f, 0x64, 0x65, 0x6c, 0x53, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, - 0x56, 0x32, 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, 0x3d, 0x0a, 0x06, 0x47, 0x65, 0x74, 0x4f, 0x6e, 0x65, 0x12, 0x21, 0x2e, 0x67, - 0x72, 0x70, 0x63, 0x2e, 0x4d, 0x6f, 0x64, 0x65, 0x6c, 0x53, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, - 0x56, 0x32, 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, 0x3f, 0x0a, 0x07, 0x47, 0x65, 0x74, 0x4d, 0x61, 0x6e, 0x79, 0x12, 0x22, 0x2e, 0x67, - 0x72, 0x70, 0x63, 0x2e, 0x4d, 0x6f, 0x64, 0x65, 0x6c, 0x53, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, - 0x56, 0x32, 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, 0x45, 0x0a, 0x0a, 0x44, 0x65, 0x6c, 0x65, 0x74, 0x65, 0x42, 0x79, 0x49, 0x64, - 0x12, 0x25, 0x2e, 0x67, 0x72, 0x70, 0x63, 0x2e, 0x4d, 0x6f, 0x64, 0x65, 0x6c, 0x53, 0x65, 0x72, - 0x76, 0x69, 0x63, 0x65, 0x56, 0x32, 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, 0x43, 0x0a, 0x09, 0x44, 0x65, 0x6c, - 0x65, 0x74, 0x65, 0x4f, 0x6e, 0x65, 0x12, 0x24, 0x2e, 0x67, 0x72, 0x70, 0x63, 0x2e, 0x4d, 0x6f, - 0x64, 0x65, 0x6c, 0x53, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x56, 0x32, 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, 0x45, - 0x0a, 0x0a, 0x44, 0x65, 0x6c, 0x65, 0x74, 0x65, 0x4d, 0x61, 0x6e, 0x79, 0x12, 0x25, 0x2e, 0x67, - 0x72, 0x70, 0x63, 0x2e, 0x4d, 0x6f, 0x64, 0x65, 0x6c, 0x53, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, - 0x56, 0x32, 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, 0x45, 0x0a, 0x0a, 0x55, 0x70, 0x64, 0x61, 0x74, 0x65, 0x42, - 0x79, 0x49, 0x64, 0x12, 0x25, 0x2e, 0x67, 0x72, 0x70, 0x63, 0x2e, 0x4d, 0x6f, 0x64, 0x65, 0x6c, - 0x53, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x56, 0x32, 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, 0x43, 0x0a, 0x09, - 0x55, 0x70, 0x64, 0x61, 0x74, 0x65, 0x4f, 0x6e, 0x65, 0x12, 0x24, 0x2e, 0x67, 0x72, 0x70, 0x63, - 0x2e, 0x4d, 0x6f, 0x64, 0x65, 0x6c, 0x53, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x56, 0x32, 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, 0x45, 0x0a, 0x0a, 0x55, 0x70, 0x64, 0x61, 0x74, 0x65, 0x4d, 0x61, 0x6e, 0x79, 0x12, - 0x25, 0x2e, 0x67, 0x72, 0x70, 0x63, 0x2e, 0x4d, 0x6f, 0x64, 0x65, 0x6c, 0x53, 0x65, 0x72, 0x76, - 0x69, 0x63, 0x65, 0x56, 0x32, 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, 0x47, 0x0a, 0x0b, 0x52, 0x65, 0x70, 0x6c, - 0x61, 0x63, 0x65, 0x42, 0x79, 0x49, 0x64, 0x12, 0x26, 0x2e, 0x67, 0x72, 0x70, 0x63, 0x2e, 0x4d, - 0x6f, 0x64, 0x65, 0x6c, 0x53, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x56, 0x32, 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, 0x45, 0x0a, 0x0a, 0x52, 0x65, 0x70, 0x6c, 0x61, 0x63, 0x65, 0x4f, 0x6e, 0x65, 0x12, - 0x25, 0x2e, 0x67, 0x72, 0x70, 0x63, 0x2e, 0x4d, 0x6f, 0x64, 0x65, 0x6c, 0x53, 0x65, 0x72, 0x76, - 0x69, 0x63, 0x65, 0x56, 0x32, 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, 0x43, 0x0a, 0x09, 0x49, 0x6e, 0x73, 0x65, - 0x72, 0x74, 0x4f, 0x6e, 0x65, 0x12, 0x24, 0x2e, 0x67, 0x72, 0x70, 0x63, 0x2e, 0x4d, 0x6f, 0x64, - 0x65, 0x6c, 0x53, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x56, 0x32, 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, 0x45, 0x0a, - 0x0a, 0x49, 0x6e, 0x73, 0x65, 0x72, 0x74, 0x4d, 0x61, 0x6e, 0x79, 0x12, 0x25, 0x2e, 0x67, 0x72, - 0x70, 0x63, 0x2e, 0x4d, 0x6f, 0x64, 0x65, 0x6c, 0x53, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x56, - 0x32, 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, 0x3b, 0x0a, 0x05, 0x43, 0x6f, 0x75, 0x6e, 0x74, 0x12, 0x20, 0x2e, - 0x67, 0x72, 0x70, 0x63, 0x2e, 0x4d, 0x6f, 0x64, 0x65, 0x6c, 0x53, 0x65, 0x72, 0x76, 0x69, 0x63, - 0x65, 0x56, 0x32, 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_v2_proto_goTypes = []any{ - (*ModelServiceV2GetByIdRequest)(nil), // 0: grpc.ModelServiceV2GetByIdRequest - (*ModelServiceV2GetOneRequest)(nil), // 1: grpc.ModelServiceV2GetOneRequest - (*ModelServiceV2GetManyRequest)(nil), // 2: grpc.ModelServiceV2GetManyRequest - (*ModelServiceV2DeleteByIdRequest)(nil), // 3: grpc.ModelServiceV2DeleteByIdRequest - (*ModelServiceV2DeleteOneRequest)(nil), // 4: grpc.ModelServiceV2DeleteOneRequest - (*ModelServiceV2DeleteManyRequest)(nil), // 5: grpc.ModelServiceV2DeleteManyRequest - (*ModelServiceV2UpdateByIdRequest)(nil), // 6: grpc.ModelServiceV2UpdateByIdRequest - (*ModelServiceV2UpdateOneRequest)(nil), // 7: grpc.ModelServiceV2UpdateOneRequest - (*ModelServiceV2UpdateManyRequest)(nil), // 8: grpc.ModelServiceV2UpdateManyRequest - (*ModelServiceV2ReplaceByIdRequest)(nil), // 9: grpc.ModelServiceV2ReplaceByIdRequest - (*ModelServiceV2ReplaceOneRequest)(nil), // 10: grpc.ModelServiceV2ReplaceOneRequest - (*ModelServiceV2InsertOneRequest)(nil), // 11: grpc.ModelServiceV2InsertOneRequest - (*ModelServiceV2InsertManyRequest)(nil), // 12: grpc.ModelServiceV2InsertManyRequest - (*ModelServiceV2CountRequest)(nil), // 13: grpc.ModelServiceV2CountRequest - (*Response)(nil), // 14: grpc.Response -} -var file_services_model_base_service_v2_proto_depIdxs = []int32{ - 0, // 0: grpc.ModelBaseServiceV2.GetById:input_type -> grpc.ModelServiceV2GetByIdRequest - 1, // 1: grpc.ModelBaseServiceV2.GetOne:input_type -> grpc.ModelServiceV2GetOneRequest - 2, // 2: grpc.ModelBaseServiceV2.GetMany:input_type -> grpc.ModelServiceV2GetManyRequest - 3, // 3: grpc.ModelBaseServiceV2.DeleteById:input_type -> grpc.ModelServiceV2DeleteByIdRequest - 4, // 4: grpc.ModelBaseServiceV2.DeleteOne:input_type -> grpc.ModelServiceV2DeleteOneRequest - 5, // 5: grpc.ModelBaseServiceV2.DeleteMany:input_type -> grpc.ModelServiceV2DeleteManyRequest - 6, // 6: grpc.ModelBaseServiceV2.UpdateById:input_type -> grpc.ModelServiceV2UpdateByIdRequest - 7, // 7: grpc.ModelBaseServiceV2.UpdateOne:input_type -> grpc.ModelServiceV2UpdateOneRequest - 8, // 8: grpc.ModelBaseServiceV2.UpdateMany:input_type -> grpc.ModelServiceV2UpdateManyRequest - 9, // 9: grpc.ModelBaseServiceV2.ReplaceById:input_type -> grpc.ModelServiceV2ReplaceByIdRequest - 10, // 10: grpc.ModelBaseServiceV2.ReplaceOne:input_type -> grpc.ModelServiceV2ReplaceOneRequest - 11, // 11: grpc.ModelBaseServiceV2.InsertOne:input_type -> grpc.ModelServiceV2InsertOneRequest - 12, // 12: grpc.ModelBaseServiceV2.InsertMany:input_type -> grpc.ModelServiceV2InsertManyRequest - 13, // 13: grpc.ModelBaseServiceV2.Count:input_type -> grpc.ModelServiceV2CountRequest - 14, // 14: grpc.ModelBaseServiceV2.GetById:output_type -> grpc.Response - 14, // 15: grpc.ModelBaseServiceV2.GetOne:output_type -> grpc.Response - 14, // 16: grpc.ModelBaseServiceV2.GetMany:output_type -> grpc.Response - 14, // 17: grpc.ModelBaseServiceV2.DeleteById:output_type -> grpc.Response - 14, // 18: grpc.ModelBaseServiceV2.DeleteOne:output_type -> grpc.Response - 14, // 19: grpc.ModelBaseServiceV2.DeleteMany:output_type -> grpc.Response - 14, // 20: grpc.ModelBaseServiceV2.UpdateById:output_type -> grpc.Response - 14, // 21: grpc.ModelBaseServiceV2.UpdateOne:output_type -> grpc.Response - 14, // 22: grpc.ModelBaseServiceV2.UpdateMany:output_type -> grpc.Response - 14, // 23: grpc.ModelBaseServiceV2.ReplaceById:output_type -> grpc.Response - 14, // 24: grpc.ModelBaseServiceV2.ReplaceOne:output_type -> grpc.Response - 14, // 25: grpc.ModelBaseServiceV2.InsertOne:output_type -> grpc.Response - 14, // 26: grpc.ModelBaseServiceV2.InsertMany:output_type -> grpc.Response - 14, // 27: grpc.ModelBaseServiceV2.Count:output_type -> grpc.Response - 14, // [14:28] is the sub-list for method output_type - 0, // [0:14] 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_v2_proto_init() } -func file_services_model_base_service_v2_proto_init() { - if File_services_model_base_service_v2_proto != nil { - return - } - file_entity_model_service_v2_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_v2_proto_rawDesc, - NumEnums: 0, - NumMessages: 0, - NumExtensions: 0, - NumServices: 1, - }, - GoTypes: file_services_model_base_service_v2_proto_goTypes, - DependencyIndexes: file_services_model_base_service_v2_proto_depIdxs, - }.Build() - File_services_model_base_service_v2_proto = out.File - file_services_model_base_service_v2_proto_rawDesc = nil - file_services_model_base_service_v2_proto_goTypes = nil - file_services_model_base_service_v2_proto_depIdxs = nil -} diff --git a/grpc/model_base_service_v2_grpc.pb.go b/grpc/model_base_service_v2_grpc.pb.go deleted file mode 100644 index 4bc81df0..00000000 --- a/grpc/model_base_service_v2_grpc.pb.go +++ /dev/null @@ -1,604 +0,0 @@ -// Code generated by protoc-gen-go-grpc. DO NOT EDIT. -// versions: -// - protoc-gen-go-grpc v1.4.0 -// - protoc v5.27.2 -// source: services/model_base_service_v2.proto - -package grpc - -import ( - context "context" - grpc "google.golang.org/grpc" - codes "google.golang.org/grpc/codes" - status "google.golang.org/grpc/status" -) - -// This is a compile-time assertion to ensure that this generated file -// is compatible with the grpc package it is being compiled against. -// Requires gRPC-Go v1.62.0 or later. -const _ = grpc.SupportPackageIsVersion8 - -const ( - ModelBaseServiceV2_GetById_FullMethodName = "/grpc.ModelBaseServiceV2/GetById" - ModelBaseServiceV2_GetOne_FullMethodName = "/grpc.ModelBaseServiceV2/GetOne" - ModelBaseServiceV2_GetMany_FullMethodName = "/grpc.ModelBaseServiceV2/GetMany" - ModelBaseServiceV2_DeleteById_FullMethodName = "/grpc.ModelBaseServiceV2/DeleteById" - ModelBaseServiceV2_DeleteOne_FullMethodName = "/grpc.ModelBaseServiceV2/DeleteOne" - ModelBaseServiceV2_DeleteMany_FullMethodName = "/grpc.ModelBaseServiceV2/DeleteMany" - ModelBaseServiceV2_UpdateById_FullMethodName = "/grpc.ModelBaseServiceV2/UpdateById" - ModelBaseServiceV2_UpdateOne_FullMethodName = "/grpc.ModelBaseServiceV2/UpdateOne" - ModelBaseServiceV2_UpdateMany_FullMethodName = "/grpc.ModelBaseServiceV2/UpdateMany" - ModelBaseServiceV2_ReplaceById_FullMethodName = "/grpc.ModelBaseServiceV2/ReplaceById" - ModelBaseServiceV2_ReplaceOne_FullMethodName = "/grpc.ModelBaseServiceV2/ReplaceOne" - ModelBaseServiceV2_InsertOne_FullMethodName = "/grpc.ModelBaseServiceV2/InsertOne" - ModelBaseServiceV2_InsertMany_FullMethodName = "/grpc.ModelBaseServiceV2/InsertMany" - ModelBaseServiceV2_Count_FullMethodName = "/grpc.ModelBaseServiceV2/Count" -) - -// ModelBaseServiceV2Client is the client API for ModelBaseServiceV2 service. -// -// For semantics around ctx use and closing/ending streaming RPCs, please refer to https://pkg.go.dev/google.golang.org/grpc/?tab=doc#ClientConn.NewStream. -type ModelBaseServiceV2Client interface { - GetById(ctx context.Context, in *ModelServiceV2GetByIdRequest, opts ...grpc.CallOption) (*Response, error) - GetOne(ctx context.Context, in *ModelServiceV2GetOneRequest, opts ...grpc.CallOption) (*Response, error) - GetMany(ctx context.Context, in *ModelServiceV2GetManyRequest, opts ...grpc.CallOption) (*Response, error) - DeleteById(ctx context.Context, in *ModelServiceV2DeleteByIdRequest, opts ...grpc.CallOption) (*Response, error) - DeleteOne(ctx context.Context, in *ModelServiceV2DeleteOneRequest, opts ...grpc.CallOption) (*Response, error) - DeleteMany(ctx context.Context, in *ModelServiceV2DeleteManyRequest, opts ...grpc.CallOption) (*Response, error) - UpdateById(ctx context.Context, in *ModelServiceV2UpdateByIdRequest, opts ...grpc.CallOption) (*Response, error) - UpdateOne(ctx context.Context, in *ModelServiceV2UpdateOneRequest, opts ...grpc.CallOption) (*Response, error) - UpdateMany(ctx context.Context, in *ModelServiceV2UpdateManyRequest, opts ...grpc.CallOption) (*Response, error) - ReplaceById(ctx context.Context, in *ModelServiceV2ReplaceByIdRequest, opts ...grpc.CallOption) (*Response, error) - ReplaceOne(ctx context.Context, in *ModelServiceV2ReplaceOneRequest, opts ...grpc.CallOption) (*Response, error) - InsertOne(ctx context.Context, in *ModelServiceV2InsertOneRequest, opts ...grpc.CallOption) (*Response, error) - InsertMany(ctx context.Context, in *ModelServiceV2InsertManyRequest, opts ...grpc.CallOption) (*Response, error) - Count(ctx context.Context, in *ModelServiceV2CountRequest, opts ...grpc.CallOption) (*Response, error) -} - -type modelBaseServiceV2Client struct { - cc grpc.ClientConnInterface -} - -func NewModelBaseServiceV2Client(cc grpc.ClientConnInterface) ModelBaseServiceV2Client { - return &modelBaseServiceV2Client{cc} -} - -func (c *modelBaseServiceV2Client) GetById(ctx context.Context, in *ModelServiceV2GetByIdRequest, opts ...grpc.CallOption) (*Response, error) { - cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...) - out := new(Response) - err := c.cc.Invoke(ctx, ModelBaseServiceV2_GetById_FullMethodName, in, out, cOpts...) - if err != nil { - return nil, err - } - return out, nil -} - -func (c *modelBaseServiceV2Client) GetOne(ctx context.Context, in *ModelServiceV2GetOneRequest, opts ...grpc.CallOption) (*Response, error) { - cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...) - out := new(Response) - err := c.cc.Invoke(ctx, ModelBaseServiceV2_GetOne_FullMethodName, in, out, cOpts...) - if err != nil { - return nil, err - } - return out, nil -} - -func (c *modelBaseServiceV2Client) GetMany(ctx context.Context, in *ModelServiceV2GetManyRequest, opts ...grpc.CallOption) (*Response, error) { - cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...) - out := new(Response) - err := c.cc.Invoke(ctx, ModelBaseServiceV2_GetMany_FullMethodName, in, out, cOpts...) - if err != nil { - return nil, err - } - return out, nil -} - -func (c *modelBaseServiceV2Client) DeleteById(ctx context.Context, in *ModelServiceV2DeleteByIdRequest, opts ...grpc.CallOption) (*Response, error) { - cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...) - out := new(Response) - err := c.cc.Invoke(ctx, ModelBaseServiceV2_DeleteById_FullMethodName, in, out, cOpts...) - if err != nil { - return nil, err - } - return out, nil -} - -func (c *modelBaseServiceV2Client) DeleteOne(ctx context.Context, in *ModelServiceV2DeleteOneRequest, opts ...grpc.CallOption) (*Response, error) { - cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...) - out := new(Response) - err := c.cc.Invoke(ctx, ModelBaseServiceV2_DeleteOne_FullMethodName, in, out, cOpts...) - if err != nil { - return nil, err - } - return out, nil -} - -func (c *modelBaseServiceV2Client) DeleteMany(ctx context.Context, in *ModelServiceV2DeleteManyRequest, opts ...grpc.CallOption) (*Response, error) { - cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...) - out := new(Response) - err := c.cc.Invoke(ctx, ModelBaseServiceV2_DeleteMany_FullMethodName, in, out, cOpts...) - if err != nil { - return nil, err - } - return out, nil -} - -func (c *modelBaseServiceV2Client) UpdateById(ctx context.Context, in *ModelServiceV2UpdateByIdRequest, opts ...grpc.CallOption) (*Response, error) { - cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...) - out := new(Response) - err := c.cc.Invoke(ctx, ModelBaseServiceV2_UpdateById_FullMethodName, in, out, cOpts...) - if err != nil { - return nil, err - } - return out, nil -} - -func (c *modelBaseServiceV2Client) UpdateOne(ctx context.Context, in *ModelServiceV2UpdateOneRequest, opts ...grpc.CallOption) (*Response, error) { - cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...) - out := new(Response) - err := c.cc.Invoke(ctx, ModelBaseServiceV2_UpdateOne_FullMethodName, in, out, cOpts...) - if err != nil { - return nil, err - } - return out, nil -} - -func (c *modelBaseServiceV2Client) UpdateMany(ctx context.Context, in *ModelServiceV2UpdateManyRequest, opts ...grpc.CallOption) (*Response, error) { - cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...) - out := new(Response) - err := c.cc.Invoke(ctx, ModelBaseServiceV2_UpdateMany_FullMethodName, in, out, cOpts...) - if err != nil { - return nil, err - } - return out, nil -} - -func (c *modelBaseServiceV2Client) ReplaceById(ctx context.Context, in *ModelServiceV2ReplaceByIdRequest, opts ...grpc.CallOption) (*Response, error) { - cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...) - out := new(Response) - err := c.cc.Invoke(ctx, ModelBaseServiceV2_ReplaceById_FullMethodName, in, out, cOpts...) - if err != nil { - return nil, err - } - return out, nil -} - -func (c *modelBaseServiceV2Client) ReplaceOne(ctx context.Context, in *ModelServiceV2ReplaceOneRequest, opts ...grpc.CallOption) (*Response, error) { - cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...) - out := new(Response) - err := c.cc.Invoke(ctx, ModelBaseServiceV2_ReplaceOne_FullMethodName, in, out, cOpts...) - if err != nil { - return nil, err - } - return out, nil -} - -func (c *modelBaseServiceV2Client) InsertOne(ctx context.Context, in *ModelServiceV2InsertOneRequest, opts ...grpc.CallOption) (*Response, error) { - cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...) - out := new(Response) - err := c.cc.Invoke(ctx, ModelBaseServiceV2_InsertOne_FullMethodName, in, out, cOpts...) - if err != nil { - return nil, err - } - return out, nil -} - -func (c *modelBaseServiceV2Client) InsertMany(ctx context.Context, in *ModelServiceV2InsertManyRequest, opts ...grpc.CallOption) (*Response, error) { - cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...) - out := new(Response) - err := c.cc.Invoke(ctx, ModelBaseServiceV2_InsertMany_FullMethodName, in, out, cOpts...) - if err != nil { - return nil, err - } - return out, nil -} - -func (c *modelBaseServiceV2Client) Count(ctx context.Context, in *ModelServiceV2CountRequest, opts ...grpc.CallOption) (*Response, error) { - cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...) - out := new(Response) - err := c.cc.Invoke(ctx, ModelBaseServiceV2_Count_FullMethodName, in, out, cOpts...) - if err != nil { - return nil, err - } - return out, nil -} - -// ModelBaseServiceV2Server is the server API for ModelBaseServiceV2 service. -// All implementations must embed UnimplementedModelBaseServiceV2Server -// for forward compatibility -type ModelBaseServiceV2Server interface { - GetById(context.Context, *ModelServiceV2GetByIdRequest) (*Response, error) - GetOne(context.Context, *ModelServiceV2GetOneRequest) (*Response, error) - GetMany(context.Context, *ModelServiceV2GetManyRequest) (*Response, error) - DeleteById(context.Context, *ModelServiceV2DeleteByIdRequest) (*Response, error) - DeleteOne(context.Context, *ModelServiceV2DeleteOneRequest) (*Response, error) - DeleteMany(context.Context, *ModelServiceV2DeleteManyRequest) (*Response, error) - UpdateById(context.Context, *ModelServiceV2UpdateByIdRequest) (*Response, error) - UpdateOne(context.Context, *ModelServiceV2UpdateOneRequest) (*Response, error) - UpdateMany(context.Context, *ModelServiceV2UpdateManyRequest) (*Response, error) - ReplaceById(context.Context, *ModelServiceV2ReplaceByIdRequest) (*Response, error) - ReplaceOne(context.Context, *ModelServiceV2ReplaceOneRequest) (*Response, error) - InsertOne(context.Context, *ModelServiceV2InsertOneRequest) (*Response, error) - InsertMany(context.Context, *ModelServiceV2InsertManyRequest) (*Response, error) - Count(context.Context, *ModelServiceV2CountRequest) (*Response, error) - mustEmbedUnimplementedModelBaseServiceV2Server() -} - -// UnimplementedModelBaseServiceV2Server must be embedded to have forward compatible implementations. -type UnimplementedModelBaseServiceV2Server struct { -} - -func (UnimplementedModelBaseServiceV2Server) GetById(context.Context, *ModelServiceV2GetByIdRequest) (*Response, error) { - return nil, status.Errorf(codes.Unimplemented, "method GetById not implemented") -} -func (UnimplementedModelBaseServiceV2Server) GetOne(context.Context, *ModelServiceV2GetOneRequest) (*Response, error) { - return nil, status.Errorf(codes.Unimplemented, "method GetOne not implemented") -} -func (UnimplementedModelBaseServiceV2Server) GetMany(context.Context, *ModelServiceV2GetManyRequest) (*Response, error) { - return nil, status.Errorf(codes.Unimplemented, "method GetMany not implemented") -} -func (UnimplementedModelBaseServiceV2Server) DeleteById(context.Context, *ModelServiceV2DeleteByIdRequest) (*Response, error) { - return nil, status.Errorf(codes.Unimplemented, "method DeleteById not implemented") -} -func (UnimplementedModelBaseServiceV2Server) DeleteOne(context.Context, *ModelServiceV2DeleteOneRequest) (*Response, error) { - return nil, status.Errorf(codes.Unimplemented, "method DeleteOne not implemented") -} -func (UnimplementedModelBaseServiceV2Server) DeleteMany(context.Context, *ModelServiceV2DeleteManyRequest) (*Response, error) { - return nil, status.Errorf(codes.Unimplemented, "method DeleteMany not implemented") -} -func (UnimplementedModelBaseServiceV2Server) UpdateById(context.Context, *ModelServiceV2UpdateByIdRequest) (*Response, error) { - return nil, status.Errorf(codes.Unimplemented, "method UpdateById not implemented") -} -func (UnimplementedModelBaseServiceV2Server) UpdateOne(context.Context, *ModelServiceV2UpdateOneRequest) (*Response, error) { - return nil, status.Errorf(codes.Unimplemented, "method UpdateOne not implemented") -} -func (UnimplementedModelBaseServiceV2Server) UpdateMany(context.Context, *ModelServiceV2UpdateManyRequest) (*Response, error) { - return nil, status.Errorf(codes.Unimplemented, "method UpdateMany not implemented") -} -func (UnimplementedModelBaseServiceV2Server) ReplaceById(context.Context, *ModelServiceV2ReplaceByIdRequest) (*Response, error) { - return nil, status.Errorf(codes.Unimplemented, "method ReplaceById not implemented") -} -func (UnimplementedModelBaseServiceV2Server) ReplaceOne(context.Context, *ModelServiceV2ReplaceOneRequest) (*Response, error) { - return nil, status.Errorf(codes.Unimplemented, "method ReplaceOne not implemented") -} -func (UnimplementedModelBaseServiceV2Server) InsertOne(context.Context, *ModelServiceV2InsertOneRequest) (*Response, error) { - return nil, status.Errorf(codes.Unimplemented, "method InsertOne not implemented") -} -func (UnimplementedModelBaseServiceV2Server) InsertMany(context.Context, *ModelServiceV2InsertManyRequest) (*Response, error) { - return nil, status.Errorf(codes.Unimplemented, "method InsertMany not implemented") -} -func (UnimplementedModelBaseServiceV2Server) Count(context.Context, *ModelServiceV2CountRequest) (*Response, error) { - return nil, status.Errorf(codes.Unimplemented, "method Count not implemented") -} -func (UnimplementedModelBaseServiceV2Server) mustEmbedUnimplementedModelBaseServiceV2Server() {} - -// UnsafeModelBaseServiceV2Server may be embedded to opt out of forward compatibility for this service. -// Use of this interface is not recommended, as added methods to ModelBaseServiceV2Server will -// result in compilation errors. -type UnsafeModelBaseServiceV2Server interface { - mustEmbedUnimplementedModelBaseServiceV2Server() -} - -func RegisterModelBaseServiceV2Server(s grpc.ServiceRegistrar, srv ModelBaseServiceV2Server) { - s.RegisterService(&ModelBaseServiceV2_ServiceDesc, srv) -} - -func _ModelBaseServiceV2_GetById_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { - in := new(ModelServiceV2GetByIdRequest) - if err := dec(in); err != nil { - return nil, err - } - if interceptor == nil { - return srv.(ModelBaseServiceV2Server).GetById(ctx, in) - } - info := &grpc.UnaryServerInfo{ - Server: srv, - FullMethod: ModelBaseServiceV2_GetById_FullMethodName, - } - handler := func(ctx context.Context, req interface{}) (interface{}, error) { - return srv.(ModelBaseServiceV2Server).GetById(ctx, req.(*ModelServiceV2GetByIdRequest)) - } - return interceptor(ctx, in, info, handler) -} - -func _ModelBaseServiceV2_GetOne_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { - in := new(ModelServiceV2GetOneRequest) - if err := dec(in); err != nil { - return nil, err - } - if interceptor == nil { - return srv.(ModelBaseServiceV2Server).GetOne(ctx, in) - } - info := &grpc.UnaryServerInfo{ - Server: srv, - FullMethod: ModelBaseServiceV2_GetOne_FullMethodName, - } - handler := func(ctx context.Context, req interface{}) (interface{}, error) { - return srv.(ModelBaseServiceV2Server).GetOne(ctx, req.(*ModelServiceV2GetOneRequest)) - } - return interceptor(ctx, in, info, handler) -} - -func _ModelBaseServiceV2_GetMany_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { - in := new(ModelServiceV2GetManyRequest) - if err := dec(in); err != nil { - return nil, err - } - if interceptor == nil { - return srv.(ModelBaseServiceV2Server).GetMany(ctx, in) - } - info := &grpc.UnaryServerInfo{ - Server: srv, - FullMethod: ModelBaseServiceV2_GetMany_FullMethodName, - } - handler := func(ctx context.Context, req interface{}) (interface{}, error) { - return srv.(ModelBaseServiceV2Server).GetMany(ctx, req.(*ModelServiceV2GetManyRequest)) - } - return interceptor(ctx, in, info, handler) -} - -func _ModelBaseServiceV2_DeleteById_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { - in := new(ModelServiceV2DeleteByIdRequest) - if err := dec(in); err != nil { - return nil, err - } - if interceptor == nil { - return srv.(ModelBaseServiceV2Server).DeleteById(ctx, in) - } - info := &grpc.UnaryServerInfo{ - Server: srv, - FullMethod: ModelBaseServiceV2_DeleteById_FullMethodName, - } - handler := func(ctx context.Context, req interface{}) (interface{}, error) { - return srv.(ModelBaseServiceV2Server).DeleteById(ctx, req.(*ModelServiceV2DeleteByIdRequest)) - } - return interceptor(ctx, in, info, handler) -} - -func _ModelBaseServiceV2_DeleteOne_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { - in := new(ModelServiceV2DeleteOneRequest) - if err := dec(in); err != nil { - return nil, err - } - if interceptor == nil { - return srv.(ModelBaseServiceV2Server).DeleteOne(ctx, in) - } - info := &grpc.UnaryServerInfo{ - Server: srv, - FullMethod: ModelBaseServiceV2_DeleteOne_FullMethodName, - } - handler := func(ctx context.Context, req interface{}) (interface{}, error) { - return srv.(ModelBaseServiceV2Server).DeleteOne(ctx, req.(*ModelServiceV2DeleteOneRequest)) - } - return interceptor(ctx, in, info, handler) -} - -func _ModelBaseServiceV2_DeleteMany_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { - in := new(ModelServiceV2DeleteManyRequest) - if err := dec(in); err != nil { - return nil, err - } - if interceptor == nil { - return srv.(ModelBaseServiceV2Server).DeleteMany(ctx, in) - } - info := &grpc.UnaryServerInfo{ - Server: srv, - FullMethod: ModelBaseServiceV2_DeleteMany_FullMethodName, - } - handler := func(ctx context.Context, req interface{}) (interface{}, error) { - return srv.(ModelBaseServiceV2Server).DeleteMany(ctx, req.(*ModelServiceV2DeleteManyRequest)) - } - return interceptor(ctx, in, info, handler) -} - -func _ModelBaseServiceV2_UpdateById_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { - in := new(ModelServiceV2UpdateByIdRequest) - if err := dec(in); err != nil { - return nil, err - } - if interceptor == nil { - return srv.(ModelBaseServiceV2Server).UpdateById(ctx, in) - } - info := &grpc.UnaryServerInfo{ - Server: srv, - FullMethod: ModelBaseServiceV2_UpdateById_FullMethodName, - } - handler := func(ctx context.Context, req interface{}) (interface{}, error) { - return srv.(ModelBaseServiceV2Server).UpdateById(ctx, req.(*ModelServiceV2UpdateByIdRequest)) - } - return interceptor(ctx, in, info, handler) -} - -func _ModelBaseServiceV2_UpdateOne_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { - in := new(ModelServiceV2UpdateOneRequest) - if err := dec(in); err != nil { - return nil, err - } - if interceptor == nil { - return srv.(ModelBaseServiceV2Server).UpdateOne(ctx, in) - } - info := &grpc.UnaryServerInfo{ - Server: srv, - FullMethod: ModelBaseServiceV2_UpdateOne_FullMethodName, - } - handler := func(ctx context.Context, req interface{}) (interface{}, error) { - return srv.(ModelBaseServiceV2Server).UpdateOne(ctx, req.(*ModelServiceV2UpdateOneRequest)) - } - return interceptor(ctx, in, info, handler) -} - -func _ModelBaseServiceV2_UpdateMany_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { - in := new(ModelServiceV2UpdateManyRequest) - if err := dec(in); err != nil { - return nil, err - } - if interceptor == nil { - return srv.(ModelBaseServiceV2Server).UpdateMany(ctx, in) - } - info := &grpc.UnaryServerInfo{ - Server: srv, - FullMethod: ModelBaseServiceV2_UpdateMany_FullMethodName, - } - handler := func(ctx context.Context, req interface{}) (interface{}, error) { - return srv.(ModelBaseServiceV2Server).UpdateMany(ctx, req.(*ModelServiceV2UpdateManyRequest)) - } - return interceptor(ctx, in, info, handler) -} - -func _ModelBaseServiceV2_ReplaceById_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { - in := new(ModelServiceV2ReplaceByIdRequest) - if err := dec(in); err != nil { - return nil, err - } - if interceptor == nil { - return srv.(ModelBaseServiceV2Server).ReplaceById(ctx, in) - } - info := &grpc.UnaryServerInfo{ - Server: srv, - FullMethod: ModelBaseServiceV2_ReplaceById_FullMethodName, - } - handler := func(ctx context.Context, req interface{}) (interface{}, error) { - return srv.(ModelBaseServiceV2Server).ReplaceById(ctx, req.(*ModelServiceV2ReplaceByIdRequest)) - } - return interceptor(ctx, in, info, handler) -} - -func _ModelBaseServiceV2_ReplaceOne_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { - in := new(ModelServiceV2ReplaceOneRequest) - if err := dec(in); err != nil { - return nil, err - } - if interceptor == nil { - return srv.(ModelBaseServiceV2Server).ReplaceOne(ctx, in) - } - info := &grpc.UnaryServerInfo{ - Server: srv, - FullMethod: ModelBaseServiceV2_ReplaceOne_FullMethodName, - } - handler := func(ctx context.Context, req interface{}) (interface{}, error) { - return srv.(ModelBaseServiceV2Server).ReplaceOne(ctx, req.(*ModelServiceV2ReplaceOneRequest)) - } - return interceptor(ctx, in, info, handler) -} - -func _ModelBaseServiceV2_InsertOne_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { - in := new(ModelServiceV2InsertOneRequest) - if err := dec(in); err != nil { - return nil, err - } - if interceptor == nil { - return srv.(ModelBaseServiceV2Server).InsertOne(ctx, in) - } - info := &grpc.UnaryServerInfo{ - Server: srv, - FullMethod: ModelBaseServiceV2_InsertOne_FullMethodName, - } - handler := func(ctx context.Context, req interface{}) (interface{}, error) { - return srv.(ModelBaseServiceV2Server).InsertOne(ctx, req.(*ModelServiceV2InsertOneRequest)) - } - return interceptor(ctx, in, info, handler) -} - -func _ModelBaseServiceV2_InsertMany_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { - in := new(ModelServiceV2InsertManyRequest) - if err := dec(in); err != nil { - return nil, err - } - if interceptor == nil { - return srv.(ModelBaseServiceV2Server).InsertMany(ctx, in) - } - info := &grpc.UnaryServerInfo{ - Server: srv, - FullMethod: ModelBaseServiceV2_InsertMany_FullMethodName, - } - handler := func(ctx context.Context, req interface{}) (interface{}, error) { - return srv.(ModelBaseServiceV2Server).InsertMany(ctx, req.(*ModelServiceV2InsertManyRequest)) - } - return interceptor(ctx, in, info, handler) -} - -func _ModelBaseServiceV2_Count_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { - in := new(ModelServiceV2CountRequest) - if err := dec(in); err != nil { - return nil, err - } - if interceptor == nil { - return srv.(ModelBaseServiceV2Server).Count(ctx, in) - } - info := &grpc.UnaryServerInfo{ - Server: srv, - FullMethod: ModelBaseServiceV2_Count_FullMethodName, - } - handler := func(ctx context.Context, req interface{}) (interface{}, error) { - return srv.(ModelBaseServiceV2Server).Count(ctx, req.(*ModelServiceV2CountRequest)) - } - return interceptor(ctx, in, info, handler) -} - -// ModelBaseServiceV2_ServiceDesc is the grpc.ServiceDesc for ModelBaseServiceV2 service. -// It's only intended for direct use with grpc.RegisterService, -// and not to be introspected or modified (even as a copy) -var ModelBaseServiceV2_ServiceDesc = grpc.ServiceDesc{ - ServiceName: "grpc.ModelBaseServiceV2", - HandlerType: (*ModelBaseServiceV2Server)(nil), - Methods: []grpc.MethodDesc{ - { - MethodName: "GetById", - Handler: _ModelBaseServiceV2_GetById_Handler, - }, - { - MethodName: "GetOne", - Handler: _ModelBaseServiceV2_GetOne_Handler, - }, - { - MethodName: "GetMany", - Handler: _ModelBaseServiceV2_GetMany_Handler, - }, - { - MethodName: "DeleteById", - Handler: _ModelBaseServiceV2_DeleteById_Handler, - }, - { - MethodName: "DeleteOne", - Handler: _ModelBaseServiceV2_DeleteOne_Handler, - }, - { - MethodName: "DeleteMany", - Handler: _ModelBaseServiceV2_DeleteMany_Handler, - }, - { - MethodName: "UpdateById", - Handler: _ModelBaseServiceV2_UpdateById_Handler, - }, - { - MethodName: "UpdateOne", - Handler: _ModelBaseServiceV2_UpdateOne_Handler, - }, - { - MethodName: "UpdateMany", - Handler: _ModelBaseServiceV2_UpdateMany_Handler, - }, - { - MethodName: "ReplaceById", - Handler: _ModelBaseServiceV2_ReplaceById_Handler, - }, - { - MethodName: "ReplaceOne", - Handler: _ModelBaseServiceV2_ReplaceOne_Handler, - }, - { - MethodName: "InsertOne", - Handler: _ModelBaseServiceV2_InsertOne_Handler, - }, - { - MethodName: "InsertMany", - Handler: _ModelBaseServiceV2_InsertMany_Handler, - }, - { - MethodName: "Count", - Handler: _ModelBaseServiceV2_Count_Handler, - }, - }, - Streams: []grpc.StreamDesc{}, - Metadata: "services/model_base_service_v2.proto", -} diff --git a/grpc/model_service_request.pb.go b/grpc/model_service_request.pb.go new file mode 100644 index 00000000..40616c56 --- /dev/null +++ b/grpc/model_service_request.pb.go @@ -0,0 +1,1309 @@ +// Code generated by protoc-gen-go. DO NOT EDIT. +// versions: +// protoc-gen-go v1.34.2 +// protoc v5.27.2 +// source: entity/model_service_request.proto + +package grpc + +import ( + protoreflect "google.golang.org/protobuf/reflect/protoreflect" + protoimpl "google.golang.org/protobuf/runtime/protoimpl" + reflect "reflect" + sync "sync" +) + +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) +) + +type ModelServiceGetByIdRequest struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + NodeKey string `protobuf:"bytes,1,opt,name=node_key,json=nodeKey,proto3" json:"node_key,omitempty"` + ModelType string `protobuf:"bytes,2,opt,name=model_type,json=modelType,proto3" json:"model_type,omitempty"` + Id string `protobuf:"bytes,3,opt,name=id,proto3" json:"id,omitempty"` +} + +func (x *ModelServiceGetByIdRequest) Reset() { + *x = ModelServiceGetByIdRequest{} + if protoimpl.UnsafeEnabled { + mi := &file_entity_model_service_request_proto_msgTypes[0] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *ModelServiceGetByIdRequest) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*ModelServiceGetByIdRequest) ProtoMessage() {} + +func (x *ModelServiceGetByIdRequest) ProtoReflect() protoreflect.Message { + mi := &file_entity_model_service_request_proto_msgTypes[0] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use ModelServiceGetByIdRequest.ProtoReflect.Descriptor instead. +func (*ModelServiceGetByIdRequest) Descriptor() ([]byte, []int) { + return file_entity_model_service_request_proto_rawDescGZIP(), []int{0} +} + +func (x *ModelServiceGetByIdRequest) GetNodeKey() string { + if x != nil { + return x.NodeKey + } + return "" +} + +func (x *ModelServiceGetByIdRequest) GetModelType() string { + if x != nil { + return x.ModelType + } + return "" +} + +func (x *ModelServiceGetByIdRequest) GetId() string { + if x != nil { + return x.Id + } + return "" +} + +type ModelServiceGetOneRequest struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + NodeKey string `protobuf:"bytes,1,opt,name=node_key,json=nodeKey,proto3" json:"node_key,omitempty"` + ModelType string `protobuf:"bytes,2,opt,name=model_type,json=modelType,proto3" json:"model_type,omitempty"` + Query []byte `protobuf:"bytes,3,opt,name=query,proto3" json:"query,omitempty"` + FindOptions []byte `protobuf:"bytes,4,opt,name=find_options,json=findOptions,proto3" json:"find_options,omitempty"` +} + +func (x *ModelServiceGetOneRequest) Reset() { + *x = ModelServiceGetOneRequest{} + if protoimpl.UnsafeEnabled { + mi := &file_entity_model_service_request_proto_msgTypes[1] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *ModelServiceGetOneRequest) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*ModelServiceGetOneRequest) ProtoMessage() {} + +func (x *ModelServiceGetOneRequest) ProtoReflect() protoreflect.Message { + mi := &file_entity_model_service_request_proto_msgTypes[1] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use ModelServiceGetOneRequest.ProtoReflect.Descriptor instead. +func (*ModelServiceGetOneRequest) Descriptor() ([]byte, []int) { + return file_entity_model_service_request_proto_rawDescGZIP(), []int{1} +} + +func (x *ModelServiceGetOneRequest) GetNodeKey() string { + if x != nil { + return x.NodeKey + } + return "" +} + +func (x *ModelServiceGetOneRequest) GetModelType() string { + if x != nil { + return x.ModelType + } + return "" +} + +func (x *ModelServiceGetOneRequest) GetQuery() []byte { + if x != nil { + return x.Query + } + return nil +} + +func (x *ModelServiceGetOneRequest) GetFindOptions() []byte { + if x != nil { + return x.FindOptions + } + return nil +} + +type ModelServiceGetManyRequest struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + NodeKey string `protobuf:"bytes,1,opt,name=node_key,json=nodeKey,proto3" json:"node_key,omitempty"` + ModelType string `protobuf:"bytes,2,opt,name=model_type,json=modelType,proto3" json:"model_type,omitempty"` + Query []byte `protobuf:"bytes,3,opt,name=query,proto3" json:"query,omitempty"` + FindOptions []byte `protobuf:"bytes,4,opt,name=find_options,json=findOptions,proto3" json:"find_options,omitempty"` +} + +func (x *ModelServiceGetManyRequest) Reset() { + *x = ModelServiceGetManyRequest{} + if protoimpl.UnsafeEnabled { + mi := &file_entity_model_service_request_proto_msgTypes[2] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *ModelServiceGetManyRequest) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*ModelServiceGetManyRequest) ProtoMessage() {} + +func (x *ModelServiceGetManyRequest) ProtoReflect() protoreflect.Message { + mi := &file_entity_model_service_request_proto_msgTypes[2] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use ModelServiceGetManyRequest.ProtoReflect.Descriptor instead. +func (*ModelServiceGetManyRequest) Descriptor() ([]byte, []int) { + return file_entity_model_service_request_proto_rawDescGZIP(), []int{2} +} + +func (x *ModelServiceGetManyRequest) GetNodeKey() string { + if x != nil { + return x.NodeKey + } + return "" +} + +func (x *ModelServiceGetManyRequest) GetModelType() string { + if x != nil { + return x.ModelType + } + return "" +} + +func (x *ModelServiceGetManyRequest) GetQuery() []byte { + if x != nil { + return x.Query + } + return nil +} + +func (x *ModelServiceGetManyRequest) GetFindOptions() []byte { + if x != nil { + return x.FindOptions + } + return nil +} + +type ModelServiceDeleteByIdRequest struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + NodeKey string `protobuf:"bytes,1,opt,name=node_key,json=nodeKey,proto3" json:"node_key,omitempty"` + ModelType string `protobuf:"bytes,2,opt,name=model_type,json=modelType,proto3" json:"model_type,omitempty"` + Id string `protobuf:"bytes,3,opt,name=id,proto3" json:"id,omitempty"` +} + +func (x *ModelServiceDeleteByIdRequest) Reset() { + *x = ModelServiceDeleteByIdRequest{} + if protoimpl.UnsafeEnabled { + mi := &file_entity_model_service_request_proto_msgTypes[3] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *ModelServiceDeleteByIdRequest) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*ModelServiceDeleteByIdRequest) ProtoMessage() {} + +func (x *ModelServiceDeleteByIdRequest) ProtoReflect() protoreflect.Message { + mi := &file_entity_model_service_request_proto_msgTypes[3] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use ModelServiceDeleteByIdRequest.ProtoReflect.Descriptor instead. +func (*ModelServiceDeleteByIdRequest) Descriptor() ([]byte, []int) { + return file_entity_model_service_request_proto_rawDescGZIP(), []int{3} +} + +func (x *ModelServiceDeleteByIdRequest) GetNodeKey() string { + if x != nil { + return x.NodeKey + } + return "" +} + +func (x *ModelServiceDeleteByIdRequest) GetModelType() string { + if x != nil { + return x.ModelType + } + return "" +} + +func (x *ModelServiceDeleteByIdRequest) GetId() string { + if x != nil { + return x.Id + } + return "" +} + +type ModelServiceDeleteOneRequest struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + NodeKey string `protobuf:"bytes,1,opt,name=node_key,json=nodeKey,proto3" json:"node_key,omitempty"` + ModelType string `protobuf:"bytes,2,opt,name=model_type,json=modelType,proto3" json:"model_type,omitempty"` + Query []byte `protobuf:"bytes,3,opt,name=query,proto3" json:"query,omitempty"` +} + +func (x *ModelServiceDeleteOneRequest) Reset() { + *x = ModelServiceDeleteOneRequest{} + if protoimpl.UnsafeEnabled { + mi := &file_entity_model_service_request_proto_msgTypes[4] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *ModelServiceDeleteOneRequest) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*ModelServiceDeleteOneRequest) ProtoMessage() {} + +func (x *ModelServiceDeleteOneRequest) ProtoReflect() protoreflect.Message { + mi := &file_entity_model_service_request_proto_msgTypes[4] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use ModelServiceDeleteOneRequest.ProtoReflect.Descriptor instead. +func (*ModelServiceDeleteOneRequest) Descriptor() ([]byte, []int) { + return file_entity_model_service_request_proto_rawDescGZIP(), []int{4} +} + +func (x *ModelServiceDeleteOneRequest) GetNodeKey() string { + if x != nil { + return x.NodeKey + } + return "" +} + +func (x *ModelServiceDeleteOneRequest) GetModelType() string { + if x != nil { + return x.ModelType + } + return "" +} + +func (x *ModelServiceDeleteOneRequest) GetQuery() []byte { + if x != nil { + return x.Query + } + return nil +} + +type ModelServiceDeleteManyRequest struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + NodeKey string `protobuf:"bytes,1,opt,name=node_key,json=nodeKey,proto3" json:"node_key,omitempty"` + ModelType string `protobuf:"bytes,2,opt,name=model_type,json=modelType,proto3" json:"model_type,omitempty"` + Query []byte `protobuf:"bytes,3,opt,name=query,proto3" json:"query,omitempty"` +} + +func (x *ModelServiceDeleteManyRequest) Reset() { + *x = ModelServiceDeleteManyRequest{} + if protoimpl.UnsafeEnabled { + mi := &file_entity_model_service_request_proto_msgTypes[5] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *ModelServiceDeleteManyRequest) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*ModelServiceDeleteManyRequest) ProtoMessage() {} + +func (x *ModelServiceDeleteManyRequest) ProtoReflect() protoreflect.Message { + mi := &file_entity_model_service_request_proto_msgTypes[5] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use ModelServiceDeleteManyRequest.ProtoReflect.Descriptor instead. +func (*ModelServiceDeleteManyRequest) Descriptor() ([]byte, []int) { + return file_entity_model_service_request_proto_rawDescGZIP(), []int{5} +} + +func (x *ModelServiceDeleteManyRequest) GetNodeKey() string { + if x != nil { + return x.NodeKey + } + return "" +} + +func (x *ModelServiceDeleteManyRequest) GetModelType() string { + if x != nil { + return x.ModelType + } + return "" +} + +func (x *ModelServiceDeleteManyRequest) GetQuery() []byte { + if x != nil { + return x.Query + } + return nil +} + +type ModelServiceUpdateByIdRequest struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + NodeKey string `protobuf:"bytes,1,opt,name=node_key,json=nodeKey,proto3" json:"node_key,omitempty"` + ModelType string `protobuf:"bytes,2,opt,name=model_type,json=modelType,proto3" json:"model_type,omitempty"` + Id string `protobuf:"bytes,3,opt,name=id,proto3" json:"id,omitempty"` + Update []byte `protobuf:"bytes,4,opt,name=update,proto3" json:"update,omitempty"` +} + +func (x *ModelServiceUpdateByIdRequest) Reset() { + *x = ModelServiceUpdateByIdRequest{} + if protoimpl.UnsafeEnabled { + mi := &file_entity_model_service_request_proto_msgTypes[6] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *ModelServiceUpdateByIdRequest) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*ModelServiceUpdateByIdRequest) ProtoMessage() {} + +func (x *ModelServiceUpdateByIdRequest) ProtoReflect() protoreflect.Message { + mi := &file_entity_model_service_request_proto_msgTypes[6] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use ModelServiceUpdateByIdRequest.ProtoReflect.Descriptor instead. +func (*ModelServiceUpdateByIdRequest) Descriptor() ([]byte, []int) { + return file_entity_model_service_request_proto_rawDescGZIP(), []int{6} +} + +func (x *ModelServiceUpdateByIdRequest) GetNodeKey() string { + if x != nil { + return x.NodeKey + } + return "" +} + +func (x *ModelServiceUpdateByIdRequest) GetModelType() string { + if x != nil { + return x.ModelType + } + return "" +} + +func (x *ModelServiceUpdateByIdRequest) GetId() string { + if x != nil { + return x.Id + } + return "" +} + +func (x *ModelServiceUpdateByIdRequest) GetUpdate() []byte { + if x != nil { + return x.Update + } + return nil +} + +type ModelServiceUpdateOneRequest struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + NodeKey string `protobuf:"bytes,1,opt,name=node_key,json=nodeKey,proto3" json:"node_key,omitempty"` + ModelType string `protobuf:"bytes,2,opt,name=model_type,json=modelType,proto3" json:"model_type,omitempty"` + Query []byte `protobuf:"bytes,3,opt,name=query,proto3" json:"query,omitempty"` + Update []byte `protobuf:"bytes,4,opt,name=update,proto3" json:"update,omitempty"` +} + +func (x *ModelServiceUpdateOneRequest) Reset() { + *x = ModelServiceUpdateOneRequest{} + if protoimpl.UnsafeEnabled { + mi := &file_entity_model_service_request_proto_msgTypes[7] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *ModelServiceUpdateOneRequest) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*ModelServiceUpdateOneRequest) ProtoMessage() {} + +func (x *ModelServiceUpdateOneRequest) ProtoReflect() protoreflect.Message { + mi := &file_entity_model_service_request_proto_msgTypes[7] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use ModelServiceUpdateOneRequest.ProtoReflect.Descriptor instead. +func (*ModelServiceUpdateOneRequest) Descriptor() ([]byte, []int) { + return file_entity_model_service_request_proto_rawDescGZIP(), []int{7} +} + +func (x *ModelServiceUpdateOneRequest) GetNodeKey() string { + if x != nil { + return x.NodeKey + } + return "" +} + +func (x *ModelServiceUpdateOneRequest) GetModelType() string { + if x != nil { + return x.ModelType + } + return "" +} + +func (x *ModelServiceUpdateOneRequest) GetQuery() []byte { + if x != nil { + return x.Query + } + return nil +} + +func (x *ModelServiceUpdateOneRequest) GetUpdate() []byte { + if x != nil { + return x.Update + } + return nil +} + +type ModelServiceUpdateManyRequest struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + NodeKey string `protobuf:"bytes,1,opt,name=node_key,json=nodeKey,proto3" json:"node_key,omitempty"` + ModelType string `protobuf:"bytes,2,opt,name=model_type,json=modelType,proto3" json:"model_type,omitempty"` + Query []byte `protobuf:"bytes,3,opt,name=query,proto3" json:"query,omitempty"` + Update []byte `protobuf:"bytes,4,opt,name=update,proto3" json:"update,omitempty"` +} + +func (x *ModelServiceUpdateManyRequest) Reset() { + *x = ModelServiceUpdateManyRequest{} + if protoimpl.UnsafeEnabled { + mi := &file_entity_model_service_request_proto_msgTypes[8] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *ModelServiceUpdateManyRequest) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*ModelServiceUpdateManyRequest) ProtoMessage() {} + +func (x *ModelServiceUpdateManyRequest) ProtoReflect() protoreflect.Message { + mi := &file_entity_model_service_request_proto_msgTypes[8] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use ModelServiceUpdateManyRequest.ProtoReflect.Descriptor instead. +func (*ModelServiceUpdateManyRequest) Descriptor() ([]byte, []int) { + return file_entity_model_service_request_proto_rawDescGZIP(), []int{8} +} + +func (x *ModelServiceUpdateManyRequest) GetNodeKey() string { + if x != nil { + return x.NodeKey + } + return "" +} + +func (x *ModelServiceUpdateManyRequest) GetModelType() string { + if x != nil { + return x.ModelType + } + return "" +} + +func (x *ModelServiceUpdateManyRequest) GetQuery() []byte { + if x != nil { + return x.Query + } + return nil +} + +func (x *ModelServiceUpdateManyRequest) GetUpdate() []byte { + if x != nil { + return x.Update + } + return nil +} + +type ModelServiceReplaceByIdRequest struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + NodeKey string `protobuf:"bytes,1,opt,name=node_key,json=nodeKey,proto3" json:"node_key,omitempty"` + ModelType string `protobuf:"bytes,2,opt,name=model_type,json=modelType,proto3" json:"model_type,omitempty"` + Id string `protobuf:"bytes,3,opt,name=id,proto3" json:"id,omitempty"` + Model []byte `protobuf:"bytes,4,opt,name=model,proto3" json:"model,omitempty"` +} + +func (x *ModelServiceReplaceByIdRequest) Reset() { + *x = ModelServiceReplaceByIdRequest{} + if protoimpl.UnsafeEnabled { + mi := &file_entity_model_service_request_proto_msgTypes[9] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *ModelServiceReplaceByIdRequest) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*ModelServiceReplaceByIdRequest) ProtoMessage() {} + +func (x *ModelServiceReplaceByIdRequest) ProtoReflect() protoreflect.Message { + mi := &file_entity_model_service_request_proto_msgTypes[9] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use ModelServiceReplaceByIdRequest.ProtoReflect.Descriptor instead. +func (*ModelServiceReplaceByIdRequest) Descriptor() ([]byte, []int) { + return file_entity_model_service_request_proto_rawDescGZIP(), []int{9} +} + +func (x *ModelServiceReplaceByIdRequest) GetNodeKey() string { + if x != nil { + return x.NodeKey + } + return "" +} + +func (x *ModelServiceReplaceByIdRequest) GetModelType() string { + if x != nil { + return x.ModelType + } + return "" +} + +func (x *ModelServiceReplaceByIdRequest) GetId() string { + if x != nil { + return x.Id + } + return "" +} + +func (x *ModelServiceReplaceByIdRequest) GetModel() []byte { + if x != nil { + return x.Model + } + return nil +} + +type ModelServiceReplaceOneRequest struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + NodeKey string `protobuf:"bytes,1,opt,name=node_key,json=nodeKey,proto3" json:"node_key,omitempty"` + ModelType string `protobuf:"bytes,2,opt,name=model_type,json=modelType,proto3" json:"model_type,omitempty"` + Query []byte `protobuf:"bytes,3,opt,name=query,proto3" json:"query,omitempty"` + Model []byte `protobuf:"bytes,4,opt,name=model,proto3" json:"model,omitempty"` +} + +func (x *ModelServiceReplaceOneRequest) Reset() { + *x = ModelServiceReplaceOneRequest{} + if protoimpl.UnsafeEnabled { + mi := &file_entity_model_service_request_proto_msgTypes[10] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *ModelServiceReplaceOneRequest) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*ModelServiceReplaceOneRequest) ProtoMessage() {} + +func (x *ModelServiceReplaceOneRequest) ProtoReflect() protoreflect.Message { + mi := &file_entity_model_service_request_proto_msgTypes[10] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use ModelServiceReplaceOneRequest.ProtoReflect.Descriptor instead. +func (*ModelServiceReplaceOneRequest) Descriptor() ([]byte, []int) { + return file_entity_model_service_request_proto_rawDescGZIP(), []int{10} +} + +func (x *ModelServiceReplaceOneRequest) GetNodeKey() string { + if x != nil { + return x.NodeKey + } + return "" +} + +func (x *ModelServiceReplaceOneRequest) GetModelType() string { + if x != nil { + return x.ModelType + } + return "" +} + +func (x *ModelServiceReplaceOneRequest) GetQuery() []byte { + if x != nil { + return x.Query + } + return nil +} + +func (x *ModelServiceReplaceOneRequest) GetModel() []byte { + if x != nil { + return x.Model + } + return nil +} + +type ModelServiceInsertOneRequest struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + NodeKey string `protobuf:"bytes,1,opt,name=node_key,json=nodeKey,proto3" json:"node_key,omitempty"` + ModelType string `protobuf:"bytes,2,opt,name=model_type,json=modelType,proto3" json:"model_type,omitempty"` + Model []byte `protobuf:"bytes,3,opt,name=model,proto3" json:"model,omitempty"` +} + +func (x *ModelServiceInsertOneRequest) Reset() { + *x = ModelServiceInsertOneRequest{} + if protoimpl.UnsafeEnabled { + mi := &file_entity_model_service_request_proto_msgTypes[11] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *ModelServiceInsertOneRequest) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*ModelServiceInsertOneRequest) ProtoMessage() {} + +func (x *ModelServiceInsertOneRequest) ProtoReflect() protoreflect.Message { + mi := &file_entity_model_service_request_proto_msgTypes[11] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use ModelServiceInsertOneRequest.ProtoReflect.Descriptor instead. +func (*ModelServiceInsertOneRequest) Descriptor() ([]byte, []int) { + return file_entity_model_service_request_proto_rawDescGZIP(), []int{11} +} + +func (x *ModelServiceInsertOneRequest) GetNodeKey() string { + if x != nil { + return x.NodeKey + } + return "" +} + +func (x *ModelServiceInsertOneRequest) GetModelType() string { + if x != nil { + return x.ModelType + } + return "" +} + +func (x *ModelServiceInsertOneRequest) GetModel() []byte { + if x != nil { + return x.Model + } + return nil +} + +type ModelServiceInsertManyRequest struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + NodeKey string `protobuf:"bytes,1,opt,name=node_key,json=nodeKey,proto3" json:"node_key,omitempty"` + ModelType string `protobuf:"bytes,2,opt,name=model_type,json=modelType,proto3" json:"model_type,omitempty"` + Models []byte `protobuf:"bytes,3,opt,name=models,proto3" json:"models,omitempty"` +} + +func (x *ModelServiceInsertManyRequest) Reset() { + *x = ModelServiceInsertManyRequest{} + if protoimpl.UnsafeEnabled { + mi := &file_entity_model_service_request_proto_msgTypes[12] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *ModelServiceInsertManyRequest) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*ModelServiceInsertManyRequest) ProtoMessage() {} + +func (x *ModelServiceInsertManyRequest) ProtoReflect() protoreflect.Message { + mi := &file_entity_model_service_request_proto_msgTypes[12] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use ModelServiceInsertManyRequest.ProtoReflect.Descriptor instead. +func (*ModelServiceInsertManyRequest) Descriptor() ([]byte, []int) { + return file_entity_model_service_request_proto_rawDescGZIP(), []int{12} +} + +func (x *ModelServiceInsertManyRequest) GetNodeKey() string { + if x != nil { + return x.NodeKey + } + return "" +} + +func (x *ModelServiceInsertManyRequest) GetModelType() string { + if x != nil { + return x.ModelType + } + return "" +} + +func (x *ModelServiceInsertManyRequest) GetModels() []byte { + if x != nil { + return x.Models + } + return nil +} + +type ModelServiceCountRequest struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + NodeKey string `protobuf:"bytes,1,opt,name=node_key,json=nodeKey,proto3" json:"node_key,omitempty"` + ModelType string `protobuf:"bytes,2,opt,name=model_type,json=modelType,proto3" json:"model_type,omitempty"` + Query []byte `protobuf:"bytes,3,opt,name=query,proto3" json:"query,omitempty"` +} + +func (x *ModelServiceCountRequest) Reset() { + *x = ModelServiceCountRequest{} + if protoimpl.UnsafeEnabled { + mi := &file_entity_model_service_request_proto_msgTypes[13] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *ModelServiceCountRequest) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*ModelServiceCountRequest) ProtoMessage() {} + +func (x *ModelServiceCountRequest) ProtoReflect() protoreflect.Message { + mi := &file_entity_model_service_request_proto_msgTypes[13] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use ModelServiceCountRequest.ProtoReflect.Descriptor instead. +func (*ModelServiceCountRequest) Descriptor() ([]byte, []int) { + return file_entity_model_service_request_proto_rawDescGZIP(), []int{13} +} + +func (x *ModelServiceCountRequest) GetNodeKey() string { + if x != nil { + return x.NodeKey + } + return "" +} + +func (x *ModelServiceCountRequest) GetModelType() string { + if x != nil { + return x.ModelType + } + return "" +} + +func (x *ModelServiceCountRequest) GetQuery() []byte { + if x != nil { + return x.Query + } + return nil +} + +var File_entity_model_service_request_proto protoreflect.FileDescriptor + +var file_entity_model_service_request_proto_rawDesc = []byte{ + 0x0a, 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, 0x12, 0x04, 0x67, 0x72, 0x70, 0x63, 0x22, 0x66, 0x0a, 0x1a, 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, 0x12, 0x19, 0x0a, 0x08, 0x6e, 0x6f, 0x64, 0x65, + 0x5f, 0x6b, 0x65, 0x79, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x07, 0x6e, 0x6f, 0x64, 0x65, + 0x4b, 0x65, 0x79, 0x12, 0x1d, 0x0a, 0x0a, 0x6d, 0x6f, 0x64, 0x65, 0x6c, 0x5f, 0x74, 0x79, 0x70, + 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x09, 0x6d, 0x6f, 0x64, 0x65, 0x6c, 0x54, 0x79, + 0x70, 0x65, 0x12, 0x0e, 0x0a, 0x02, 0x69, 0x64, 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, 0x52, 0x02, + 0x69, 0x64, 0x22, 0x8e, 0x01, 0x0a, 0x19, 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, + 0x12, 0x19, 0x0a, 0x08, 0x6e, 0x6f, 0x64, 0x65, 0x5f, 0x6b, 0x65, 0x79, 0x18, 0x01, 0x20, 0x01, + 0x28, 0x09, 0x52, 0x07, 0x6e, 0x6f, 0x64, 0x65, 0x4b, 0x65, 0x79, 0x12, 0x1d, 0x0a, 0x0a, 0x6d, + 0x6f, 0x64, 0x65, 0x6c, 0x5f, 0x74, 0x79, 0x70, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, + 0x09, 0x6d, 0x6f, 0x64, 0x65, 0x6c, 0x54, 0x79, 0x70, 0x65, 0x12, 0x14, 0x0a, 0x05, 0x71, 0x75, + 0x65, 0x72, 0x79, 0x18, 0x03, 0x20, 0x01, 0x28, 0x0c, 0x52, 0x05, 0x71, 0x75, 0x65, 0x72, 0x79, + 0x12, 0x21, 0x0a, 0x0c, 0x66, 0x69, 0x6e, 0x64, 0x5f, 0x6f, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x73, + 0x18, 0x04, 0x20, 0x01, 0x28, 0x0c, 0x52, 0x0b, 0x66, 0x69, 0x6e, 0x64, 0x4f, 0x70, 0x74, 0x69, + 0x6f, 0x6e, 0x73, 0x22, 0x8f, 0x01, 0x0a, 0x1a, 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, 0x12, 0x19, 0x0a, 0x08, 0x6e, 0x6f, 0x64, 0x65, 0x5f, 0x6b, 0x65, 0x79, 0x18, 0x01, + 0x20, 0x01, 0x28, 0x09, 0x52, 0x07, 0x6e, 0x6f, 0x64, 0x65, 0x4b, 0x65, 0x79, 0x12, 0x1d, 0x0a, + 0x0a, 0x6d, 0x6f, 0x64, 0x65, 0x6c, 0x5f, 0x74, 0x79, 0x70, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, + 0x09, 0x52, 0x09, 0x6d, 0x6f, 0x64, 0x65, 0x6c, 0x54, 0x79, 0x70, 0x65, 0x12, 0x14, 0x0a, 0x05, + 0x71, 0x75, 0x65, 0x72, 0x79, 0x18, 0x03, 0x20, 0x01, 0x28, 0x0c, 0x52, 0x05, 0x71, 0x75, 0x65, + 0x72, 0x79, 0x12, 0x21, 0x0a, 0x0c, 0x66, 0x69, 0x6e, 0x64, 0x5f, 0x6f, 0x70, 0x74, 0x69, 0x6f, + 0x6e, 0x73, 0x18, 0x04, 0x20, 0x01, 0x28, 0x0c, 0x52, 0x0b, 0x66, 0x69, 0x6e, 0x64, 0x4f, 0x70, + 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x22, 0x69, 0x0a, 0x1d, 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, 0x12, 0x19, 0x0a, 0x08, 0x6e, 0x6f, 0x64, 0x65, 0x5f, 0x6b, + 0x65, 0x79, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x07, 0x6e, 0x6f, 0x64, 0x65, 0x4b, 0x65, + 0x79, 0x12, 0x1d, 0x0a, 0x0a, 0x6d, 0x6f, 0x64, 0x65, 0x6c, 0x5f, 0x74, 0x79, 0x70, 0x65, 0x18, + 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x09, 0x6d, 0x6f, 0x64, 0x65, 0x6c, 0x54, 0x79, 0x70, 0x65, + 0x12, 0x0e, 0x0a, 0x02, 0x69, 0x64, 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, 0x52, 0x02, 0x69, 0x64, + 0x22, 0x6e, 0x0a, 0x1c, 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, + 0x12, 0x19, 0x0a, 0x08, 0x6e, 0x6f, 0x64, 0x65, 0x5f, 0x6b, 0x65, 0x79, 0x18, 0x01, 0x20, 0x01, + 0x28, 0x09, 0x52, 0x07, 0x6e, 0x6f, 0x64, 0x65, 0x4b, 0x65, 0x79, 0x12, 0x1d, 0x0a, 0x0a, 0x6d, + 0x6f, 0x64, 0x65, 0x6c, 0x5f, 0x74, 0x79, 0x70, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, + 0x09, 0x6d, 0x6f, 0x64, 0x65, 0x6c, 0x54, 0x79, 0x70, 0x65, 0x12, 0x14, 0x0a, 0x05, 0x71, 0x75, + 0x65, 0x72, 0x79, 0x18, 0x03, 0x20, 0x01, 0x28, 0x0c, 0x52, 0x05, 0x71, 0x75, 0x65, 0x72, 0x79, + 0x22, 0x6f, 0x0a, 0x1d, 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, 0x12, 0x19, 0x0a, 0x08, 0x6e, 0x6f, 0x64, 0x65, 0x5f, 0x6b, 0x65, 0x79, 0x18, 0x01, 0x20, + 0x01, 0x28, 0x09, 0x52, 0x07, 0x6e, 0x6f, 0x64, 0x65, 0x4b, 0x65, 0x79, 0x12, 0x1d, 0x0a, 0x0a, + 0x6d, 0x6f, 0x64, 0x65, 0x6c, 0x5f, 0x74, 0x79, 0x70, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, + 0x52, 0x09, 0x6d, 0x6f, 0x64, 0x65, 0x6c, 0x54, 0x79, 0x70, 0x65, 0x12, 0x14, 0x0a, 0x05, 0x71, + 0x75, 0x65, 0x72, 0x79, 0x18, 0x03, 0x20, 0x01, 0x28, 0x0c, 0x52, 0x05, 0x71, 0x75, 0x65, 0x72, + 0x79, 0x22, 0x81, 0x01, 0x0a, 0x1d, 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, 0x12, 0x19, 0x0a, 0x08, 0x6e, 0x6f, 0x64, 0x65, 0x5f, 0x6b, 0x65, 0x79, 0x18, + 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x07, 0x6e, 0x6f, 0x64, 0x65, 0x4b, 0x65, 0x79, 0x12, 0x1d, + 0x0a, 0x0a, 0x6d, 0x6f, 0x64, 0x65, 0x6c, 0x5f, 0x74, 0x79, 0x70, 0x65, 0x18, 0x02, 0x20, 0x01, + 0x28, 0x09, 0x52, 0x09, 0x6d, 0x6f, 0x64, 0x65, 0x6c, 0x54, 0x79, 0x70, 0x65, 0x12, 0x0e, 0x0a, + 0x02, 0x69, 0x64, 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, 0x52, 0x02, 0x69, 0x64, 0x12, 0x16, 0x0a, + 0x06, 0x75, 0x70, 0x64, 0x61, 0x74, 0x65, 0x18, 0x04, 0x20, 0x01, 0x28, 0x0c, 0x52, 0x06, 0x75, + 0x70, 0x64, 0x61, 0x74, 0x65, 0x22, 0x86, 0x01, 0x0a, 0x1c, 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, 0x12, 0x19, 0x0a, 0x08, 0x6e, 0x6f, 0x64, 0x65, 0x5f, 0x6b, + 0x65, 0x79, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x07, 0x6e, 0x6f, 0x64, 0x65, 0x4b, 0x65, + 0x79, 0x12, 0x1d, 0x0a, 0x0a, 0x6d, 0x6f, 0x64, 0x65, 0x6c, 0x5f, 0x74, 0x79, 0x70, 0x65, 0x18, + 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x09, 0x6d, 0x6f, 0x64, 0x65, 0x6c, 0x54, 0x79, 0x70, 0x65, + 0x12, 0x14, 0x0a, 0x05, 0x71, 0x75, 0x65, 0x72, 0x79, 0x18, 0x03, 0x20, 0x01, 0x28, 0x0c, 0x52, + 0x05, 0x71, 0x75, 0x65, 0x72, 0x79, 0x12, 0x16, 0x0a, 0x06, 0x75, 0x70, 0x64, 0x61, 0x74, 0x65, + 0x18, 0x04, 0x20, 0x01, 0x28, 0x0c, 0x52, 0x06, 0x75, 0x70, 0x64, 0x61, 0x74, 0x65, 0x22, 0x87, + 0x01, 0x0a, 0x1d, 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, + 0x12, 0x19, 0x0a, 0x08, 0x6e, 0x6f, 0x64, 0x65, 0x5f, 0x6b, 0x65, 0x79, 0x18, 0x01, 0x20, 0x01, + 0x28, 0x09, 0x52, 0x07, 0x6e, 0x6f, 0x64, 0x65, 0x4b, 0x65, 0x79, 0x12, 0x1d, 0x0a, 0x0a, 0x6d, + 0x6f, 0x64, 0x65, 0x6c, 0x5f, 0x74, 0x79, 0x70, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, + 0x09, 0x6d, 0x6f, 0x64, 0x65, 0x6c, 0x54, 0x79, 0x70, 0x65, 0x12, 0x14, 0x0a, 0x05, 0x71, 0x75, + 0x65, 0x72, 0x79, 0x18, 0x03, 0x20, 0x01, 0x28, 0x0c, 0x52, 0x05, 0x71, 0x75, 0x65, 0x72, 0x79, + 0x12, 0x16, 0x0a, 0x06, 0x75, 0x70, 0x64, 0x61, 0x74, 0x65, 0x18, 0x04, 0x20, 0x01, 0x28, 0x0c, + 0x52, 0x06, 0x75, 0x70, 0x64, 0x61, 0x74, 0x65, 0x22, 0x80, 0x01, 0x0a, 0x1e, 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, 0x12, 0x19, 0x0a, 0x08, 0x6e, + 0x6f, 0x64, 0x65, 0x5f, 0x6b, 0x65, 0x79, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x07, 0x6e, + 0x6f, 0x64, 0x65, 0x4b, 0x65, 0x79, 0x12, 0x1d, 0x0a, 0x0a, 0x6d, 0x6f, 0x64, 0x65, 0x6c, 0x5f, + 0x74, 0x79, 0x70, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x09, 0x6d, 0x6f, 0x64, 0x65, + 0x6c, 0x54, 0x79, 0x70, 0x65, 0x12, 0x0e, 0x0a, 0x02, 0x69, 0x64, 0x18, 0x03, 0x20, 0x01, 0x28, + 0x09, 0x52, 0x02, 0x69, 0x64, 0x12, 0x14, 0x0a, 0x05, 0x6d, 0x6f, 0x64, 0x65, 0x6c, 0x18, 0x04, + 0x20, 0x01, 0x28, 0x0c, 0x52, 0x05, 0x6d, 0x6f, 0x64, 0x65, 0x6c, 0x22, 0x85, 0x01, 0x0a, 0x1d, + 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, 0x12, 0x19, 0x0a, + 0x08, 0x6e, 0x6f, 0x64, 0x65, 0x5f, 0x6b, 0x65, 0x79, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, + 0x07, 0x6e, 0x6f, 0x64, 0x65, 0x4b, 0x65, 0x79, 0x12, 0x1d, 0x0a, 0x0a, 0x6d, 0x6f, 0x64, 0x65, + 0x6c, 0x5f, 0x74, 0x79, 0x70, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x09, 0x6d, 0x6f, + 0x64, 0x65, 0x6c, 0x54, 0x79, 0x70, 0x65, 0x12, 0x14, 0x0a, 0x05, 0x71, 0x75, 0x65, 0x72, 0x79, + 0x18, 0x03, 0x20, 0x01, 0x28, 0x0c, 0x52, 0x05, 0x71, 0x75, 0x65, 0x72, 0x79, 0x12, 0x14, 0x0a, + 0x05, 0x6d, 0x6f, 0x64, 0x65, 0x6c, 0x18, 0x04, 0x20, 0x01, 0x28, 0x0c, 0x52, 0x05, 0x6d, 0x6f, + 0x64, 0x65, 0x6c, 0x22, 0x6e, 0x0a, 0x1c, 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, 0x12, 0x19, 0x0a, 0x08, 0x6e, 0x6f, 0x64, 0x65, 0x5f, 0x6b, 0x65, 0x79, 0x18, + 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x07, 0x6e, 0x6f, 0x64, 0x65, 0x4b, 0x65, 0x79, 0x12, 0x1d, + 0x0a, 0x0a, 0x6d, 0x6f, 0x64, 0x65, 0x6c, 0x5f, 0x74, 0x79, 0x70, 0x65, 0x18, 0x02, 0x20, 0x01, + 0x28, 0x09, 0x52, 0x09, 0x6d, 0x6f, 0x64, 0x65, 0x6c, 0x54, 0x79, 0x70, 0x65, 0x12, 0x14, 0x0a, + 0x05, 0x6d, 0x6f, 0x64, 0x65, 0x6c, 0x18, 0x03, 0x20, 0x01, 0x28, 0x0c, 0x52, 0x05, 0x6d, 0x6f, + 0x64, 0x65, 0x6c, 0x22, 0x71, 0x0a, 0x1d, 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, 0x12, 0x19, 0x0a, 0x08, 0x6e, 0x6f, 0x64, 0x65, 0x5f, 0x6b, 0x65, 0x79, + 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x07, 0x6e, 0x6f, 0x64, 0x65, 0x4b, 0x65, 0x79, 0x12, + 0x1d, 0x0a, 0x0a, 0x6d, 0x6f, 0x64, 0x65, 0x6c, 0x5f, 0x74, 0x79, 0x70, 0x65, 0x18, 0x02, 0x20, + 0x01, 0x28, 0x09, 0x52, 0x09, 0x6d, 0x6f, 0x64, 0x65, 0x6c, 0x54, 0x79, 0x70, 0x65, 0x12, 0x16, + 0x0a, 0x06, 0x6d, 0x6f, 0x64, 0x65, 0x6c, 0x73, 0x18, 0x03, 0x20, 0x01, 0x28, 0x0c, 0x52, 0x06, + 0x6d, 0x6f, 0x64, 0x65, 0x6c, 0x73, 0x22, 0x6a, 0x0a, 0x18, 0x4d, 0x6f, 0x64, 0x65, 0x6c, 0x53, + 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x43, 0x6f, 0x75, 0x6e, 0x74, 0x52, 0x65, 0x71, 0x75, 0x65, + 0x73, 0x74, 0x12, 0x19, 0x0a, 0x08, 0x6e, 0x6f, 0x64, 0x65, 0x5f, 0x6b, 0x65, 0x79, 0x18, 0x01, + 0x20, 0x01, 0x28, 0x09, 0x52, 0x07, 0x6e, 0x6f, 0x64, 0x65, 0x4b, 0x65, 0x79, 0x12, 0x1d, 0x0a, + 0x0a, 0x6d, 0x6f, 0x64, 0x65, 0x6c, 0x5f, 0x74, 0x79, 0x70, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, + 0x09, 0x52, 0x09, 0x6d, 0x6f, 0x64, 0x65, 0x6c, 0x54, 0x79, 0x70, 0x65, 0x12, 0x14, 0x0a, 0x05, + 0x71, 0x75, 0x65, 0x72, 0x79, 0x18, 0x03, 0x20, 0x01, 0x28, 0x0c, 0x52, 0x05, 0x71, 0x75, 0x65, + 0x72, 0x79, 0x42, 0x08, 0x5a, 0x06, 0x2e, 0x3b, 0x67, 0x72, 0x70, 0x63, 0x62, 0x06, 0x70, 0x72, + 0x6f, 0x74, 0x6f, 0x33, +} + +var ( + file_entity_model_service_request_proto_rawDescOnce sync.Once + file_entity_model_service_request_proto_rawDescData = file_entity_model_service_request_proto_rawDesc +) + +func file_entity_model_service_request_proto_rawDescGZIP() []byte { + file_entity_model_service_request_proto_rawDescOnce.Do(func() { + file_entity_model_service_request_proto_rawDescData = protoimpl.X.CompressGZIP(file_entity_model_service_request_proto_rawDescData) + }) + return file_entity_model_service_request_proto_rawDescData +} + +var file_entity_model_service_request_proto_msgTypes = make([]protoimpl.MessageInfo, 14) +var file_entity_model_service_request_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 + (*ModelServiceCountRequest)(nil), // 13: grpc.ModelServiceCountRequest +} +var file_entity_model_service_request_proto_depIdxs = []int32{ + 0, // [0:0] is the sub-list for method output_type + 0, // [0:0] 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_entity_model_service_request_proto_init() } +func file_entity_model_service_request_proto_init() { + if File_entity_model_service_request_proto != nil { + return + } + if !protoimpl.UnsafeEnabled { + file_entity_model_service_request_proto_msgTypes[0].Exporter = func(v any, i int) any { + switch v := v.(*ModelServiceGetByIdRequest); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_entity_model_service_request_proto_msgTypes[1].Exporter = func(v any, i int) any { + switch v := v.(*ModelServiceGetOneRequest); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_entity_model_service_request_proto_msgTypes[2].Exporter = func(v any, i int) any { + switch v := v.(*ModelServiceGetManyRequest); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_entity_model_service_request_proto_msgTypes[3].Exporter = func(v any, i int) any { + switch v := v.(*ModelServiceDeleteByIdRequest); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_entity_model_service_request_proto_msgTypes[4].Exporter = func(v any, i int) any { + switch v := v.(*ModelServiceDeleteOneRequest); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_entity_model_service_request_proto_msgTypes[5].Exporter = func(v any, i int) any { + switch v := v.(*ModelServiceDeleteManyRequest); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_entity_model_service_request_proto_msgTypes[6].Exporter = func(v any, i int) any { + switch v := v.(*ModelServiceUpdateByIdRequest); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_entity_model_service_request_proto_msgTypes[7].Exporter = func(v any, i int) any { + switch v := v.(*ModelServiceUpdateOneRequest); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_entity_model_service_request_proto_msgTypes[8].Exporter = func(v any, i int) any { + switch v := v.(*ModelServiceUpdateManyRequest); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_entity_model_service_request_proto_msgTypes[9].Exporter = func(v any, i int) any { + switch v := v.(*ModelServiceReplaceByIdRequest); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_entity_model_service_request_proto_msgTypes[10].Exporter = func(v any, i int) any { + switch v := v.(*ModelServiceReplaceOneRequest); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_entity_model_service_request_proto_msgTypes[11].Exporter = func(v any, i int) any { + switch v := v.(*ModelServiceInsertOneRequest); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_entity_model_service_request_proto_msgTypes[12].Exporter = func(v any, i int) any { + switch v := v.(*ModelServiceInsertManyRequest); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_entity_model_service_request_proto_msgTypes[13].Exporter = func(v any, i int) any { + switch v := v.(*ModelServiceCountRequest); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + } + type x struct{} + out := protoimpl.TypeBuilder{ + File: protoimpl.DescBuilder{ + GoPackagePath: reflect.TypeOf(x{}).PkgPath(), + RawDescriptor: file_entity_model_service_request_proto_rawDesc, + NumEnums: 0, + NumMessages: 14, + NumExtensions: 0, + NumServices: 0, + }, + GoTypes: file_entity_model_service_request_proto_goTypes, + DependencyIndexes: file_entity_model_service_request_proto_depIdxs, + MessageInfos: file_entity_model_service_request_proto_msgTypes, + }.Build() + File_entity_model_service_request_proto = out.File + file_entity_model_service_request_proto_rawDesc = nil + file_entity_model_service_request_proto_goTypes = nil + file_entity_model_service_request_proto_depIdxs = nil +} diff --git a/grpc/model_service_v2_request.pb.go b/grpc/model_service_v2_request.pb.go deleted file mode 100644 index c3a51f20..00000000 --- a/grpc/model_service_v2_request.pb.go +++ /dev/null @@ -1,1311 +0,0 @@ -// Code generated by protoc-gen-go. DO NOT EDIT. -// versions: -// protoc-gen-go v1.34.2 -// protoc v5.27.2 -// source: entity/model_service_v2_request.proto - -package grpc - -import ( - protoreflect "google.golang.org/protobuf/reflect/protoreflect" - protoimpl "google.golang.org/protobuf/runtime/protoimpl" - reflect "reflect" - sync "sync" -) - -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) -) - -type ModelServiceV2GetByIdRequest struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - - NodeKey string `protobuf:"bytes,1,opt,name=node_key,json=nodeKey,proto3" json:"node_key,omitempty"` - ModelType string `protobuf:"bytes,2,opt,name=model_type,json=modelType,proto3" json:"model_type,omitempty"` - Id string `protobuf:"bytes,3,opt,name=id,proto3" json:"id,omitempty"` -} - -func (x *ModelServiceV2GetByIdRequest) Reset() { - *x = ModelServiceV2GetByIdRequest{} - if protoimpl.UnsafeEnabled { - mi := &file_entity_model_service_v2_request_proto_msgTypes[0] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } -} - -func (x *ModelServiceV2GetByIdRequest) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*ModelServiceV2GetByIdRequest) ProtoMessage() {} - -func (x *ModelServiceV2GetByIdRequest) ProtoReflect() protoreflect.Message { - mi := &file_entity_model_service_v2_request_proto_msgTypes[0] - if protoimpl.UnsafeEnabled && x != nil { - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - if ms.LoadMessageInfo() == nil { - ms.StoreMessageInfo(mi) - } - return ms - } - return mi.MessageOf(x) -} - -// Deprecated: Use ModelServiceV2GetByIdRequest.ProtoReflect.Descriptor instead. -func (*ModelServiceV2GetByIdRequest) Descriptor() ([]byte, []int) { - return file_entity_model_service_v2_request_proto_rawDescGZIP(), []int{0} -} - -func (x *ModelServiceV2GetByIdRequest) GetNodeKey() string { - if x != nil { - return x.NodeKey - } - return "" -} - -func (x *ModelServiceV2GetByIdRequest) GetModelType() string { - if x != nil { - return x.ModelType - } - return "" -} - -func (x *ModelServiceV2GetByIdRequest) GetId() string { - if x != nil { - return x.Id - } - return "" -} - -type ModelServiceV2GetOneRequest struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - - NodeKey string `protobuf:"bytes,1,opt,name=node_key,json=nodeKey,proto3" json:"node_key,omitempty"` - ModelType string `protobuf:"bytes,2,opt,name=model_type,json=modelType,proto3" json:"model_type,omitempty"` - Query []byte `protobuf:"bytes,3,opt,name=query,proto3" json:"query,omitempty"` - FindOptions []byte `protobuf:"bytes,4,opt,name=find_options,json=findOptions,proto3" json:"find_options,omitempty"` -} - -func (x *ModelServiceV2GetOneRequest) Reset() { - *x = ModelServiceV2GetOneRequest{} - if protoimpl.UnsafeEnabled { - mi := &file_entity_model_service_v2_request_proto_msgTypes[1] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } -} - -func (x *ModelServiceV2GetOneRequest) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*ModelServiceV2GetOneRequest) ProtoMessage() {} - -func (x *ModelServiceV2GetOneRequest) ProtoReflect() protoreflect.Message { - mi := &file_entity_model_service_v2_request_proto_msgTypes[1] - if protoimpl.UnsafeEnabled && x != nil { - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - if ms.LoadMessageInfo() == nil { - ms.StoreMessageInfo(mi) - } - return ms - } - return mi.MessageOf(x) -} - -// Deprecated: Use ModelServiceV2GetOneRequest.ProtoReflect.Descriptor instead. -func (*ModelServiceV2GetOneRequest) Descriptor() ([]byte, []int) { - return file_entity_model_service_v2_request_proto_rawDescGZIP(), []int{1} -} - -func (x *ModelServiceV2GetOneRequest) GetNodeKey() string { - if x != nil { - return x.NodeKey - } - return "" -} - -func (x *ModelServiceV2GetOneRequest) GetModelType() string { - if x != nil { - return x.ModelType - } - return "" -} - -func (x *ModelServiceV2GetOneRequest) GetQuery() []byte { - if x != nil { - return x.Query - } - return nil -} - -func (x *ModelServiceV2GetOneRequest) GetFindOptions() []byte { - if x != nil { - return x.FindOptions - } - return nil -} - -type ModelServiceV2GetManyRequest struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - - NodeKey string `protobuf:"bytes,1,opt,name=node_key,json=nodeKey,proto3" json:"node_key,omitempty"` - ModelType string `protobuf:"bytes,2,opt,name=model_type,json=modelType,proto3" json:"model_type,omitempty"` - Query []byte `protobuf:"bytes,3,opt,name=query,proto3" json:"query,omitempty"` - FindOptions []byte `protobuf:"bytes,4,opt,name=find_options,json=findOptions,proto3" json:"find_options,omitempty"` -} - -func (x *ModelServiceV2GetManyRequest) Reset() { - *x = ModelServiceV2GetManyRequest{} - if protoimpl.UnsafeEnabled { - mi := &file_entity_model_service_v2_request_proto_msgTypes[2] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } -} - -func (x *ModelServiceV2GetManyRequest) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*ModelServiceV2GetManyRequest) ProtoMessage() {} - -func (x *ModelServiceV2GetManyRequest) ProtoReflect() protoreflect.Message { - mi := &file_entity_model_service_v2_request_proto_msgTypes[2] - if protoimpl.UnsafeEnabled && x != nil { - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - if ms.LoadMessageInfo() == nil { - ms.StoreMessageInfo(mi) - } - return ms - } - return mi.MessageOf(x) -} - -// Deprecated: Use ModelServiceV2GetManyRequest.ProtoReflect.Descriptor instead. -func (*ModelServiceV2GetManyRequest) Descriptor() ([]byte, []int) { - return file_entity_model_service_v2_request_proto_rawDescGZIP(), []int{2} -} - -func (x *ModelServiceV2GetManyRequest) GetNodeKey() string { - if x != nil { - return x.NodeKey - } - return "" -} - -func (x *ModelServiceV2GetManyRequest) GetModelType() string { - if x != nil { - return x.ModelType - } - return "" -} - -func (x *ModelServiceV2GetManyRequest) GetQuery() []byte { - if x != nil { - return x.Query - } - return nil -} - -func (x *ModelServiceV2GetManyRequest) GetFindOptions() []byte { - if x != nil { - return x.FindOptions - } - return nil -} - -type ModelServiceV2DeleteByIdRequest struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - - NodeKey string `protobuf:"bytes,1,opt,name=node_key,json=nodeKey,proto3" json:"node_key,omitempty"` - ModelType string `protobuf:"bytes,2,opt,name=model_type,json=modelType,proto3" json:"model_type,omitempty"` - Id string `protobuf:"bytes,3,opt,name=id,proto3" json:"id,omitempty"` -} - -func (x *ModelServiceV2DeleteByIdRequest) Reset() { - *x = ModelServiceV2DeleteByIdRequest{} - if protoimpl.UnsafeEnabled { - mi := &file_entity_model_service_v2_request_proto_msgTypes[3] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } -} - -func (x *ModelServiceV2DeleteByIdRequest) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*ModelServiceV2DeleteByIdRequest) ProtoMessage() {} - -func (x *ModelServiceV2DeleteByIdRequest) ProtoReflect() protoreflect.Message { - mi := &file_entity_model_service_v2_request_proto_msgTypes[3] - if protoimpl.UnsafeEnabled && x != nil { - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - if ms.LoadMessageInfo() == nil { - ms.StoreMessageInfo(mi) - } - return ms - } - return mi.MessageOf(x) -} - -// Deprecated: Use ModelServiceV2DeleteByIdRequest.ProtoReflect.Descriptor instead. -func (*ModelServiceV2DeleteByIdRequest) Descriptor() ([]byte, []int) { - return file_entity_model_service_v2_request_proto_rawDescGZIP(), []int{3} -} - -func (x *ModelServiceV2DeleteByIdRequest) GetNodeKey() string { - if x != nil { - return x.NodeKey - } - return "" -} - -func (x *ModelServiceV2DeleteByIdRequest) GetModelType() string { - if x != nil { - return x.ModelType - } - return "" -} - -func (x *ModelServiceV2DeleteByIdRequest) GetId() string { - if x != nil { - return x.Id - } - return "" -} - -type ModelServiceV2DeleteOneRequest struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - - NodeKey string `protobuf:"bytes,1,opt,name=node_key,json=nodeKey,proto3" json:"node_key,omitempty"` - ModelType string `protobuf:"bytes,2,opt,name=model_type,json=modelType,proto3" json:"model_type,omitempty"` - Query []byte `protobuf:"bytes,3,opt,name=query,proto3" json:"query,omitempty"` -} - -func (x *ModelServiceV2DeleteOneRequest) Reset() { - *x = ModelServiceV2DeleteOneRequest{} - if protoimpl.UnsafeEnabled { - mi := &file_entity_model_service_v2_request_proto_msgTypes[4] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } -} - -func (x *ModelServiceV2DeleteOneRequest) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*ModelServiceV2DeleteOneRequest) ProtoMessage() {} - -func (x *ModelServiceV2DeleteOneRequest) ProtoReflect() protoreflect.Message { - mi := &file_entity_model_service_v2_request_proto_msgTypes[4] - if protoimpl.UnsafeEnabled && x != nil { - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - if ms.LoadMessageInfo() == nil { - ms.StoreMessageInfo(mi) - } - return ms - } - return mi.MessageOf(x) -} - -// Deprecated: Use ModelServiceV2DeleteOneRequest.ProtoReflect.Descriptor instead. -func (*ModelServiceV2DeleteOneRequest) Descriptor() ([]byte, []int) { - return file_entity_model_service_v2_request_proto_rawDescGZIP(), []int{4} -} - -func (x *ModelServiceV2DeleteOneRequest) GetNodeKey() string { - if x != nil { - return x.NodeKey - } - return "" -} - -func (x *ModelServiceV2DeleteOneRequest) GetModelType() string { - if x != nil { - return x.ModelType - } - return "" -} - -func (x *ModelServiceV2DeleteOneRequest) GetQuery() []byte { - if x != nil { - return x.Query - } - return nil -} - -type ModelServiceV2DeleteManyRequest struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - - NodeKey string `protobuf:"bytes,1,opt,name=node_key,json=nodeKey,proto3" json:"node_key,omitempty"` - ModelType string `protobuf:"bytes,2,opt,name=model_type,json=modelType,proto3" json:"model_type,omitempty"` - Query []byte `protobuf:"bytes,3,opt,name=query,proto3" json:"query,omitempty"` -} - -func (x *ModelServiceV2DeleteManyRequest) Reset() { - *x = ModelServiceV2DeleteManyRequest{} - if protoimpl.UnsafeEnabled { - mi := &file_entity_model_service_v2_request_proto_msgTypes[5] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } -} - -func (x *ModelServiceV2DeleteManyRequest) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*ModelServiceV2DeleteManyRequest) ProtoMessage() {} - -func (x *ModelServiceV2DeleteManyRequest) ProtoReflect() protoreflect.Message { - mi := &file_entity_model_service_v2_request_proto_msgTypes[5] - if protoimpl.UnsafeEnabled && x != nil { - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - if ms.LoadMessageInfo() == nil { - ms.StoreMessageInfo(mi) - } - return ms - } - return mi.MessageOf(x) -} - -// Deprecated: Use ModelServiceV2DeleteManyRequest.ProtoReflect.Descriptor instead. -func (*ModelServiceV2DeleteManyRequest) Descriptor() ([]byte, []int) { - return file_entity_model_service_v2_request_proto_rawDescGZIP(), []int{5} -} - -func (x *ModelServiceV2DeleteManyRequest) GetNodeKey() string { - if x != nil { - return x.NodeKey - } - return "" -} - -func (x *ModelServiceV2DeleteManyRequest) GetModelType() string { - if x != nil { - return x.ModelType - } - return "" -} - -func (x *ModelServiceV2DeleteManyRequest) GetQuery() []byte { - if x != nil { - return x.Query - } - return nil -} - -type ModelServiceV2UpdateByIdRequest struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - - NodeKey string `protobuf:"bytes,1,opt,name=node_key,json=nodeKey,proto3" json:"node_key,omitempty"` - ModelType string `protobuf:"bytes,2,opt,name=model_type,json=modelType,proto3" json:"model_type,omitempty"` - Id string `protobuf:"bytes,3,opt,name=id,proto3" json:"id,omitempty"` - Update []byte `protobuf:"bytes,4,opt,name=update,proto3" json:"update,omitempty"` -} - -func (x *ModelServiceV2UpdateByIdRequest) Reset() { - *x = ModelServiceV2UpdateByIdRequest{} - if protoimpl.UnsafeEnabled { - mi := &file_entity_model_service_v2_request_proto_msgTypes[6] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } -} - -func (x *ModelServiceV2UpdateByIdRequest) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*ModelServiceV2UpdateByIdRequest) ProtoMessage() {} - -func (x *ModelServiceV2UpdateByIdRequest) ProtoReflect() protoreflect.Message { - mi := &file_entity_model_service_v2_request_proto_msgTypes[6] - if protoimpl.UnsafeEnabled && x != nil { - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - if ms.LoadMessageInfo() == nil { - ms.StoreMessageInfo(mi) - } - return ms - } - return mi.MessageOf(x) -} - -// Deprecated: Use ModelServiceV2UpdateByIdRequest.ProtoReflect.Descriptor instead. -func (*ModelServiceV2UpdateByIdRequest) Descriptor() ([]byte, []int) { - return file_entity_model_service_v2_request_proto_rawDescGZIP(), []int{6} -} - -func (x *ModelServiceV2UpdateByIdRequest) GetNodeKey() string { - if x != nil { - return x.NodeKey - } - return "" -} - -func (x *ModelServiceV2UpdateByIdRequest) GetModelType() string { - if x != nil { - return x.ModelType - } - return "" -} - -func (x *ModelServiceV2UpdateByIdRequest) GetId() string { - if x != nil { - return x.Id - } - return "" -} - -func (x *ModelServiceV2UpdateByIdRequest) GetUpdate() []byte { - if x != nil { - return x.Update - } - return nil -} - -type ModelServiceV2UpdateOneRequest struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - - NodeKey string `protobuf:"bytes,1,opt,name=node_key,json=nodeKey,proto3" json:"node_key,omitempty"` - ModelType string `protobuf:"bytes,2,opt,name=model_type,json=modelType,proto3" json:"model_type,omitempty"` - Query []byte `protobuf:"bytes,3,opt,name=query,proto3" json:"query,omitempty"` - Update []byte `protobuf:"bytes,4,opt,name=update,proto3" json:"update,omitempty"` -} - -func (x *ModelServiceV2UpdateOneRequest) Reset() { - *x = ModelServiceV2UpdateOneRequest{} - if protoimpl.UnsafeEnabled { - mi := &file_entity_model_service_v2_request_proto_msgTypes[7] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } -} - -func (x *ModelServiceV2UpdateOneRequest) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*ModelServiceV2UpdateOneRequest) ProtoMessage() {} - -func (x *ModelServiceV2UpdateOneRequest) ProtoReflect() protoreflect.Message { - mi := &file_entity_model_service_v2_request_proto_msgTypes[7] - if protoimpl.UnsafeEnabled && x != nil { - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - if ms.LoadMessageInfo() == nil { - ms.StoreMessageInfo(mi) - } - return ms - } - return mi.MessageOf(x) -} - -// Deprecated: Use ModelServiceV2UpdateOneRequest.ProtoReflect.Descriptor instead. -func (*ModelServiceV2UpdateOneRequest) Descriptor() ([]byte, []int) { - return file_entity_model_service_v2_request_proto_rawDescGZIP(), []int{7} -} - -func (x *ModelServiceV2UpdateOneRequest) GetNodeKey() string { - if x != nil { - return x.NodeKey - } - return "" -} - -func (x *ModelServiceV2UpdateOneRequest) GetModelType() string { - if x != nil { - return x.ModelType - } - return "" -} - -func (x *ModelServiceV2UpdateOneRequest) GetQuery() []byte { - if x != nil { - return x.Query - } - return nil -} - -func (x *ModelServiceV2UpdateOneRequest) GetUpdate() []byte { - if x != nil { - return x.Update - } - return nil -} - -type ModelServiceV2UpdateManyRequest struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - - NodeKey string `protobuf:"bytes,1,opt,name=node_key,json=nodeKey,proto3" json:"node_key,omitempty"` - ModelType string `protobuf:"bytes,2,opt,name=model_type,json=modelType,proto3" json:"model_type,omitempty"` - Query []byte `protobuf:"bytes,3,opt,name=query,proto3" json:"query,omitempty"` - Update []byte `protobuf:"bytes,4,opt,name=update,proto3" json:"update,omitempty"` -} - -func (x *ModelServiceV2UpdateManyRequest) Reset() { - *x = ModelServiceV2UpdateManyRequest{} - if protoimpl.UnsafeEnabled { - mi := &file_entity_model_service_v2_request_proto_msgTypes[8] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } -} - -func (x *ModelServiceV2UpdateManyRequest) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*ModelServiceV2UpdateManyRequest) ProtoMessage() {} - -func (x *ModelServiceV2UpdateManyRequest) ProtoReflect() protoreflect.Message { - mi := &file_entity_model_service_v2_request_proto_msgTypes[8] - if protoimpl.UnsafeEnabled && x != nil { - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - if ms.LoadMessageInfo() == nil { - ms.StoreMessageInfo(mi) - } - return ms - } - return mi.MessageOf(x) -} - -// Deprecated: Use ModelServiceV2UpdateManyRequest.ProtoReflect.Descriptor instead. -func (*ModelServiceV2UpdateManyRequest) Descriptor() ([]byte, []int) { - return file_entity_model_service_v2_request_proto_rawDescGZIP(), []int{8} -} - -func (x *ModelServiceV2UpdateManyRequest) GetNodeKey() string { - if x != nil { - return x.NodeKey - } - return "" -} - -func (x *ModelServiceV2UpdateManyRequest) GetModelType() string { - if x != nil { - return x.ModelType - } - return "" -} - -func (x *ModelServiceV2UpdateManyRequest) GetQuery() []byte { - if x != nil { - return x.Query - } - return nil -} - -func (x *ModelServiceV2UpdateManyRequest) GetUpdate() []byte { - if x != nil { - return x.Update - } - return nil -} - -type ModelServiceV2ReplaceByIdRequest struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - - NodeKey string `protobuf:"bytes,1,opt,name=node_key,json=nodeKey,proto3" json:"node_key,omitempty"` - ModelType string `protobuf:"bytes,2,opt,name=model_type,json=modelType,proto3" json:"model_type,omitempty"` - Id string `protobuf:"bytes,3,opt,name=id,proto3" json:"id,omitempty"` - Model []byte `protobuf:"bytes,4,opt,name=model,proto3" json:"model,omitempty"` -} - -func (x *ModelServiceV2ReplaceByIdRequest) Reset() { - *x = ModelServiceV2ReplaceByIdRequest{} - if protoimpl.UnsafeEnabled { - mi := &file_entity_model_service_v2_request_proto_msgTypes[9] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } -} - -func (x *ModelServiceV2ReplaceByIdRequest) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*ModelServiceV2ReplaceByIdRequest) ProtoMessage() {} - -func (x *ModelServiceV2ReplaceByIdRequest) ProtoReflect() protoreflect.Message { - mi := &file_entity_model_service_v2_request_proto_msgTypes[9] - if protoimpl.UnsafeEnabled && x != nil { - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - if ms.LoadMessageInfo() == nil { - ms.StoreMessageInfo(mi) - } - return ms - } - return mi.MessageOf(x) -} - -// Deprecated: Use ModelServiceV2ReplaceByIdRequest.ProtoReflect.Descriptor instead. -func (*ModelServiceV2ReplaceByIdRequest) Descriptor() ([]byte, []int) { - return file_entity_model_service_v2_request_proto_rawDescGZIP(), []int{9} -} - -func (x *ModelServiceV2ReplaceByIdRequest) GetNodeKey() string { - if x != nil { - return x.NodeKey - } - return "" -} - -func (x *ModelServiceV2ReplaceByIdRequest) GetModelType() string { - if x != nil { - return x.ModelType - } - return "" -} - -func (x *ModelServiceV2ReplaceByIdRequest) GetId() string { - if x != nil { - return x.Id - } - return "" -} - -func (x *ModelServiceV2ReplaceByIdRequest) GetModel() []byte { - if x != nil { - return x.Model - } - return nil -} - -type ModelServiceV2ReplaceOneRequest struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - - NodeKey string `protobuf:"bytes,1,opt,name=node_key,json=nodeKey,proto3" json:"node_key,omitempty"` - ModelType string `protobuf:"bytes,2,opt,name=model_type,json=modelType,proto3" json:"model_type,omitempty"` - Query []byte `protobuf:"bytes,3,opt,name=query,proto3" json:"query,omitempty"` - Model []byte `protobuf:"bytes,4,opt,name=model,proto3" json:"model,omitempty"` -} - -func (x *ModelServiceV2ReplaceOneRequest) Reset() { - *x = ModelServiceV2ReplaceOneRequest{} - if protoimpl.UnsafeEnabled { - mi := &file_entity_model_service_v2_request_proto_msgTypes[10] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } -} - -func (x *ModelServiceV2ReplaceOneRequest) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*ModelServiceV2ReplaceOneRequest) ProtoMessage() {} - -func (x *ModelServiceV2ReplaceOneRequest) ProtoReflect() protoreflect.Message { - mi := &file_entity_model_service_v2_request_proto_msgTypes[10] - if protoimpl.UnsafeEnabled && x != nil { - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - if ms.LoadMessageInfo() == nil { - ms.StoreMessageInfo(mi) - } - return ms - } - return mi.MessageOf(x) -} - -// Deprecated: Use ModelServiceV2ReplaceOneRequest.ProtoReflect.Descriptor instead. -func (*ModelServiceV2ReplaceOneRequest) Descriptor() ([]byte, []int) { - return file_entity_model_service_v2_request_proto_rawDescGZIP(), []int{10} -} - -func (x *ModelServiceV2ReplaceOneRequest) GetNodeKey() string { - if x != nil { - return x.NodeKey - } - return "" -} - -func (x *ModelServiceV2ReplaceOneRequest) GetModelType() string { - if x != nil { - return x.ModelType - } - return "" -} - -func (x *ModelServiceV2ReplaceOneRequest) GetQuery() []byte { - if x != nil { - return x.Query - } - return nil -} - -func (x *ModelServiceV2ReplaceOneRequest) GetModel() []byte { - if x != nil { - return x.Model - } - return nil -} - -type ModelServiceV2InsertOneRequest struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - - NodeKey string `protobuf:"bytes,1,opt,name=node_key,json=nodeKey,proto3" json:"node_key,omitempty"` - ModelType string `protobuf:"bytes,2,opt,name=model_type,json=modelType,proto3" json:"model_type,omitempty"` - Model []byte `protobuf:"bytes,3,opt,name=model,proto3" json:"model,omitempty"` -} - -func (x *ModelServiceV2InsertOneRequest) Reset() { - *x = ModelServiceV2InsertOneRequest{} - if protoimpl.UnsafeEnabled { - mi := &file_entity_model_service_v2_request_proto_msgTypes[11] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } -} - -func (x *ModelServiceV2InsertOneRequest) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*ModelServiceV2InsertOneRequest) ProtoMessage() {} - -func (x *ModelServiceV2InsertOneRequest) ProtoReflect() protoreflect.Message { - mi := &file_entity_model_service_v2_request_proto_msgTypes[11] - if protoimpl.UnsafeEnabled && x != nil { - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - if ms.LoadMessageInfo() == nil { - ms.StoreMessageInfo(mi) - } - return ms - } - return mi.MessageOf(x) -} - -// Deprecated: Use ModelServiceV2InsertOneRequest.ProtoReflect.Descriptor instead. -func (*ModelServiceV2InsertOneRequest) Descriptor() ([]byte, []int) { - return file_entity_model_service_v2_request_proto_rawDescGZIP(), []int{11} -} - -func (x *ModelServiceV2InsertOneRequest) GetNodeKey() string { - if x != nil { - return x.NodeKey - } - return "" -} - -func (x *ModelServiceV2InsertOneRequest) GetModelType() string { - if x != nil { - return x.ModelType - } - return "" -} - -func (x *ModelServiceV2InsertOneRequest) GetModel() []byte { - if x != nil { - return x.Model - } - return nil -} - -type ModelServiceV2InsertManyRequest struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - - NodeKey string `protobuf:"bytes,1,opt,name=node_key,json=nodeKey,proto3" json:"node_key,omitempty"` - ModelType string `protobuf:"bytes,2,opt,name=model_type,json=modelType,proto3" json:"model_type,omitempty"` - Models []byte `protobuf:"bytes,3,opt,name=models,proto3" json:"models,omitempty"` -} - -func (x *ModelServiceV2InsertManyRequest) Reset() { - *x = ModelServiceV2InsertManyRequest{} - if protoimpl.UnsafeEnabled { - mi := &file_entity_model_service_v2_request_proto_msgTypes[12] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } -} - -func (x *ModelServiceV2InsertManyRequest) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*ModelServiceV2InsertManyRequest) ProtoMessage() {} - -func (x *ModelServiceV2InsertManyRequest) ProtoReflect() protoreflect.Message { - mi := &file_entity_model_service_v2_request_proto_msgTypes[12] - if protoimpl.UnsafeEnabled && x != nil { - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - if ms.LoadMessageInfo() == nil { - ms.StoreMessageInfo(mi) - } - return ms - } - return mi.MessageOf(x) -} - -// Deprecated: Use ModelServiceV2InsertManyRequest.ProtoReflect.Descriptor instead. -func (*ModelServiceV2InsertManyRequest) Descriptor() ([]byte, []int) { - return file_entity_model_service_v2_request_proto_rawDescGZIP(), []int{12} -} - -func (x *ModelServiceV2InsertManyRequest) GetNodeKey() string { - if x != nil { - return x.NodeKey - } - return "" -} - -func (x *ModelServiceV2InsertManyRequest) GetModelType() string { - if x != nil { - return x.ModelType - } - return "" -} - -func (x *ModelServiceV2InsertManyRequest) GetModels() []byte { - if x != nil { - return x.Models - } - return nil -} - -type ModelServiceV2CountRequest struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - - NodeKey string `protobuf:"bytes,1,opt,name=node_key,json=nodeKey,proto3" json:"node_key,omitempty"` - ModelType string `protobuf:"bytes,2,opt,name=model_type,json=modelType,proto3" json:"model_type,omitempty"` - Query []byte `protobuf:"bytes,3,opt,name=query,proto3" json:"query,omitempty"` -} - -func (x *ModelServiceV2CountRequest) Reset() { - *x = ModelServiceV2CountRequest{} - if protoimpl.UnsafeEnabled { - mi := &file_entity_model_service_v2_request_proto_msgTypes[13] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } -} - -func (x *ModelServiceV2CountRequest) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*ModelServiceV2CountRequest) ProtoMessage() {} - -func (x *ModelServiceV2CountRequest) ProtoReflect() protoreflect.Message { - mi := &file_entity_model_service_v2_request_proto_msgTypes[13] - if protoimpl.UnsafeEnabled && x != nil { - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - if ms.LoadMessageInfo() == nil { - ms.StoreMessageInfo(mi) - } - return ms - } - return mi.MessageOf(x) -} - -// Deprecated: Use ModelServiceV2CountRequest.ProtoReflect.Descriptor instead. -func (*ModelServiceV2CountRequest) Descriptor() ([]byte, []int) { - return file_entity_model_service_v2_request_proto_rawDescGZIP(), []int{13} -} - -func (x *ModelServiceV2CountRequest) GetNodeKey() string { - if x != nil { - return x.NodeKey - } - return "" -} - -func (x *ModelServiceV2CountRequest) GetModelType() string { - if x != nil { - return x.ModelType - } - return "" -} - -func (x *ModelServiceV2CountRequest) GetQuery() []byte { - if x != nil { - return x.Query - } - return nil -} - -var File_entity_model_service_v2_request_proto protoreflect.FileDescriptor - -var file_entity_model_service_v2_request_proto_rawDesc = []byte{ - 0x0a, 0x25, 0x65, 0x6e, 0x74, 0x69, 0x74, 0x79, 0x2f, 0x6d, 0x6f, 0x64, 0x65, 0x6c, 0x5f, 0x73, - 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x5f, 0x76, 0x32, 0x5f, 0x72, 0x65, 0x71, 0x75, 0x65, 0x73, - 0x74, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x12, 0x04, 0x67, 0x72, 0x70, 0x63, 0x22, 0x68, 0x0a, - 0x1c, 0x4d, 0x6f, 0x64, 0x65, 0x6c, 0x53, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x56, 0x32, 0x47, - 0x65, 0x74, 0x42, 0x79, 0x49, 0x64, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x19, 0x0a, - 0x08, 0x6e, 0x6f, 0x64, 0x65, 0x5f, 0x6b, 0x65, 0x79, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, - 0x07, 0x6e, 0x6f, 0x64, 0x65, 0x4b, 0x65, 0x79, 0x12, 0x1d, 0x0a, 0x0a, 0x6d, 0x6f, 0x64, 0x65, - 0x6c, 0x5f, 0x74, 0x79, 0x70, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x09, 0x6d, 0x6f, - 0x64, 0x65, 0x6c, 0x54, 0x79, 0x70, 0x65, 0x12, 0x0e, 0x0a, 0x02, 0x69, 0x64, 0x18, 0x03, 0x20, - 0x01, 0x28, 0x09, 0x52, 0x02, 0x69, 0x64, 0x22, 0x90, 0x01, 0x0a, 0x1b, 0x4d, 0x6f, 0x64, 0x65, - 0x6c, 0x53, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x56, 0x32, 0x47, 0x65, 0x74, 0x4f, 0x6e, 0x65, - 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x19, 0x0a, 0x08, 0x6e, 0x6f, 0x64, 0x65, 0x5f, - 0x6b, 0x65, 0x79, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x07, 0x6e, 0x6f, 0x64, 0x65, 0x4b, - 0x65, 0x79, 0x12, 0x1d, 0x0a, 0x0a, 0x6d, 0x6f, 0x64, 0x65, 0x6c, 0x5f, 0x74, 0x79, 0x70, 0x65, - 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x09, 0x6d, 0x6f, 0x64, 0x65, 0x6c, 0x54, 0x79, 0x70, - 0x65, 0x12, 0x14, 0x0a, 0x05, 0x71, 0x75, 0x65, 0x72, 0x79, 0x18, 0x03, 0x20, 0x01, 0x28, 0x0c, - 0x52, 0x05, 0x71, 0x75, 0x65, 0x72, 0x79, 0x12, 0x21, 0x0a, 0x0c, 0x66, 0x69, 0x6e, 0x64, 0x5f, - 0x6f, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x18, 0x04, 0x20, 0x01, 0x28, 0x0c, 0x52, 0x0b, 0x66, - 0x69, 0x6e, 0x64, 0x4f, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x22, 0x91, 0x01, 0x0a, 0x1c, 0x4d, - 0x6f, 0x64, 0x65, 0x6c, 0x53, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x56, 0x32, 0x47, 0x65, 0x74, - 0x4d, 0x61, 0x6e, 0x79, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x19, 0x0a, 0x08, 0x6e, - 0x6f, 0x64, 0x65, 0x5f, 0x6b, 0x65, 0x79, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x07, 0x6e, - 0x6f, 0x64, 0x65, 0x4b, 0x65, 0x79, 0x12, 0x1d, 0x0a, 0x0a, 0x6d, 0x6f, 0x64, 0x65, 0x6c, 0x5f, - 0x74, 0x79, 0x70, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x09, 0x6d, 0x6f, 0x64, 0x65, - 0x6c, 0x54, 0x79, 0x70, 0x65, 0x12, 0x14, 0x0a, 0x05, 0x71, 0x75, 0x65, 0x72, 0x79, 0x18, 0x03, - 0x20, 0x01, 0x28, 0x0c, 0x52, 0x05, 0x71, 0x75, 0x65, 0x72, 0x79, 0x12, 0x21, 0x0a, 0x0c, 0x66, - 0x69, 0x6e, 0x64, 0x5f, 0x6f, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x18, 0x04, 0x20, 0x01, 0x28, - 0x0c, 0x52, 0x0b, 0x66, 0x69, 0x6e, 0x64, 0x4f, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x22, 0x6b, - 0x0a, 0x1f, 0x4d, 0x6f, 0x64, 0x65, 0x6c, 0x53, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x56, 0x32, - 0x44, 0x65, 0x6c, 0x65, 0x74, 0x65, 0x42, 0x79, 0x49, 0x64, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, - 0x74, 0x12, 0x19, 0x0a, 0x08, 0x6e, 0x6f, 0x64, 0x65, 0x5f, 0x6b, 0x65, 0x79, 0x18, 0x01, 0x20, - 0x01, 0x28, 0x09, 0x52, 0x07, 0x6e, 0x6f, 0x64, 0x65, 0x4b, 0x65, 0x79, 0x12, 0x1d, 0x0a, 0x0a, - 0x6d, 0x6f, 0x64, 0x65, 0x6c, 0x5f, 0x74, 0x79, 0x70, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, - 0x52, 0x09, 0x6d, 0x6f, 0x64, 0x65, 0x6c, 0x54, 0x79, 0x70, 0x65, 0x12, 0x0e, 0x0a, 0x02, 0x69, - 0x64, 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, 0x52, 0x02, 0x69, 0x64, 0x22, 0x70, 0x0a, 0x1e, 0x4d, - 0x6f, 0x64, 0x65, 0x6c, 0x53, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x56, 0x32, 0x44, 0x65, 0x6c, - 0x65, 0x74, 0x65, 0x4f, 0x6e, 0x65, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x19, 0x0a, - 0x08, 0x6e, 0x6f, 0x64, 0x65, 0x5f, 0x6b, 0x65, 0x79, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, - 0x07, 0x6e, 0x6f, 0x64, 0x65, 0x4b, 0x65, 0x79, 0x12, 0x1d, 0x0a, 0x0a, 0x6d, 0x6f, 0x64, 0x65, - 0x6c, 0x5f, 0x74, 0x79, 0x70, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x09, 0x6d, 0x6f, - 0x64, 0x65, 0x6c, 0x54, 0x79, 0x70, 0x65, 0x12, 0x14, 0x0a, 0x05, 0x71, 0x75, 0x65, 0x72, 0x79, - 0x18, 0x03, 0x20, 0x01, 0x28, 0x0c, 0x52, 0x05, 0x71, 0x75, 0x65, 0x72, 0x79, 0x22, 0x71, 0x0a, - 0x1f, 0x4d, 0x6f, 0x64, 0x65, 0x6c, 0x53, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x56, 0x32, 0x44, - 0x65, 0x6c, 0x65, 0x74, 0x65, 0x4d, 0x61, 0x6e, 0x79, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, - 0x12, 0x19, 0x0a, 0x08, 0x6e, 0x6f, 0x64, 0x65, 0x5f, 0x6b, 0x65, 0x79, 0x18, 0x01, 0x20, 0x01, - 0x28, 0x09, 0x52, 0x07, 0x6e, 0x6f, 0x64, 0x65, 0x4b, 0x65, 0x79, 0x12, 0x1d, 0x0a, 0x0a, 0x6d, - 0x6f, 0x64, 0x65, 0x6c, 0x5f, 0x74, 0x79, 0x70, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, - 0x09, 0x6d, 0x6f, 0x64, 0x65, 0x6c, 0x54, 0x79, 0x70, 0x65, 0x12, 0x14, 0x0a, 0x05, 0x71, 0x75, - 0x65, 0x72, 0x79, 0x18, 0x03, 0x20, 0x01, 0x28, 0x0c, 0x52, 0x05, 0x71, 0x75, 0x65, 0x72, 0x79, - 0x22, 0x83, 0x01, 0x0a, 0x1f, 0x4d, 0x6f, 0x64, 0x65, 0x6c, 0x53, 0x65, 0x72, 0x76, 0x69, 0x63, - 0x65, 0x56, 0x32, 0x55, 0x70, 0x64, 0x61, 0x74, 0x65, 0x42, 0x79, 0x49, 0x64, 0x52, 0x65, 0x71, - 0x75, 0x65, 0x73, 0x74, 0x12, 0x19, 0x0a, 0x08, 0x6e, 0x6f, 0x64, 0x65, 0x5f, 0x6b, 0x65, 0x79, - 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x07, 0x6e, 0x6f, 0x64, 0x65, 0x4b, 0x65, 0x79, 0x12, - 0x1d, 0x0a, 0x0a, 0x6d, 0x6f, 0x64, 0x65, 0x6c, 0x5f, 0x74, 0x79, 0x70, 0x65, 0x18, 0x02, 0x20, - 0x01, 0x28, 0x09, 0x52, 0x09, 0x6d, 0x6f, 0x64, 0x65, 0x6c, 0x54, 0x79, 0x70, 0x65, 0x12, 0x0e, - 0x0a, 0x02, 0x69, 0x64, 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, 0x52, 0x02, 0x69, 0x64, 0x12, 0x16, - 0x0a, 0x06, 0x75, 0x70, 0x64, 0x61, 0x74, 0x65, 0x18, 0x04, 0x20, 0x01, 0x28, 0x0c, 0x52, 0x06, - 0x75, 0x70, 0x64, 0x61, 0x74, 0x65, 0x22, 0x88, 0x01, 0x0a, 0x1e, 0x4d, 0x6f, 0x64, 0x65, 0x6c, - 0x53, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x56, 0x32, 0x55, 0x70, 0x64, 0x61, 0x74, 0x65, 0x4f, - 0x6e, 0x65, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x19, 0x0a, 0x08, 0x6e, 0x6f, 0x64, - 0x65, 0x5f, 0x6b, 0x65, 0x79, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x07, 0x6e, 0x6f, 0x64, - 0x65, 0x4b, 0x65, 0x79, 0x12, 0x1d, 0x0a, 0x0a, 0x6d, 0x6f, 0x64, 0x65, 0x6c, 0x5f, 0x74, 0x79, - 0x70, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x09, 0x6d, 0x6f, 0x64, 0x65, 0x6c, 0x54, - 0x79, 0x70, 0x65, 0x12, 0x14, 0x0a, 0x05, 0x71, 0x75, 0x65, 0x72, 0x79, 0x18, 0x03, 0x20, 0x01, - 0x28, 0x0c, 0x52, 0x05, 0x71, 0x75, 0x65, 0x72, 0x79, 0x12, 0x16, 0x0a, 0x06, 0x75, 0x70, 0x64, - 0x61, 0x74, 0x65, 0x18, 0x04, 0x20, 0x01, 0x28, 0x0c, 0x52, 0x06, 0x75, 0x70, 0x64, 0x61, 0x74, - 0x65, 0x22, 0x89, 0x01, 0x0a, 0x1f, 0x4d, 0x6f, 0x64, 0x65, 0x6c, 0x53, 0x65, 0x72, 0x76, 0x69, - 0x63, 0x65, 0x56, 0x32, 0x55, 0x70, 0x64, 0x61, 0x74, 0x65, 0x4d, 0x61, 0x6e, 0x79, 0x52, 0x65, - 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x19, 0x0a, 0x08, 0x6e, 0x6f, 0x64, 0x65, 0x5f, 0x6b, 0x65, - 0x79, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x07, 0x6e, 0x6f, 0x64, 0x65, 0x4b, 0x65, 0x79, - 0x12, 0x1d, 0x0a, 0x0a, 0x6d, 0x6f, 0x64, 0x65, 0x6c, 0x5f, 0x74, 0x79, 0x70, 0x65, 0x18, 0x02, - 0x20, 0x01, 0x28, 0x09, 0x52, 0x09, 0x6d, 0x6f, 0x64, 0x65, 0x6c, 0x54, 0x79, 0x70, 0x65, 0x12, - 0x14, 0x0a, 0x05, 0x71, 0x75, 0x65, 0x72, 0x79, 0x18, 0x03, 0x20, 0x01, 0x28, 0x0c, 0x52, 0x05, - 0x71, 0x75, 0x65, 0x72, 0x79, 0x12, 0x16, 0x0a, 0x06, 0x75, 0x70, 0x64, 0x61, 0x74, 0x65, 0x18, - 0x04, 0x20, 0x01, 0x28, 0x0c, 0x52, 0x06, 0x75, 0x70, 0x64, 0x61, 0x74, 0x65, 0x22, 0x82, 0x01, - 0x0a, 0x20, 0x4d, 0x6f, 0x64, 0x65, 0x6c, 0x53, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x56, 0x32, - 0x52, 0x65, 0x70, 0x6c, 0x61, 0x63, 0x65, 0x42, 0x79, 0x49, 0x64, 0x52, 0x65, 0x71, 0x75, 0x65, - 0x73, 0x74, 0x12, 0x19, 0x0a, 0x08, 0x6e, 0x6f, 0x64, 0x65, 0x5f, 0x6b, 0x65, 0x79, 0x18, 0x01, - 0x20, 0x01, 0x28, 0x09, 0x52, 0x07, 0x6e, 0x6f, 0x64, 0x65, 0x4b, 0x65, 0x79, 0x12, 0x1d, 0x0a, - 0x0a, 0x6d, 0x6f, 0x64, 0x65, 0x6c, 0x5f, 0x74, 0x79, 0x70, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, - 0x09, 0x52, 0x09, 0x6d, 0x6f, 0x64, 0x65, 0x6c, 0x54, 0x79, 0x70, 0x65, 0x12, 0x0e, 0x0a, 0x02, - 0x69, 0x64, 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, 0x52, 0x02, 0x69, 0x64, 0x12, 0x14, 0x0a, 0x05, - 0x6d, 0x6f, 0x64, 0x65, 0x6c, 0x18, 0x04, 0x20, 0x01, 0x28, 0x0c, 0x52, 0x05, 0x6d, 0x6f, 0x64, - 0x65, 0x6c, 0x22, 0x87, 0x01, 0x0a, 0x1f, 0x4d, 0x6f, 0x64, 0x65, 0x6c, 0x53, 0x65, 0x72, 0x76, - 0x69, 0x63, 0x65, 0x56, 0x32, 0x52, 0x65, 0x70, 0x6c, 0x61, 0x63, 0x65, 0x4f, 0x6e, 0x65, 0x52, - 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x19, 0x0a, 0x08, 0x6e, 0x6f, 0x64, 0x65, 0x5f, 0x6b, - 0x65, 0x79, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x07, 0x6e, 0x6f, 0x64, 0x65, 0x4b, 0x65, - 0x79, 0x12, 0x1d, 0x0a, 0x0a, 0x6d, 0x6f, 0x64, 0x65, 0x6c, 0x5f, 0x74, 0x79, 0x70, 0x65, 0x18, - 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x09, 0x6d, 0x6f, 0x64, 0x65, 0x6c, 0x54, 0x79, 0x70, 0x65, - 0x12, 0x14, 0x0a, 0x05, 0x71, 0x75, 0x65, 0x72, 0x79, 0x18, 0x03, 0x20, 0x01, 0x28, 0x0c, 0x52, - 0x05, 0x71, 0x75, 0x65, 0x72, 0x79, 0x12, 0x14, 0x0a, 0x05, 0x6d, 0x6f, 0x64, 0x65, 0x6c, 0x18, - 0x04, 0x20, 0x01, 0x28, 0x0c, 0x52, 0x05, 0x6d, 0x6f, 0x64, 0x65, 0x6c, 0x22, 0x70, 0x0a, 0x1e, - 0x4d, 0x6f, 0x64, 0x65, 0x6c, 0x53, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x56, 0x32, 0x49, 0x6e, - 0x73, 0x65, 0x72, 0x74, 0x4f, 0x6e, 0x65, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x19, - 0x0a, 0x08, 0x6e, 0x6f, 0x64, 0x65, 0x5f, 0x6b, 0x65, 0x79, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, - 0x52, 0x07, 0x6e, 0x6f, 0x64, 0x65, 0x4b, 0x65, 0x79, 0x12, 0x1d, 0x0a, 0x0a, 0x6d, 0x6f, 0x64, - 0x65, 0x6c, 0x5f, 0x74, 0x79, 0x70, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x09, 0x6d, - 0x6f, 0x64, 0x65, 0x6c, 0x54, 0x79, 0x70, 0x65, 0x12, 0x14, 0x0a, 0x05, 0x6d, 0x6f, 0x64, 0x65, - 0x6c, 0x18, 0x03, 0x20, 0x01, 0x28, 0x0c, 0x52, 0x05, 0x6d, 0x6f, 0x64, 0x65, 0x6c, 0x22, 0x73, - 0x0a, 0x1f, 0x4d, 0x6f, 0x64, 0x65, 0x6c, 0x53, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x56, 0x32, - 0x49, 0x6e, 0x73, 0x65, 0x72, 0x74, 0x4d, 0x61, 0x6e, 0x79, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, - 0x74, 0x12, 0x19, 0x0a, 0x08, 0x6e, 0x6f, 0x64, 0x65, 0x5f, 0x6b, 0x65, 0x79, 0x18, 0x01, 0x20, - 0x01, 0x28, 0x09, 0x52, 0x07, 0x6e, 0x6f, 0x64, 0x65, 0x4b, 0x65, 0x79, 0x12, 0x1d, 0x0a, 0x0a, - 0x6d, 0x6f, 0x64, 0x65, 0x6c, 0x5f, 0x74, 0x79, 0x70, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, - 0x52, 0x09, 0x6d, 0x6f, 0x64, 0x65, 0x6c, 0x54, 0x79, 0x70, 0x65, 0x12, 0x16, 0x0a, 0x06, 0x6d, - 0x6f, 0x64, 0x65, 0x6c, 0x73, 0x18, 0x03, 0x20, 0x01, 0x28, 0x0c, 0x52, 0x06, 0x6d, 0x6f, 0x64, - 0x65, 0x6c, 0x73, 0x22, 0x6c, 0x0a, 0x1a, 0x4d, 0x6f, 0x64, 0x65, 0x6c, 0x53, 0x65, 0x72, 0x76, - 0x69, 0x63, 0x65, 0x56, 0x32, 0x43, 0x6f, 0x75, 0x6e, 0x74, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, - 0x74, 0x12, 0x19, 0x0a, 0x08, 0x6e, 0x6f, 0x64, 0x65, 0x5f, 0x6b, 0x65, 0x79, 0x18, 0x01, 0x20, - 0x01, 0x28, 0x09, 0x52, 0x07, 0x6e, 0x6f, 0x64, 0x65, 0x4b, 0x65, 0x79, 0x12, 0x1d, 0x0a, 0x0a, - 0x6d, 0x6f, 0x64, 0x65, 0x6c, 0x5f, 0x74, 0x79, 0x70, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, - 0x52, 0x09, 0x6d, 0x6f, 0x64, 0x65, 0x6c, 0x54, 0x79, 0x70, 0x65, 0x12, 0x14, 0x0a, 0x05, 0x71, - 0x75, 0x65, 0x72, 0x79, 0x18, 0x03, 0x20, 0x01, 0x28, 0x0c, 0x52, 0x05, 0x71, 0x75, 0x65, 0x72, - 0x79, 0x42, 0x08, 0x5a, 0x06, 0x2e, 0x3b, 0x67, 0x72, 0x70, 0x63, 0x62, 0x06, 0x70, 0x72, 0x6f, - 0x74, 0x6f, 0x33, -} - -var ( - file_entity_model_service_v2_request_proto_rawDescOnce sync.Once - file_entity_model_service_v2_request_proto_rawDescData = file_entity_model_service_v2_request_proto_rawDesc -) - -func file_entity_model_service_v2_request_proto_rawDescGZIP() []byte { - file_entity_model_service_v2_request_proto_rawDescOnce.Do(func() { - file_entity_model_service_v2_request_proto_rawDescData = protoimpl.X.CompressGZIP(file_entity_model_service_v2_request_proto_rawDescData) - }) - return file_entity_model_service_v2_request_proto_rawDescData -} - -var file_entity_model_service_v2_request_proto_msgTypes = make([]protoimpl.MessageInfo, 14) -var file_entity_model_service_v2_request_proto_goTypes = []any{ - (*ModelServiceV2GetByIdRequest)(nil), // 0: grpc.ModelServiceV2GetByIdRequest - (*ModelServiceV2GetOneRequest)(nil), // 1: grpc.ModelServiceV2GetOneRequest - (*ModelServiceV2GetManyRequest)(nil), // 2: grpc.ModelServiceV2GetManyRequest - (*ModelServiceV2DeleteByIdRequest)(nil), // 3: grpc.ModelServiceV2DeleteByIdRequest - (*ModelServiceV2DeleteOneRequest)(nil), // 4: grpc.ModelServiceV2DeleteOneRequest - (*ModelServiceV2DeleteManyRequest)(nil), // 5: grpc.ModelServiceV2DeleteManyRequest - (*ModelServiceV2UpdateByIdRequest)(nil), // 6: grpc.ModelServiceV2UpdateByIdRequest - (*ModelServiceV2UpdateOneRequest)(nil), // 7: grpc.ModelServiceV2UpdateOneRequest - (*ModelServiceV2UpdateManyRequest)(nil), // 8: grpc.ModelServiceV2UpdateManyRequest - (*ModelServiceV2ReplaceByIdRequest)(nil), // 9: grpc.ModelServiceV2ReplaceByIdRequest - (*ModelServiceV2ReplaceOneRequest)(nil), // 10: grpc.ModelServiceV2ReplaceOneRequest - (*ModelServiceV2InsertOneRequest)(nil), // 11: grpc.ModelServiceV2InsertOneRequest - (*ModelServiceV2InsertManyRequest)(nil), // 12: grpc.ModelServiceV2InsertManyRequest - (*ModelServiceV2CountRequest)(nil), // 13: grpc.ModelServiceV2CountRequest -} -var file_entity_model_service_v2_request_proto_depIdxs = []int32{ - 0, // [0:0] is the sub-list for method output_type - 0, // [0:0] 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_entity_model_service_v2_request_proto_init() } -func file_entity_model_service_v2_request_proto_init() { - if File_entity_model_service_v2_request_proto != nil { - return - } - if !protoimpl.UnsafeEnabled { - file_entity_model_service_v2_request_proto_msgTypes[0].Exporter = func(v any, i int) any { - switch v := v.(*ModelServiceV2GetByIdRequest); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_entity_model_service_v2_request_proto_msgTypes[1].Exporter = func(v any, i int) any { - switch v := v.(*ModelServiceV2GetOneRequest); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_entity_model_service_v2_request_proto_msgTypes[2].Exporter = func(v any, i int) any { - switch v := v.(*ModelServiceV2GetManyRequest); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_entity_model_service_v2_request_proto_msgTypes[3].Exporter = func(v any, i int) any { - switch v := v.(*ModelServiceV2DeleteByIdRequest); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_entity_model_service_v2_request_proto_msgTypes[4].Exporter = func(v any, i int) any { - switch v := v.(*ModelServiceV2DeleteOneRequest); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_entity_model_service_v2_request_proto_msgTypes[5].Exporter = func(v any, i int) any { - switch v := v.(*ModelServiceV2DeleteManyRequest); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_entity_model_service_v2_request_proto_msgTypes[6].Exporter = func(v any, i int) any { - switch v := v.(*ModelServiceV2UpdateByIdRequest); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_entity_model_service_v2_request_proto_msgTypes[7].Exporter = func(v any, i int) any { - switch v := v.(*ModelServiceV2UpdateOneRequest); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_entity_model_service_v2_request_proto_msgTypes[8].Exporter = func(v any, i int) any { - switch v := v.(*ModelServiceV2UpdateManyRequest); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_entity_model_service_v2_request_proto_msgTypes[9].Exporter = func(v any, i int) any { - switch v := v.(*ModelServiceV2ReplaceByIdRequest); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_entity_model_service_v2_request_proto_msgTypes[10].Exporter = func(v any, i int) any { - switch v := v.(*ModelServiceV2ReplaceOneRequest); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_entity_model_service_v2_request_proto_msgTypes[11].Exporter = func(v any, i int) any { - switch v := v.(*ModelServiceV2InsertOneRequest); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_entity_model_service_v2_request_proto_msgTypes[12].Exporter = func(v any, i int) any { - switch v := v.(*ModelServiceV2InsertManyRequest); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_entity_model_service_v2_request_proto_msgTypes[13].Exporter = func(v any, i int) any { - switch v := v.(*ModelServiceV2CountRequest); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - } - type x struct{} - out := protoimpl.TypeBuilder{ - File: protoimpl.DescBuilder{ - GoPackagePath: reflect.TypeOf(x{}).PkgPath(), - RawDescriptor: file_entity_model_service_v2_request_proto_rawDesc, - NumEnums: 0, - NumMessages: 14, - NumExtensions: 0, - NumServices: 0, - }, - GoTypes: file_entity_model_service_v2_request_proto_goTypes, - DependencyIndexes: file_entity_model_service_v2_request_proto_depIdxs, - MessageInfos: file_entity_model_service_v2_request_proto_msgTypes, - }.Build() - File_entity_model_service_v2_request_proto = out.File - file_entity_model_service_v2_request_proto_rawDesc = nil - file_entity_model_service_v2_request_proto_goTypes = nil - file_entity_model_service_v2_request_proto_depIdxs = nil -} diff --git a/grpc/proto/entity/model_service_v2_request.proto b/grpc/proto/entity/model_service_request.proto similarity index 67% rename from grpc/proto/entity/model_service_v2_request.proto rename to grpc/proto/entity/model_service_request.proto index f2933ca7..47aa8677 100644 --- a/grpc/proto/entity/model_service_v2_request.proto +++ b/grpc/proto/entity/model_service_request.proto @@ -3,92 +3,92 @@ syntax = "proto3"; package grpc; option go_package = ".;grpc"; -message ModelServiceV2GetByIdRequest { +message ModelServiceGetByIdRequest { string node_key = 1; string model_type = 2; string id = 3; } -message ModelServiceV2GetOneRequest { +message ModelServiceGetOneRequest { string node_key = 1; string model_type = 2; bytes query = 3; bytes find_options = 4; } -message ModelServiceV2GetManyRequest { +message ModelServiceGetManyRequest { string node_key = 1; string model_type = 2; bytes query = 3; bytes find_options = 4; } -message ModelServiceV2DeleteByIdRequest { +message ModelServiceDeleteByIdRequest { string node_key = 1; string model_type = 2; string id = 3; } -message ModelServiceV2DeleteOneRequest { +message ModelServiceDeleteOneRequest { string node_key = 1; string model_type = 2; bytes query = 3; } -message ModelServiceV2DeleteManyRequest { +message ModelServiceDeleteManyRequest { string node_key = 1; string model_type = 2; bytes query = 3; } -message ModelServiceV2UpdateByIdRequest { +message ModelServiceUpdateByIdRequest { string node_key = 1; string model_type = 2; string id = 3; bytes update = 4; } -message ModelServiceV2UpdateOneRequest { +message ModelServiceUpdateOneRequest { string node_key = 1; string model_type = 2; bytes query = 3; bytes update = 4; } -message ModelServiceV2UpdateManyRequest { +message ModelServiceUpdateManyRequest { string node_key = 1; string model_type = 2; bytes query = 3; bytes update = 4; } -message ModelServiceV2ReplaceByIdRequest { +message ModelServiceReplaceByIdRequest { string node_key = 1; string model_type = 2; string id = 3; bytes model = 4; } -message ModelServiceV2ReplaceOneRequest { +message ModelServiceReplaceOneRequest { string node_key = 1; string model_type = 2; bytes query = 3; bytes model = 4; } -message ModelServiceV2InsertOneRequest { +message ModelServiceInsertOneRequest { string node_key = 1; string model_type = 2; bytes model = 3; } -message ModelServiceV2InsertManyRequest { +message ModelServiceInsertManyRequest { string node_key = 1; string model_type = 2; bytes models = 3; } -message ModelServiceV2CountRequest { +message ModelServiceCountRequest { string node_key = 1; string model_type = 2; bytes query = 3; diff --git a/grpc/proto/services/dependency_service.proto b/grpc/proto/services/dependency_service.proto new file mode 100644 index 00000000..1309333e --- /dev/null +++ b/grpc/proto/services/dependency_service.proto @@ -0,0 +1,46 @@ +syntax = "proto3"; + +import "entity/response.proto"; + +package grpc; +option go_package = ".;grpc"; + +message Dependency { + string name = 1; + string version = 2; +} + +message DependencyServiceConnectRequest { + string node_key = 1; +} + +enum DependencyServiceCode { + SYNC = 0; + INSTALL = 1; + UNINSTALL = 2; +} + +message DependencyServiceConnectResponse { + DependencyServiceCode code = 1; + string task_id = 2; + string lang = 3; + string proxy = 4; + repeated Dependency dependencies = 5; +} + +message DependencyServiceSyncRequest { + string node_key = 1; + string lang = 2; + repeated Dependency dependencies = 3; +} + +message DependencyServiceUpdateTaskLogRequest { + string task_id = 1; + repeated string log_lines = 2; +} + +service DependencyService { + rpc Connect(DependencyServiceConnectRequest) returns (stream DependencyServiceConnectResponse){}; + rpc Sync(DependencyServiceSyncRequest) returns (Response){}; + rpc UpdateTaskLog(stream DependencyServiceUpdateTaskLogRequest) returns (Response){}; +} diff --git a/grpc/proto/services/dependency_service_v2.proto b/grpc/proto/services/dependency_service_v2.proto deleted file mode 100644 index 6978beb9..00000000 --- a/grpc/proto/services/dependency_service_v2.proto +++ /dev/null @@ -1,46 +0,0 @@ -syntax = "proto3"; - -import "entity/response.proto"; - -package grpc; -option go_package = ".;grpc"; - -message Dependency { - string name = 1; - string version = 2; -} - -message DependencyServiceV2ConnectRequest { - string node_key = 1; -} - -enum DependencyServiceV2Code { - SYNC = 0; - INSTALL = 1; - UNINSTALL = 2; -} - -message DependencyServiceV2ConnectResponse { - DependencyServiceV2Code code = 1; - string task_id = 2; - string lang = 3; - string proxy = 4; - repeated Dependency dependencies = 5; -} - -message DependencyServiceV2SyncRequest { - string node_key = 1; - string lang = 2; - repeated Dependency dependencies = 3; -} - -message DependencyServiceV2UpdateTaskLogRequest { - string task_id = 1; - repeated string log_lines = 2; -} - -service DependencyServiceV2 { - rpc Connect(DependencyServiceV2ConnectRequest) returns (stream DependencyServiceV2ConnectResponse){}; - rpc Sync(DependencyServiceV2SyncRequest) returns (Response){}; - rpc UpdateTaskLog(stream DependencyServiceV2UpdateTaskLogRequest) returns (Response){}; -} diff --git a/grpc/proto/services/metric_service_v2.proto b/grpc/proto/services/metric_service.proto similarity index 82% rename from grpc/proto/services/metric_service_v2.proto rename to grpc/proto/services/metric_service.proto index 2e47a2d6..3162b8cd 100644 --- a/grpc/proto/services/metric_service_v2.proto +++ b/grpc/proto/services/metric_service.proto @@ -5,7 +5,7 @@ import "entity/response.proto"; package grpc; option go_package = ".;grpc"; -message MetricServiceV2SendRequest { +message MetricServiceSendRequest { string type = 1; string node_key = 2; int64 timestamp = 3; @@ -24,6 +24,6 @@ message MetricServiceV2SendRequest { float network_bytes_recv_rate = 18; } -service MetricServiceV2 { - rpc Send(MetricServiceV2SendRequest) returns (Response){}; +service MetricService { + rpc Send(MetricServiceSendRequest) returns (Response){}; } diff --git a/grpc/proto/services/model_base_service.proto b/grpc/proto/services/model_base_service.proto new file mode 100644 index 00000000..05f0b1a3 --- /dev/null +++ b/grpc/proto/services/model_base_service.proto @@ -0,0 +1,24 @@ +syntax = "proto3"; + +import "entity/model_service_request.proto"; +import "entity/response.proto"; + +package grpc; +option go_package = ".;grpc"; + +service ModelBaseService { + rpc GetById(ModelServiceGetByIdRequest) returns (Response){}; + rpc GetOne(ModelServiceGetOneRequest) returns (Response){}; + rpc GetMany(ModelServiceGetManyRequest) returns (Response){}; + rpc DeleteById(ModelServiceDeleteByIdRequest) returns (Response){}; + rpc DeleteOne(ModelServiceDeleteOneRequest) returns (Response){}; + rpc DeleteMany(ModelServiceDeleteManyRequest) returns (Response){}; + rpc UpdateById(ModelServiceUpdateByIdRequest) returns (Response){}; + rpc UpdateOne(ModelServiceUpdateOneRequest) returns (Response){}; + rpc UpdateMany(ModelServiceUpdateManyRequest) returns (Response){}; + rpc ReplaceById(ModelServiceReplaceByIdRequest) returns (Response){}; + rpc ReplaceOne(ModelServiceReplaceOneRequest) returns (Response){}; + rpc InsertOne(ModelServiceInsertOneRequest) returns (Response){}; + rpc InsertMany(ModelServiceInsertManyRequest) returns (Response){}; + rpc Count(ModelServiceCountRequest) returns (Response){}; +} diff --git a/grpc/proto/services/model_base_service_v2.proto b/grpc/proto/services/model_base_service_v2.proto deleted file mode 100644 index e0b309f7..00000000 --- a/grpc/proto/services/model_base_service_v2.proto +++ /dev/null @@ -1,24 +0,0 @@ -syntax = "proto3"; - -import "entity/model_service_v2_request.proto"; -import "entity/response.proto"; - -package grpc; -option go_package = ".;grpc"; - -service ModelBaseServiceV2 { - rpc GetById(ModelServiceV2GetByIdRequest) returns (Response){}; - rpc GetOne(ModelServiceV2GetOneRequest) returns (Response){}; - rpc GetMany(ModelServiceV2GetManyRequest) returns (Response){}; - rpc DeleteById(ModelServiceV2DeleteByIdRequest) returns (Response){}; - rpc DeleteOne(ModelServiceV2DeleteOneRequest) returns (Response){}; - rpc DeleteMany(ModelServiceV2DeleteManyRequest) returns (Response){}; - rpc UpdateById(ModelServiceV2UpdateByIdRequest) returns (Response){}; - rpc UpdateOne(ModelServiceV2UpdateOneRequest) returns (Response){}; - rpc UpdateMany(ModelServiceV2UpdateManyRequest) returns (Response){}; - rpc ReplaceById(ModelServiceV2ReplaceByIdRequest) returns (Response){}; - rpc ReplaceOne(ModelServiceV2ReplaceOneRequest) returns (Response){}; - rpc InsertOne(ModelServiceV2InsertOneRequest) returns (Response){}; - rpc InsertMany(ModelServiceV2InsertManyRequest) returns (Response){}; - rpc Count(ModelServiceV2CountRequest) returns (Response){}; -}