From 4cd88ab4f33df74fdc622600b5452974a66ed49a Mon Sep 17 00:00:00 2001 From: MuZhou233 Date: Mon, 12 Feb 2024 16:39:17 +0000 Subject: [PATCH] feat: remove mapper --- app/mapper/cmd/mapper/wire_gen.go | 2 +- app/mapper/pkg/service/wire_gen.go | 2 +- app/miner/cmd/miner/wire_gen.go | 2 +- app/miner/pkg/service/wire_gen.go | 2 +- app/searcher/cmd/searcher/wire_gen.go | 2 +- app/searcher/pkg/service/wire_gen.go | 2 +- app/sephirah/cmd/sephirah/wire_gen.go | 18 +++----- app/sephirah/internal/biz/bizangela/angela.go | 19 ++++----- app/sephirah/internal/biz/bizbinah/binah.go | 7 ++-- app/sephirah/internal/biz/bizgebura/app.go | 17 ++++---- .../internal/biz/bizgebura/app_package.go | 22 +++++----- app/sephirah/internal/biz/bizgebura/gebura.go | 15 ++++--- .../internal/biz/biztiphereth/tiphereth.go | 41 +++++++++---------- .../internal/biz/biztiphereth/user.go | 19 ++++----- .../internal/biz/bizyesod/feed_config.go | 17 ++++---- app/sephirah/internal/biz/bizyesod/yesod.go | 15 ++++--- app/sephirah/pkg/service/wire.go | 3 +- app/sephirah/pkg/service/wire_gen.go | 21 +++++----- cmd/librarian/main.go | 23 +++++------ cmd/librarian/wire.go | 3 +- cmd/librarian/wire_gen.go | 39 ++++-------------- configs/example-for-single-node.yaml | 4 -- configs/example-for-testing.yaml | 4 -- go.mod | 2 +- go.sum | 17 ++++++-- internal/inprocgrpc/inprocgrpc.go | 19 ++++----- 26 files changed, 148 insertions(+), 189 deletions(-) diff --git a/app/mapper/cmd/mapper/wire_gen.go b/app/mapper/cmd/mapper/wire_gen.go index baf49f5d..a2dff533 100644 --- a/app/mapper/cmd/mapper/wire_gen.go +++ b/app/mapper/cmd/mapper/wire_gen.go @@ -1,6 +1,6 @@ // Code generated by Wire. DO NOT EDIT. -//go:generate go run github.com/google/wire/cmd/wire +//go:generate go run -mod=mod github.com/google/wire/cmd/wire //go:build !wireinject // +build !wireinject diff --git a/app/mapper/pkg/service/wire_gen.go b/app/mapper/pkg/service/wire_gen.go index 74e62127..9adc20c4 100644 --- a/app/mapper/pkg/service/wire_gen.go +++ b/app/mapper/pkg/service/wire_gen.go @@ -1,6 +1,6 @@ // Code generated by Wire. DO NOT EDIT. -//go:generate go run github.com/google/wire/cmd/wire +//go:generate go run -mod=mod github.com/google/wire/cmd/wire //go:build !wireinject // +build !wireinject diff --git a/app/miner/cmd/miner/wire_gen.go b/app/miner/cmd/miner/wire_gen.go index 905af6cc..65e12784 100644 --- a/app/miner/cmd/miner/wire_gen.go +++ b/app/miner/cmd/miner/wire_gen.go @@ -1,6 +1,6 @@ // Code generated by Wire. DO NOT EDIT. -//go:generate go run github.com/google/wire/cmd/wire +//go:generate go run -mod=mod github.com/google/wire/cmd/wire //go:build !wireinject // +build !wireinject diff --git a/app/miner/pkg/service/wire_gen.go b/app/miner/pkg/service/wire_gen.go index e1bd4032..cb7c0e9b 100644 --- a/app/miner/pkg/service/wire_gen.go +++ b/app/miner/pkg/service/wire_gen.go @@ -1,6 +1,6 @@ // Code generated by Wire. DO NOT EDIT. -//go:generate go run github.com/google/wire/cmd/wire +//go:generate go run -mod=mod github.com/google/wire/cmd/wire //go:build !wireinject // +build !wireinject diff --git a/app/searcher/cmd/searcher/wire_gen.go b/app/searcher/cmd/searcher/wire_gen.go index ae6b051b..8d1060e2 100644 --- a/app/searcher/cmd/searcher/wire_gen.go +++ b/app/searcher/cmd/searcher/wire_gen.go @@ -1,6 +1,6 @@ // Code generated by Wire. DO NOT EDIT. -//go:generate go run github.com/google/wire/cmd/wire +//go:generate go run -mod=mod github.com/google/wire/cmd/wire //go:build !wireinject // +build !wireinject diff --git a/app/searcher/pkg/service/wire_gen.go b/app/searcher/pkg/service/wire_gen.go index c98e7e47..c4f27300 100644 --- a/app/searcher/pkg/service/wire_gen.go +++ b/app/searcher/pkg/service/wire_gen.go @@ -1,6 +1,6 @@ // Code generated by Wire. DO NOT EDIT. -//go:generate go run github.com/google/wire/cmd/wire +//go:generate go run -mod=mod github.com/google/wire/cmd/wire //go:build !wireinject // +build !wireinject diff --git a/app/sephirah/cmd/sephirah/wire_gen.go b/app/sephirah/cmd/sephirah/wire_gen.go index 92866827..e5fe1521 100644 --- a/app/sephirah/cmd/sephirah/wire_gen.go +++ b/app/sephirah/cmd/sephirah/wire_gen.go @@ -1,6 +1,6 @@ // Code generated by Wire. DO NOT EDIT. -//go:generate go run github.com/google/wire/cmd/wire +//go:generate go run -mod=mod github.com/google/wire/cmd/wire //go:build !wireinject // +build !wireinject @@ -67,12 +67,6 @@ func wireApp(sephirah_Server *conf.Sephirah_Server, sephirah_Data *conf.Sephirah return nil, nil, err } geburaRepo := data.NewGeburaRepo(dataData) - librarianMapperServiceClient, err := client2.NewMapperClient(consul) - if err != nil { - cleanup2() - cleanup() - return nil, nil, err - } librarianSearcherServiceClient, err := client2.NewSearcherClient(consul) if err != nil { cleanup2() @@ -80,7 +74,7 @@ func wireApp(sephirah_Server *conf.Sephirah_Server, sephirah_Data *conf.Sephirah return nil, nil, err } searcher := client.NewSearcher(librarianSearcherServiceClient) - angelaBase, err := bizangela.NewAngelaBase(angelaRepo, supervisorSupervisor, geburaRepo, librarianMapperServiceClient, librarianPorterServiceClient, searcher) + angelaBase, err := bizangela.NewAngelaBase(angelaRepo, supervisorSupervisor, geburaRepo, librarianPorterServiceClient, searcher) if err != nil { cleanup2() cleanup() @@ -113,13 +107,13 @@ func wireApp(sephirah_Server *conf.Sephirah_Server, sephirah_Data *conf.Sephirah } tipherethRepo := data.NewTipherethRepo(dataData) cron := libcron.NewCron() - tiphereth, err := biztiphereth.NewTiphereth(settings, tipherethRepo, libauthAuth, supervisorSupervisor, librarianMapperServiceClient, searcher, topic3, cron) + tiphereth, err := biztiphereth.NewTiphereth(settings, tipherethRepo, libauthAuth, supervisorSupervisor, searcher, topic3, cron) if err != nil { cleanup2() cleanup() return nil, nil, err } - gebura := bizgebura.NewGebura(geburaRepo, libauthAuth, librarianMapperServiceClient, searcher, topic, libmqTopic, libcacheMap) + gebura := bizgebura.NewGebura(geburaRepo, libauthAuth, searcher, topic, libmqTopic, libcacheMap) binahRepo, err := data.NewBinahRepo(sephirah_Data) if err != nil { cleanup2() @@ -127,9 +121,9 @@ func wireApp(sephirah_Server *conf.Sephirah_Server, sephirah_Data *conf.Sephirah return nil, nil, err } controlBlock := bizbinah.NewControlBlock(libauthAuth) - binah := bizbinah.NewBinah(binahRepo, controlBlock, libauthAuth, librarianMapperServiceClient, librarianSearcherServiceClient) + binah := bizbinah.NewBinah(binahRepo, controlBlock, libauthAuth, librarianSearcherServiceClient) yesodRepo := data.NewYesodRepo(dataData) - yesod, err := bizyesod.NewYesod(yesodRepo, supervisorSupervisor, cron, librarianMapperServiceClient, searcher, topic7) + yesod, err := bizyesod.NewYesod(yesodRepo, supervisorSupervisor, cron, searcher, topic7) if err != nil { cleanup2() cleanup() diff --git a/app/sephirah/internal/biz/bizangela/angela.go b/app/sephirah/internal/biz/bizangela/angela.go index 3cc83008..18e03125 100644 --- a/app/sephirah/internal/biz/bizangela/angela.go +++ b/app/sephirah/internal/biz/bizangela/angela.go @@ -13,7 +13,6 @@ import ( "github.com/tuihub/librarian/internal/lib/libmq" "github.com/tuihub/librarian/internal/model" "github.com/tuihub/librarian/internal/model/modelfeed" - mapper "github.com/tuihub/protos/pkg/librarian/mapper/v1" porter "github.com/tuihub/protos/pkg/librarian/porter/v1" "github.com/google/wire" @@ -40,10 +39,10 @@ type Angela struct { mq *libmq.MQ } type AngelaBase struct { - repo AngelaRepo - supv *supervisor.Supervisor - g bizgebura.GeburaRepo - mapper mapper.LibrarianMapperServiceClient + repo AngelaRepo + supv *supervisor.Supervisor + g bizgebura.GeburaRepo + // mapper mapper.LibrarianMapperServiceClient searcher *client.Searcher porter porter.LibrarianPorterServiceClient } @@ -63,15 +62,15 @@ func NewAngelaBase( repo AngelaRepo, supv *supervisor.Supervisor, g bizgebura.GeburaRepo, - mClient mapper.LibrarianMapperServiceClient, + // mClient mapper.LibrarianMapperServiceClient, pClient porter.LibrarianPorterServiceClient, sClient *client.Searcher, ) (*AngelaBase, error) { return &AngelaBase{ - repo: repo, - supv: supv, - g: g, - mapper: mClient, + repo: repo, + supv: supv, + g: g, + //mapper: mClient, porter: pClient, searcher: sClient, }, nil diff --git a/app/sephirah/internal/biz/bizbinah/binah.go b/app/sephirah/internal/biz/bizbinah/binah.go index 2844c0df..ba81bbc5 100644 --- a/app/sephirah/internal/biz/bizbinah/binah.go +++ b/app/sephirah/internal/biz/bizbinah/binah.go @@ -7,7 +7,6 @@ import ( "github.com/tuihub/librarian/app/sephirah/internal/model/modelbinah" "github.com/tuihub/librarian/internal/lib/libauth" - mapper "github.com/tuihub/protos/pkg/librarian/mapper/v1" searcher "github.com/tuihub/protos/pkg/librarian/searcher/v1" ) @@ -15,7 +14,7 @@ type Binah struct { repo BinahRepo callback *modelbinah.ControlBlock auth *libauth.Auth - mapper mapper.LibrarianMapperServiceClient + // mapper mapper.LibrarianMapperServiceClient searcher searcher.LibrarianSearcherServiceClient } @@ -37,14 +36,14 @@ func NewBinah( repo BinahRepo, callback *modelbinah.ControlBlock, auth *libauth.Auth, - mClient mapper.LibrarianMapperServiceClient, + // mClient mapper.LibrarianMapperServiceClient, sClient searcher.LibrarianSearcherServiceClient, ) *Binah { return &Binah{ repo: repo, callback: callback, auth: auth, - mapper: mClient, + //mapper: mClient, searcher: sClient, } } diff --git a/app/sephirah/internal/biz/bizgebura/app.go b/app/sephirah/internal/biz/bizgebura/app.go index 65d9f219..77d1c86f 100644 --- a/app/sephirah/internal/biz/bizgebura/app.go +++ b/app/sephirah/internal/biz/bizgebura/app.go @@ -10,7 +10,6 @@ import ( "github.com/tuihub/librarian/app/sephirah/internal/model/modelgebura" "github.com/tuihub/librarian/internal/lib/libauth" "github.com/tuihub/librarian/internal/model" - mapper "github.com/tuihub/protos/pkg/librarian/mapper/v1" searcherpb "github.com/tuihub/protos/pkg/librarian/searcher/v1" pb "github.com/tuihub/protos/pkg/librarian/sephirah/v1" @@ -30,14 +29,14 @@ func (g *Gebura) CreateApp(ctx context.Context, app *modelgebura.App) (*modelgeb app.SourceAppID = strconv.FormatInt(int64(app.ID), 10) app.SourceURL = "" app.BoundInternal = app.ID - if _, err = g.mapper.InsertVertex(ctx, &mapper.InsertVertexRequest{ - VertexList: []*mapper.Vertex{{ - Vid: int64(app.ID), - Type: mapper.VertexType_VERTEX_TYPE_ABSTRACT, - }}, - }); err != nil { - return nil, pb.ErrorErrorReasonUnspecified("%s", err.Error()) - } + // if _, err = g.mapper.InsertVertex(ctx, &mapper.InsertVertexRequest{ + // VertexList: []*mapper.Vertex{{ + // Vid: int64(app.ID), + // Type: mapper.VertexType_VERTEX_TYPE_ABSTRACT, + // }}, + // }); err != nil { + // return nil, pb.ErrorErrorReasonUnspecified("%s", err.Error()) + //} if err = g.repo.CreateApp(ctx, app); err != nil { return nil, pb.ErrorErrorReasonUnspecified("%s", err.Error()) } diff --git a/app/sephirah/internal/biz/bizgebura/app_package.go b/app/sephirah/internal/biz/bizgebura/app_package.go index f52b9f74..bcc11e84 100644 --- a/app/sephirah/internal/biz/bizgebura/app_package.go +++ b/app/sephirah/internal/biz/bizgebura/app_package.go @@ -29,14 +29,14 @@ func (g *Gebura) CreateAppPackage( a.ID = id a.Source = modelgebura.AppPackageSourceManual a.SourceID = 0 - if _, err = g.mapper.InsertVertex(ctx, &mapper.InsertVertexRequest{ - VertexList: []*mapper.Vertex{{ - Vid: int64(a.ID), - Type: mapper.VertexType_VERTEX_TYPE_ABSTRACT, - }}, - }); err != nil { - return nil, pb.ErrorErrorReasonUnspecified("%s", err.Error()) - } + // if _, err = g.mapper.InsertVertex(ctx, &mapper.InsertVertexRequest{ + // VertexList: []*mapper.Vertex{{ + // Vid: int64(a.ID), + // Type: mapper.VertexType_VERTEX_TYPE_ABSTRACT, + // }}, + // }); err != nil { + // return nil, pb.ErrorErrorReasonUnspecified("%s", err.Error()) + //} if err = g.repo.CreateAppPackage(ctx, claims.UserID, a); err != nil { return nil, pb.ErrorErrorReasonUnspecified("%s", err.Error()) } @@ -145,9 +145,9 @@ func (r *reportAppPackageHandler) Handle(ctx context.Context, binaries []*modelg packages[i].SourceID = r.sourceID } if len(vl) > 0 { - if _, err = r.g.mapper.InsertVertex(ctx, &mapper.InsertVertexRequest{VertexList: vl}); err != nil { - return pb.ErrorErrorReasonUnspecified("%s", err.Error()) - } + // if _, err = r.g.mapper.InsertVertex(ctx, &mapper.InsertVertexRequest{VertexList: vl}); err != nil { + // return pb.ErrorErrorReasonUnspecified("%s", err.Error()) + //} if err = r.g.repo.UpsertAppPackages(ctx, r.sourceID, packages); err != nil { return pb.ErrorErrorReasonUnspecified("%s", err.Error()) } diff --git a/app/sephirah/internal/biz/bizgebura/gebura.go b/app/sephirah/internal/biz/bizgebura/gebura.go index 744ae758..fd67913f 100644 --- a/app/sephirah/internal/biz/bizgebura/gebura.go +++ b/app/sephirah/internal/biz/bizgebura/gebura.go @@ -11,7 +11,6 @@ import ( "github.com/tuihub/librarian/internal/lib/libcache" "github.com/tuihub/librarian/internal/lib/libmq" "github.com/tuihub/librarian/internal/model" - mapper "github.com/tuihub/protos/pkg/librarian/mapper/v1" "github.com/go-kratos/kratos/v2/errors" ) @@ -47,9 +46,9 @@ type GeburaRepo interface { } type Gebura struct { - auth *libauth.Auth - repo GeburaRepo - mapper mapper.LibrarianMapperServiceClient + auth *libauth.Auth + repo GeburaRepo + // mapper mapper.LibrarianMapperServiceClient searcher *client.Searcher updateAppIndex *libmq.Topic[modelangela.UpdateAppIndex] pullApp *libmq.Topic[modelangela.PullApp] @@ -59,16 +58,16 @@ type Gebura struct { func NewGebura( repo GeburaRepo, auth *libauth.Auth, - mClient mapper.LibrarianMapperServiceClient, + // mClient mapper.LibrarianMapperServiceClient, sClient *client.Searcher, updateAppIndex *libmq.Topic[modelangela.UpdateAppIndex], pullApp *libmq.Topic[modelangela.PullApp], appCache *libcache.Map[modelgebura.AppID, modelgebura.App], ) *Gebura { return &Gebura{ - auth: auth, - repo: repo, - mapper: mClient, + auth: auth, + repo: repo, + //mapper: mClient, searcher: sClient, updateAppIndex: updateAppIndex, pullApp: pullApp, diff --git a/app/sephirah/internal/biz/biztiphereth/tiphereth.go b/app/sephirah/internal/biz/biztiphereth/tiphereth.go index f74621c7..6befc4fa 100644 --- a/app/sephirah/internal/biz/biztiphereth/tiphereth.go +++ b/app/sephirah/internal/biz/biztiphereth/tiphereth.go @@ -12,7 +12,6 @@ import ( "github.com/tuihub/librarian/internal/lib/libmq" "github.com/tuihub/librarian/internal/lib/logger" "github.com/tuihub/librarian/internal/model" - mapper "github.com/tuihub/protos/pkg/librarian/mapper/v1" ) type TipherethRepo interface { @@ -43,11 +42,11 @@ type TipherethRepo interface { } type Tiphereth struct { - app *libapp.Settings - auth *libauth.Auth - repo TipherethRepo - supv *supervisor.Supervisor - mapper mapper.LibrarianMapperServiceClient + app *libapp.Settings + auth *libauth.Auth + repo TipherethRepo + supv *supervisor.Supervisor + // mapper mapper.LibrarianMapperServiceClient searcher *client.Searcher pullAccount *libmq.Topic[modeltiphereth.PullAccountInfo] } @@ -57,17 +56,17 @@ func NewTiphereth( repo TipherethRepo, auth *libauth.Auth, supv *supervisor.Supervisor, - mClient mapper.LibrarianMapperServiceClient, + // mClient mapper.LibrarianMapperServiceClient, sClient *client.Searcher, pullAccount *libmq.Topic[modeltiphereth.PullAccountInfo], cron *libcron.Cron, ) (*Tiphereth, error) { t := &Tiphereth{ - app: app, - auth: auth, - repo: repo, - supv: supv, - mapper: mClient, + app: app, + auth: auth, + repo: repo, + supv: supv, + //mapper: mClient, searcher: sClient, pullAccount: pullAccount, } @@ -112,15 +111,15 @@ func (t *Tiphereth) CreateConfiguredAdmin() { return } user.ID = id - if _, err = t.mapper.InsertVertex(ctx, &mapper.InsertVertexRequest{VertexList: []*mapper.Vertex{ - { - Vid: int64(user.ID), - Type: mapper.VertexType_VERTEX_TYPE_ABSTRACT, - Prop: nil, - }, - }}); err != nil { - return - } + // if _, err = t.mapper.InsertVertex(ctx, &mapper.InsertVertexRequest{VertexList: []*mapper.Vertex{ + // { + // Vid: int64(user.ID), + // Type: mapper.VertexType_VERTEX_TYPE_ABSTRACT, + // Prop: nil, + // }, + // }}); err != nil { + // return + //} if err = t.repo.CreateUser(ctx, user, user.ID); err != nil { logger.Infof("repo CreateUser failed: %s", err.Error()) return diff --git a/app/sephirah/internal/biz/biztiphereth/user.go b/app/sephirah/internal/biz/biztiphereth/user.go index f2c74ded..8547179c 100644 --- a/app/sephirah/internal/biz/biztiphereth/user.go +++ b/app/sephirah/internal/biz/biztiphereth/user.go @@ -9,7 +9,6 @@ import ( "github.com/tuihub/librarian/internal/lib/libauth" "github.com/tuihub/librarian/internal/lib/logger" "github.com/tuihub/librarian/internal/model" - mapper "github.com/tuihub/protos/pkg/librarian/mapper/v1" pb "github.com/tuihub/protos/pkg/librarian/sephirah/v1" "github.com/go-kratos/kratos/v2/errors" @@ -39,15 +38,15 @@ func (t *Tiphereth) CreateUser(ctx context.Context, user *modeltiphereth.User) ( return nil, pb.ErrorErrorReasonUnspecified("%s", err) } user.ID = id - if _, err = t.mapper.InsertVertex(ctx, &mapper.InsertVertexRequest{VertexList: []*mapper.Vertex{ - { - Vid: int64(user.ID), - Type: mapper.VertexType_VERTEX_TYPE_ABSTRACT, - Prop: nil, - }, - }}); err != nil { - return nil, pb.ErrorErrorReasonUnspecified("%s", err.Error()) - } + // if _, err = t.mapper.InsertVertex(ctx, &mapper.InsertVertexRequest{VertexList: []*mapper.Vertex{ + // { + // Vid: int64(user.ID), + // Type: mapper.VertexType_VERTEX_TYPE_ABSTRACT, + // Prop: nil, + // }, + // }}); err != nil { + // return nil, pb.ErrorErrorReasonUnspecified("%s", err.Error()) + //} if err = t.repo.CreateUser(ctx, user, claims.UserID); err != nil { logger.Infof("repo CreateUser failed: %s", err.Error()) return nil, pb.ErrorErrorReasonUnspecified("%s", err.Error()) diff --git a/app/sephirah/internal/biz/bizyesod/feed_config.go b/app/sephirah/internal/biz/bizyesod/feed_config.go index 21d45c88..8bd4cc66 100644 --- a/app/sephirah/internal/biz/bizyesod/feed_config.go +++ b/app/sephirah/internal/biz/bizyesod/feed_config.go @@ -7,7 +7,6 @@ import ( "github.com/tuihub/librarian/app/sephirah/internal/model/modelyesod" "github.com/tuihub/librarian/internal/lib/libauth" "github.com/tuihub/librarian/internal/model" - mapper "github.com/tuihub/protos/pkg/librarian/mapper/v1" pb "github.com/tuihub/protos/pkg/librarian/sephirah/v1" "github.com/go-kratos/kratos/v2/errors" @@ -26,14 +25,14 @@ func (y *Yesod) CreateFeedConfig(ctx context.Context, config *modelyesod.FeedCon return 0, pb.ErrorErrorReasonUnspecified("%s", err.Error()) } config.ID = id - if _, err = y.mapper.InsertVertex(ctx, &mapper.InsertVertexRequest{ - VertexList: []*mapper.Vertex{{ - Vid: int64(config.ID), - Type: mapper.VertexType_VERTEX_TYPE_METADATA, - }}, - }); err != nil { - return 0, pb.ErrorErrorReasonUnspecified("%s", err.Error()) - } + // if _, err = y.mapper.InsertVertex(ctx, &mapper.InsertVertexRequest{ + // VertexList: []*mapper.Vertex{{ + // Vid: int64(config.ID), + // Type: mapper.VertexType_VERTEX_TYPE_METADATA, + // }}, + // }); err != nil { + // return 0, pb.ErrorErrorReasonUnspecified("%s", err.Error()) + //} err = y.repo.CreateFeedConfig(ctx, claims.UserID, config) if err != nil { return 0, pb.ErrorErrorReasonUnspecified("%s", err.Error()) diff --git a/app/sephirah/internal/biz/bizyesod/yesod.go b/app/sephirah/internal/biz/bizyesod/yesod.go index a3e94438..73df20a2 100644 --- a/app/sephirah/internal/biz/bizyesod/yesod.go +++ b/app/sephirah/internal/biz/bizyesod/yesod.go @@ -12,7 +12,6 @@ import ( "github.com/tuihub/librarian/internal/lib/logger" "github.com/tuihub/librarian/internal/model" "github.com/tuihub/librarian/internal/model/modelfeed" - mapper "github.com/tuihub/protos/pkg/librarian/mapper/v1" ) type YesodRepo interface { @@ -35,9 +34,9 @@ type YesodRepo interface { } type Yesod struct { - repo YesodRepo - supv *supervisor.Supervisor - mapper mapper.LibrarianMapperServiceClient + repo YesodRepo + supv *supervisor.Supervisor + // mapper mapper.LibrarianMapperServiceClient searcher *client.Searcher pullFeed *libmq.Topic[modelyesod.PullFeed] } @@ -46,14 +45,14 @@ func NewYesod( repo YesodRepo, supv *supervisor.Supervisor, cron *libcron.Cron, - mClient mapper.LibrarianMapperServiceClient, + // mClient mapper.LibrarianMapperServiceClient, sClient *client.Searcher, pullFeed *libmq.Topic[modelyesod.PullFeed], ) (*Yesod, error) { y := &Yesod{ - repo: repo, - supv: supv, - mapper: mClient, + repo: repo, + supv: supv, + //mapper: mClient, searcher: sClient, pullFeed: pullFeed, } diff --git a/app/sephirah/pkg/service/wire.go b/app/sephirah/pkg/service/wire.go index 25cf72c0..5b59d17d 100644 --- a/app/sephirah/pkg/service/wire.go +++ b/app/sephirah/pkg/service/wire.go @@ -23,7 +23,6 @@ import ( pb "github.com/tuihub/protos/pkg/librarian/sephirah/v1" "github.com/google/wire" - mapper "github.com/tuihub/protos/pkg/librarian/mapper/v1" ) func NewSephirahService( @@ -35,7 +34,7 @@ func NewSephirahService( *libcron.Cron, libcache.Store, *libapp.Settings, - mapper.LibrarianMapperServiceClient, + //mapper.LibrarianMapperServiceClient, searcher.LibrarianSearcherServiceClient, miner.LibrarianMinerServiceClient, ) (pb.LibrarianSephirahServiceServer, func(), error) { diff --git a/app/sephirah/pkg/service/wire_gen.go b/app/sephirah/pkg/service/wire_gen.go index afeb12d7..5093984f 100644 --- a/app/sephirah/pkg/service/wire_gen.go +++ b/app/sephirah/pkg/service/wire_gen.go @@ -1,6 +1,6 @@ // Code generated by Wire. DO NOT EDIT. -//go:generate go run github.com/google/wire/cmd/wire +//go:generate go run -mod=mod github.com/google/wire/cmd/wire //go:build !wireinject // +build !wireinject @@ -25,15 +25,14 @@ import ( "github.com/tuihub/librarian/internal/lib/libcron" "github.com/tuihub/librarian/internal/lib/libmq" "github.com/tuihub/librarian/internal/server" - "github.com/tuihub/protos/pkg/librarian/mapper/v1" - v1_3 "github.com/tuihub/protos/pkg/librarian/miner/v1" - v1_2 "github.com/tuihub/protos/pkg/librarian/searcher/v1" - v1_4 "github.com/tuihub/protos/pkg/librarian/sephirah/v1" + v1_2 "github.com/tuihub/protos/pkg/librarian/miner/v1" + "github.com/tuihub/protos/pkg/librarian/searcher/v1" + v1_3 "github.com/tuihub/protos/pkg/librarian/sephirah/v1" ) // Injectors from wire.go: -func NewSephirahService(sephirah_Data *conf.Sephirah_Data, sephirah_Porter *conf.Sephirah_Porter, consul *conf.Consul, auth *libauth.Auth, mq *libmq.MQ, cron *libcron.Cron, store libcache.Store, settings *libapp.Settings, librarianMapperServiceClient v1.LibrarianMapperServiceClient, librarianSearcherServiceClient v1_2.LibrarianSearcherServiceClient, librarianMinerServiceClient v1_3.LibrarianMinerServiceClient) (v1_4.LibrarianSephirahServiceServer, func(), error) { +func NewSephirahService(sephirah_Data *conf.Sephirah_Data, sephirah_Porter *conf.Sephirah_Porter, consul *conf.Consul, auth *libauth.Auth, mq *libmq.MQ, cron *libcron.Cron, store libcache.Store, settings *libapp.Settings, librarianSearcherServiceClient v1.LibrarianSearcherServiceClient, librarianMinerServiceClient v1_2.LibrarianMinerServiceClient) (v1_3.LibrarianSephirahServiceServer, func(), error) { entClient, cleanup, err := data.NewSQLClient(sephirah_Data) if err != nil { return nil, nil, err @@ -57,7 +56,7 @@ func NewSephirahService(sephirah_Data *conf.Sephirah_Data, sephirah_Porter *conf } geburaRepo := data.NewGeburaRepo(dataData) searcher := client.NewSearcher(librarianSearcherServiceClient) - angelaBase, err := bizangela.NewAngelaBase(angelaRepo, supervisorSupervisor, geburaRepo, librarianMapperServiceClient, librarianPorterServiceClient, searcher) + angelaBase, err := bizangela.NewAngelaBase(angelaRepo, supervisorSupervisor, geburaRepo, librarianPorterServiceClient, searcher) if err != nil { cleanup() return nil, nil, err @@ -81,21 +80,21 @@ func NewSephirahService(sephirah_Data *conf.Sephirah_Data, sephirah_Porter *conf return nil, nil, err } tipherethRepo := data.NewTipherethRepo(dataData) - tiphereth, err := biztiphereth.NewTiphereth(settings, tipherethRepo, auth, supervisorSupervisor, librarianMapperServiceClient, searcher, topic3, cron) + tiphereth, err := biztiphereth.NewTiphereth(settings, tipherethRepo, auth, supervisorSupervisor, searcher, topic3, cron) if err != nil { cleanup() return nil, nil, err } - gebura := bizgebura.NewGebura(geburaRepo, auth, librarianMapperServiceClient, searcher, topic, libmqTopic, libcacheMap) + gebura := bizgebura.NewGebura(geburaRepo, auth, searcher, topic, libmqTopic, libcacheMap) binahRepo, err := data.NewBinahRepo(sephirah_Data) if err != nil { cleanup() return nil, nil, err } controlBlock := bizbinah.NewControlBlock(auth) - binah := bizbinah.NewBinah(binahRepo, controlBlock, auth, librarianMapperServiceClient, librarianSearcherServiceClient) + binah := bizbinah.NewBinah(binahRepo, controlBlock, auth, librarianSearcherServiceClient) yesodRepo := data.NewYesodRepo(dataData) - yesod, err := bizyesod.NewYesod(yesodRepo, supervisorSupervisor, cron, librarianMapperServiceClient, searcher, topic7) + yesod, err := bizyesod.NewYesod(yesodRepo, supervisorSupervisor, cron, searcher, topic7) if err != nil { cleanup() return nil, nil, err diff --git a/cmd/librarian/main.go b/cmd/librarian/main.go index f411ea6e..097ebe31 100644 --- a/cmd/librarian/main.go +++ b/cmd/librarian/main.go @@ -9,7 +9,6 @@ import ( "github.com/tuihub/librarian/internal/lib/libapp" "github.com/tuihub/librarian/internal/lib/libcron" "github.com/tuihub/librarian/internal/lib/libmq" - mapper "github.com/tuihub/protos/pkg/librarian/mapper/v1" miner "github.com/tuihub/protos/pkg/librarian/miner/v1" searcher "github.com/tuihub/protos/pkg/librarian/searcher/v1" @@ -38,7 +37,7 @@ var ( var ProviderSet = wire.NewSet( newApp, - mapperClientSelector, + // mapperClientSelector, searcherClientSelector, minerClientSelector, ) @@ -92,16 +91,16 @@ func main() { } } -func mapperClientSelector( - conf *conf.Librarian_EnableServiceDiscovery, - c *conf.Consul, - inproc *inprocgrpc.InprocClients, -) (mapper.LibrarianMapperServiceClient, error) { - if conf.GetMapper() { - return client.NewMapperClient(c) - } - return inproc.Mapper, nil -} +// func mapperClientSelector( +// conf *conf.Librarian_EnableServiceDiscovery, +// c *conf.Consul, +// inproc *inprocgrpc.InprocClients, +// ) (mapper.LibrarianMapperServiceClient, error) { +// if conf.GetMapper() { +// return client.NewMapperClient(c) +// } +// return inproc.Mapper, nil +//} func searcherClientSelector( conf *conf.Librarian_EnableServiceDiscovery, diff --git a/cmd/librarian/wire.go b/cmd/librarian/wire.go index 574bed88..ca9a8980 100644 --- a/cmd/librarian/wire.go +++ b/cmd/librarian/wire.go @@ -5,7 +5,6 @@ package main import ( - mapperService "github.com/tuihub/librarian/app/mapper/pkg/service" minerService "github.com/tuihub/librarian/app/miner/pkg/service" searcherService "github.com/tuihub/librarian/app/searcher/pkg/service" sephirahService "github.com/tuihub/librarian/app/sephirah/pkg/service" @@ -40,7 +39,7 @@ func wireApp( panic( wire.Build( sephirahService.ProviderSet, - mapperService.ProviderSet, + //mapperService.ProviderSet, searcherService.ProviderSet, minerService.ProviderSet, server.ProviderSet, diff --git a/cmd/librarian/wire_gen.go b/cmd/librarian/wire_gen.go index 242a16ec..158faa60 100644 --- a/cmd/librarian/wire_gen.go +++ b/cmd/librarian/wire_gen.go @@ -1,6 +1,6 @@ // Code generated by Wire. DO NOT EDIT. -//go:generate go run github.com/google/wire/cmd/wire +//go:generate go run -mod=mod github.com/google/wire/cmd/wire //go:build !wireinject // +build !wireinject @@ -8,10 +8,9 @@ package main import ( "github.com/go-kratos/kratos/v2" - "github.com/tuihub/librarian/app/mapper/pkg/service" - service3 "github.com/tuihub/librarian/app/miner/pkg/service" - service2 "github.com/tuihub/librarian/app/searcher/pkg/service" - service4 "github.com/tuihub/librarian/app/sephirah/pkg/service" + service2 "github.com/tuihub/librarian/app/miner/pkg/service" + "github.com/tuihub/librarian/app/searcher/pkg/service" + service3 "github.com/tuihub/librarian/app/sephirah/pkg/service" "github.com/tuihub/librarian/internal/conf" "github.com/tuihub/librarian/internal/inprocgrpc" "github.com/tuihub/librarian/internal/lib/libapp" @@ -40,36 +39,20 @@ func wireApp(librarian_EnableServiceDiscovery *conf.Librarian_EnableServiceDisco cleanup() return nil, nil, err } - librarianMapperServiceServer, cleanup2, err := service.NewMapperService(mapper_Data, settings) + librarianSearcherServiceServer, cleanup2, err := service.NewSearcherService(searcher_Data, settings) if err != nil { cleanup() return nil, nil, err } - librarianSearcherServiceServer, cleanup3, err := service2.NewSearcherService(searcher_Data, settings) + librarianMinerServiceServer, cleanup3, err := service2.NewMinerService(miner_Data, settings) if err != nil { cleanup2() cleanup() return nil, nil, err } - librarianMinerServiceServer, cleanup4, err := service3.NewMinerService(miner_Data, settings) - if err != nil { - cleanup3() - cleanup2() - cleanup() - return nil, nil, err - } - inprocClients := inprocgrpc.NewInprocClients(librarianMapperServiceServer, librarianSearcherServiceServer, librarianMinerServiceServer) - librarianMapperServiceClient, err := mapperClientSelector(librarian_EnableServiceDiscovery, consul, inprocClients) - if err != nil { - cleanup4() - cleanup3() - cleanup2() - cleanup() - return nil, nil, err - } + inprocClients := inprocgrpc.NewInprocClients(librarianSearcherServiceServer, librarianMinerServiceServer) librarianSearcherServiceClient, err := searcherClientSelector(librarian_EnableServiceDiscovery, consul, inprocClients) if err != nil { - cleanup4() cleanup3() cleanup2() cleanup() @@ -77,15 +60,13 @@ func wireApp(librarian_EnableServiceDiscovery *conf.Librarian_EnableServiceDisco } librarianMinerServiceClient, err := minerClientSelector(librarian_EnableServiceDiscovery, consul, inprocClients) if err != nil { - cleanup4() cleanup3() cleanup2() cleanup() return nil, nil, err } - librarianSephirahServiceServer, cleanup5, err := service4.NewSephirahService(sephirah_Data, sephirah_Porter, consul, libauthAuth, libmqMQ, cron, store, settings, librarianMapperServiceClient, librarianSearcherServiceClient, librarianMinerServiceClient) + librarianSephirahServiceServer, cleanup4, err := service3.NewSephirahService(sephirah_Data, sephirah_Porter, consul, libauthAuth, libmqMQ, cron, store, settings, librarianSearcherServiceClient, librarianMinerServiceClient) if err != nil { - cleanup4() cleanup3() cleanup2() cleanup() @@ -93,7 +74,6 @@ func wireApp(librarian_EnableServiceDiscovery *conf.Librarian_EnableServiceDisco } grpcServer, err := server.NewGRPCServer(sephirah_Server, libauthAuth, librarianSephirahServiceServer, settings) if err != nil { - cleanup5() cleanup4() cleanup3() cleanup2() @@ -102,7 +82,6 @@ func wireApp(librarian_EnableServiceDiscovery *conf.Librarian_EnableServiceDisco } httpServer, err := server.NewGrpcWebServer(grpcServer, sephirah_Server, libauthAuth, settings) if err != nil { - cleanup5() cleanup4() cleanup3() cleanup2() @@ -111,7 +90,6 @@ func wireApp(librarian_EnableServiceDiscovery *conf.Librarian_EnableServiceDisco } registrar, err := libapp.NewRegistrar(consul) if err != nil { - cleanup5() cleanup4() cleanup3() cleanup2() @@ -120,7 +98,6 @@ func wireApp(librarian_EnableServiceDiscovery *conf.Librarian_EnableServiceDisco } app := newApp(grpcServer, httpServer, libmqMQ, cron, registrar) return app, func() { - cleanup5() cleanup4() cleanup3() cleanup2() diff --git a/configs/example-for-single-node.yaml b/configs/example-for-single-node.yaml index 11b1c387..e4352f0d 100644 --- a/configs/example-for-single-node.yaml +++ b/configs/example-for-single-node.yaml @@ -36,10 +36,6 @@ sephirah: no_ssl: true cache: driver: memory -mapper: - data: - cayley: - store: sqlite searcher: data: meilisearch: diff --git a/configs/example-for-testing.yaml b/configs/example-for-testing.yaml index 7c118e32..4114d86c 100644 --- a/configs/example-for-testing.yaml +++ b/configs/example-for-testing.yaml @@ -18,10 +18,6 @@ sephirah: driver: memory cache: driver: memory -mapper: - data: - cayley: - store: memory searcher: data: bleve: diff --git a/go.mod b/go.mod index eee63126..d6dcdd31 100644 --- a/go.mod +++ b/go.mod @@ -20,7 +20,7 @@ require ( github.com/golang-jwt/jwt/v4 v4.5.0 github.com/google/go-cmp v0.6.0 github.com/google/uuid v1.6.0 - github.com/google/wire v0.5.0 + github.com/google/wire v0.6.0 github.com/hashicorp/consul/api v1.27.0 github.com/improbable-eng/grpc-web v0.15.0 github.com/johannesboyne/gofakes3 v0.0.0-20240117152127-f7e9c41d81b2 diff --git a/go.sum b/go.sum index bbb8e052..74d57351 100644 --- a/go.sum +++ b/go.sum @@ -430,7 +430,7 @@ github.com/google/pprof v0.0.0-20201203190320-1bf35d6f28c2/go.mod h1:kpwsk12EmLe github.com/google/pprof v0.0.0-20210122040257-d980be63207e/go.mod h1:kpwsk12EmLew5upagYY7GY0pfYCcupk39gWOCRROcvE= github.com/google/pprof v0.0.0-20210226084205-cbba55b83ad5/go.mod h1:kpwsk12EmLew5upagYY7GY0pfYCcupk39gWOCRROcvE= github.com/google/renameio v0.1.0/go.mod h1:KWCgfxg9yswjAJkECMjeO8J8rahYeXnNhOm40UhjYkI= -github.com/google/subcommands v1.0.1/go.mod h1:ZjhPrFU+Olkh9WazFPsl27BQ4UPiG37m3yTrtFlrHVk= +github.com/google/subcommands v1.2.0/go.mod h1:ZjhPrFU+Olkh9WazFPsl27BQ4UPiG37m3yTrtFlrHVk= github.com/google/uuid v1.0.0/go.mod h1:TIyPZe4MgqvfeYDBFedMoGGpEw/LqOeaOT+nhxU+yHo= github.com/google/uuid v1.1.1/go.mod h1:TIyPZe4MgqvfeYDBFedMoGGpEw/LqOeaOT+nhxU+yHo= github.com/google/uuid v1.1.2/go.mod h1:TIyPZe4MgqvfeYDBFedMoGGpEw/LqOeaOT+nhxU+yHo= @@ -438,8 +438,8 @@ github.com/google/uuid v1.2.0/go.mod h1:TIyPZe4MgqvfeYDBFedMoGGpEw/LqOeaOT+nhxU+ github.com/google/uuid v1.4.0/go.mod h1:TIyPZe4MgqvfeYDBFedMoGGpEw/LqOeaOT+nhxU+yHo= github.com/google/uuid v1.6.0 h1:NIvaJDMOsjHA8n1jAhLSgzrAzy1Hgr+hNrb57e+94F0= github.com/google/uuid v1.6.0/go.mod h1:TIyPZe4MgqvfeYDBFedMoGGpEw/LqOeaOT+nhxU+yHo= -github.com/google/wire v0.5.0 h1:I7ELFeVBr3yfPIcc8+MWvrjk+3VjbcSzoXm3JVa+jD8= -github.com/google/wire v0.5.0/go.mod h1:ngWDr9Qvq3yZA10YrxfyGELY/AFWGVpy9c1LTRi1EoU= +github.com/google/wire v0.6.0 h1:HBkoIh4BdSxoyo9PveV8giw7ZsaBOvzWKfcg/6MrVwI= +github.com/google/wire v0.6.0/go.mod h1:F4QhpQ9EDIdJ1Mbop/NZBRB+5yrR6qg3BnctaoUk6NA= github.com/googleapis/gax-go/v2 v2.0.4/go.mod h1:0Wqv26UfaUD9n4G6kQubkQ+KchISgw+vpHVxEJEs9eg= github.com/googleapis/gax-go/v2 v2.0.5/go.mod h1:DWXyrwAJ9X0FpwwEdw+IPEYBICEFu5mhpdKc/us6bOk= github.com/gopherjs/gopherjs v0.0.0-20181017120253-0766667cb4d1/go.mod h1:wJfORRmW1u3UXTncJ5qlYoELFm8eSnnEO6hX4iZ3EWY= @@ -998,6 +998,7 @@ golang.org/x/crypto v0.0.0-20191011191535-87dc89f01550/go.mod h1:yigFU9vqHzYiE8U golang.org/x/crypto v0.0.0-20200622213623-75b288015ac9/go.mod h1:LzIPMQfyMNhhGPhUkYOs5KpL4U8rLKemX1yGLhDgUto= golang.org/x/crypto v0.0.0-20210921155107-089bfa567519/go.mod h1:GvvjBRRGRdwPK5ydBHafDWAxML/pGHZbMvKqRZ5+Abc= golang.org/x/crypto v0.0.0-20220214200702-86341886e292/go.mod h1:IxCIyHEi3zRg3s0A5j5BB6A9Jmi73HwBIUl50j+osU4= +golang.org/x/crypto v0.13.0/go.mod h1:y6Z2r+Rw4iayiXXAIxJIDAJ1zMW4yaTpebo8fPOliYc= golang.org/x/crypto v0.18.0 h1:PGVlW0xEltQnzFZ55hkuX5+KLyrMYhHld1YHO4AKcdc= golang.org/x/crypto v0.18.0/go.mod h1:R0j02AL6hcrfOiy9T4ZYp/rcWeMxM3L6QYxlOuEG1mg= golang.org/x/exp v0.0.0-20190121172915-509febef88a4/go.mod h1:CJ0aWSM057203Lf6IL+f9T1iT9GByDxfZKAQTCR3kQA= @@ -1041,6 +1042,7 @@ golang.org/x/mod v0.4.2/go.mod h1:s0Qsj1ACt9ePp/hMypM3fl4fZqREWJwdYDEqhRiZZUA= golang.org/x/mod v0.6.0-dev.0.20220419223038-86c51ed26bb4/go.mod h1:jJ57K6gSWd91VN4djpZkiMVwK6gcyfeH4XE8wZrZaV4= golang.org/x/mod v0.8.0/go.mod h1:iBbtSCu2XBx23ZKBPSOrRkjjQPZFPuis4dIYUhu/chs= golang.org/x/mod v0.10.0/go.mod h1:iBbtSCu2XBx23ZKBPSOrRkjjQPZFPuis4dIYUhu/chs= +golang.org/x/mod v0.12.0/go.mod h1:iBbtSCu2XBx23ZKBPSOrRkjjQPZFPuis4dIYUhu/chs= golang.org/x/mod v0.14.0 h1:dGoOF9QVLYng8IHTm7BAyWqCqSheQ5pYWGhzW00YJr0= golang.org/x/mod v0.14.0/go.mod h1:hTbmBsO62+eylJbnUtE2MGJUyE7QWk4xUqPFrRgJ+7c= golang.org/x/net v0.0.0-20180724234803-3673e40ba225/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= @@ -1098,6 +1100,8 @@ golang.org/x/net v0.1.0/go.mod h1:Cx3nUiGt4eDBEyega/BKRp+/AlGL8hYe7U9odMt2Cco= golang.org/x/net v0.6.0/go.mod h1:2Tu9+aMcznHK/AK1HMvgo6xiTLG5rD5rZLDS+rp2Bjs= golang.org/x/net v0.7.0/go.mod h1:2Tu9+aMcznHK/AK1HMvgo6xiTLG5rD5rZLDS+rp2Bjs= golang.org/x/net v0.9.0/go.mod h1:d48xBJpPfHeWQsugry2m+kC02ZBRGRgulfHnEXEuWns= +golang.org/x/net v0.10.0/go.mod h1:0qNGK6F8kojg2nk9dLZ2mShWaEBan6FAoqfSigmmuDg= +golang.org/x/net v0.15.0/go.mod h1:idbUs1IY1+zTqbi8yxTbhexhEEk5ur9LInksu6HrEpk= golang.org/x/net v0.20.0 h1:aCL9BSgETF1k+blQaYUBx9hJ9LOGP3gAVemcZlf1Kpo= golang.org/x/net v0.20.0/go.mod h1:z8BVo6PvndSri0LbOE3hAn0apkU+1YvI6E70E9jsnvY= golang.org/x/oauth2 v0.0.0-20180821212333-d2e6202438be/go.mod h1:N/0e6XlmueqKjAGxoOufVs8QHGRruUQn6yWY3a++T0U= @@ -1126,6 +1130,7 @@ golang.org/x/sync v0.0.0-20201207232520-09787c993a3a/go.mod h1:RxMgew5VJxzue5/jJ golang.org/x/sync v0.0.0-20210220032951-036812b2e83c/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sync v0.0.0-20220722155255-886fb9371eb4/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sync v0.1.0/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= +golang.org/x/sync v0.3.0/go.mod h1:FU7BRWz2tNW+3quACPkgCx/L+uEAv1htQ0V83Z9Rj+Y= golang.org/x/sync v0.6.0 h1:5BMeUDZ7vkXGfEr1x9B4bRcTH4lpkTkpdh0T/J+qjbQ= golang.org/x/sync v0.6.0/go.mod h1:Czt+wKu1gCyEFDUtn0jG5QVvpJ6rzVqr5aXyt9drQfk= golang.org/x/sys v0.0.0-20180823144017-11551d06cbcc/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= @@ -1215,6 +1220,7 @@ golang.org/x/sys v0.5.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.7.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.8.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.9.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= +golang.org/x/sys v0.12.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.16.0 h1:xWw16ngr6ZMtmxDyKyIgsE93KNKz5HKmMa3b8ALHidU= golang.org/x/sys v0.16.0/go.mod h1:/VUhepiaJMQUp4+oa/7Zr1D23ma6VTLIYjOOTFZPUcA= golang.org/x/term v0.0.0-20201126162022-7de9c90e9dd1/go.mod h1:bj7SfCRtBDWHUb9snDiAeCFNEtKQo2Wmx5Cou7ajbmo= @@ -1223,6 +1229,8 @@ golang.org/x/term v0.0.0-20220722155259-a9ba230a4035/go.mod h1:jbD1KX2456YbFQfuX golang.org/x/term v0.1.0/go.mod h1:jbD1KX2456YbFQfuXm/mYQcufACuNUgVhRMnK/tPxf8= golang.org/x/term v0.5.0/go.mod h1:jMB1sMXY+tzblOD4FWmEbocvup2/aLOaQEp7JmGp78k= golang.org/x/term v0.7.0/go.mod h1:P32HKFT3hSsZrRxla30E9HqToFYAQPCMs/zFMBUFqPY= +golang.org/x/term v0.8.0/go.mod h1:xPskH00ivmX89bAKVGSKKtLOWNx2+17Eiy94tnKShWo= +golang.org/x/term v0.12.0/go.mod h1:owVbMEjm3cBLCHdkQu9b1opXd4ETQWc3BhuQGKgXgvU= golang.org/x/term v0.16.0 h1:m+B6fahuftsE9qjo0VWp2FW0mB3MTJvR0BaMQrq0pmE= golang.org/x/term v0.16.0/go.mod h1:yn7UURbUtPyrVJPGPq404EukNFxcm/foM+bV/bfcDsY= golang.org/x/text v0.0.0-20170915032832-14c0d48ead0c/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ= @@ -1237,6 +1245,7 @@ golang.org/x/text v0.3.7/go.mod h1:u+2+/6zg+i71rQMx5EYifcz6MCKuco9NR6JIITiCfzQ= golang.org/x/text v0.4.0/go.mod h1:mrYo+phRRbMaCq/xk9113O4dZlRixOauAjOtrjsXDZ8= golang.org/x/text v0.7.0/go.mod h1:mrYo+phRRbMaCq/xk9113O4dZlRixOauAjOtrjsXDZ8= golang.org/x/text v0.9.0/go.mod h1:e1OnstbJyHTd6l/uOt8jFFHp6TRDWZR/bV3emEE/zU8= +golang.org/x/text v0.13.0/go.mod h1:TvPlkZtksWOMsz7fbANvkp4WM8x/WCo/om8BMLbz+aE= golang.org/x/text v0.14.0 h1:ScX5w1eTa3QqT8oi6+ziP7dTV1S2+ALU0bI+0zXKWiQ= golang.org/x/text v0.14.0/go.mod h1:18ZOQIKpY8NJVqYksKHtTdi31H5itFRjB5/qKTNYzSU= golang.org/x/time v0.0.0-20180412165947-fbb02b2291d2/go.mod h1:tRJNPiyCQ0inRvYxbN9jk5I+vvW/OXSQhTDSoE431IQ= @@ -1253,7 +1262,6 @@ golang.org/x/tools v0.0.0-20190311212946-11955173bddd/go.mod h1:LCzVGOaR6xXOjkQ3 golang.org/x/tools v0.0.0-20190312151545-0bb0c0a6e846/go.mod h1:LCzVGOaR6xXOjkQ3onu1FJEFr0SW1gC7cKk1uF8kGRs= golang.org/x/tools v0.0.0-20190312170243-e65039ee4138/go.mod h1:LCzVGOaR6xXOjkQ3onu1FJEFr0SW1gC7cKk1uF8kGRs= golang.org/x/tools v0.0.0-20190328211700-ab21143f2384/go.mod h1:LCzVGOaR6xXOjkQ3onu1FJEFr0SW1gC7cKk1uF8kGRs= -golang.org/x/tools v0.0.0-20190422233926-fe54fb35175b/go.mod h1:LCzVGOaR6xXOjkQ3onu1FJEFr0SW1gC7cKk1uF8kGRs= golang.org/x/tools v0.0.0-20190425150028-36563e24a262/go.mod h1:RgjU9mgBXZiqYHBnxXauZ1Gv1EHHAz9KjViQ78xBX0Q= golang.org/x/tools v0.0.0-20190506145303-2d16b83fe98c/go.mod h1:RgjU9mgBXZiqYHBnxXauZ1Gv1EHHAz9KjViQ78xBX0Q= golang.org/x/tools v0.0.0-20190524140312-2c0ae7006135/go.mod h1:RgjU9mgBXZiqYHBnxXauZ1Gv1EHHAz9KjViQ78xBX0Q= @@ -1310,6 +1318,7 @@ golang.org/x/tools v0.1.7/go.mod h1:LGqMHiF4EqQNHR1JncWGqT5BVaXmza+X+BDGol+dOxo= golang.org/x/tools v0.1.12/go.mod h1:hNGJHUnrk76NpqgfD5Aqm5Crs+Hm0VOH/i9J2+nxYbc= golang.org/x/tools v0.6.0/go.mod h1:Xwgl3UAJ/d3gWutnCtw505GrjyAbvKui8lOU390QaIU= golang.org/x/tools v0.8.0/go.mod h1:JxBZ99ISMI5ViVkT1tr6tdNmXeTrcpVSD3vZ1RsRdN4= +golang.org/x/tools v0.13.0/go.mod h1:HvlwmtVNQAhOuCjW7xxvovg8wbNq7LwfXh/k7wXUl58= golang.org/x/tools v0.17.0 h1:FvmRgNOcs3kOa+T20R1uhfP9F6HgG2mfxDv1vrx1Htc= golang.org/x/tools v0.17.0/go.mod h1:xsh6VxdV005rRVaS6SSAf9oiAqljS7UZUacMZ8Bnsps= golang.org/x/xerrors v0.0.0-20190717185122-a985d3407aa7/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= diff --git a/internal/inprocgrpc/inprocgrpc.go b/internal/inprocgrpc/inprocgrpc.go index 52e84540..75f06cda 100644 --- a/internal/inprocgrpc/inprocgrpc.go +++ b/internal/inprocgrpc/inprocgrpc.go @@ -1,7 +1,6 @@ package inprocgrpc import ( - mapper "github.com/tuihub/protos/pkg/librarian/mapper/v1" miner "github.com/tuihub/protos/pkg/librarian/miner/v1" searcher "github.com/tuihub/protos/pkg/librarian/searcher/v1" @@ -12,29 +11,29 @@ import ( var ProviderSet = wire.NewSet(NewInprocClients) type InprocClients struct { - Mapper mapper.LibrarianMapperServiceClient + // Mapper mapper.LibrarianMapperServiceClient Searcher searcher.LibrarianSearcherServiceClient Miner miner.LibrarianMinerServiceClient } func NewInprocClients( - m mapper.LibrarianMapperServiceServer, + // m mapper.LibrarianMapperServiceServer, s searcher.LibrarianSearcherServiceServer, mi miner.LibrarianMinerServiceServer, ) *InprocClients { return &InprocClients{ - Mapper: NewInprocMapperChannel(m), + //Mapper: NewInprocMapperChannel(m), Searcher: NewInprocSearcherChannel(s), Miner: NewInprocMinerChannel(mi), } } -func NewInprocMapperChannel(s mapper.LibrarianMapperServiceServer) mapper.LibrarianMapperServiceClient { - channel := inprocgrpc.Channel{} - mapper.RegisterLibrarianMapperServiceServer(&channel, s) - cli := mapper.NewLibrarianMapperServiceClient(&channel) - return cli -} +// func NewInprocMapperChannel(s mapper.LibrarianMapperServiceServer) mapper.LibrarianMapperServiceClient { +// channel := inprocgrpc.Channel{} +// mapper.RegisterLibrarianMapperServiceServer(&channel, s) +// cli := mapper.NewLibrarianMapperServiceClient(&channel) +// return cli +//} func NewInprocSearcherChannel(s searcher.LibrarianSearcherServiceServer) searcher.LibrarianSearcherServiceClient { channel := inprocgrpc.Channel{}