/
id.lava.pb.go
48 lines (39 loc) · 1.22 KB
/
id.lava.pb.go
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
// Code generated by protoc-gen-lava. DO NOT EDIT.
// versions:
// - protoc-gen-lava v0.1.0
// - protoc v3.19.4
// source: proto/gid/id.proto
package gid
import (
context "context"
runtime "github.com/grpc-ecosystem/grpc-gateway/v2/runtime"
grpcc_builder "github.com/pubgo/lava/clients/grpcc/grpcc_builder"
inject "github.com/pubgo/lava/inject"
service "github.com/pubgo/lava/service"
fx "go.uber.org/fx"
grpc "google.golang.org/grpc"
)
// 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.32.0 or later.
const _ = grpc.SupportPackageIsVersion7
func InitIdClient(addr string, alias ...string) {
var name = ""
if len(alias) > 0 {
name = alias[0]
}
conn := grpcc_builder.NewClient(addr)
inject.Register(fx.Provide(fx.Annotated{
Target: func() IdClient { return NewIdClient(conn) },
Name: name,
}))
}
func RegisterId(srv service.Service, impl IdServer) {
srv.RegService(service.Desc{
Handler: impl,
ServiceDesc: Id_ServiceDesc,
})
srv.RegGateway(func(ctx context.Context, mux *runtime.ServeMux, cc grpc.ClientConnInterface) error {
return RegisterIdHandlerClient(ctx, mux, NewIdClient(cc))
})
}