chore: 初始开源发布
iotlcm-upstream-chan:运营商上游通道适配服务(统一 /sim/* 协议)。 - 内联原私有依赖:yunze-public → internal/pub/(10 包 18 文件), yunze-pb/pb → internal/pb/(9 文件);Consul 注册改用官方 gogf/gf/contrib/registry/consul/v2(API 兼容) - Go module:yz-svr → git.5iot.com/iotlcm-public/iotlcm-upstream-chan - 修复 mingqian 包测试:实现重构后 `adapter.operations` 字段已移除, 测试断言按当前实现语义重写(不改产品行为) - 凭据与内部标识脱敏:MySQL/Redis/Consul 凭据、私网与生产 IP、 内网域名、真实手机号、注释里的真实 token/transid - 移除内部资产:CI 触发器、生产通道种子 SQL、真实凭据测试资源文档 - Dockerfile 改用公共基础镜像,移除写死的 registry 凭据 - 补 Apache-2.0 LICENSE,重写 README,LF 行尾 + .gitattributes
This commit is contained in:
@@ -0,0 +1,155 @@
|
||||
// Code generated by protoc-gen-go-grpc. DO NOT EDIT.
|
||||
// versions:
|
||||
// - protoc-gen-go-grpc v1.6.1
|
||||
// - protoc v5.29.3
|
||||
// source: msgbus.proto
|
||||
|
||||
package pb
|
||||
|
||||
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.64.0 or later.
|
||||
const _ = grpc.SupportPackageIsVersion9
|
||||
|
||||
const (
|
||||
MsgBus_Send_FullMethodName = "/PbMsgBus.MsgBus/Send"
|
||||
MsgBus_LongSend_FullMethodName = "/PbMsgBus.MsgBus/LongSend"
|
||||
)
|
||||
|
||||
// MsgBusClient is the client API for MsgBus 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 MsgBusClient interface {
|
||||
Send(ctx context.Context, in *SendMsgReq, opts ...grpc.CallOption) (*SendMsgRes, error)
|
||||
LongSend(ctx context.Context, opts ...grpc.CallOption) (grpc.BidiStreamingClient[SendMsgReq, SendMsgRes], error)
|
||||
}
|
||||
|
||||
type msgBusClient struct {
|
||||
cc grpc.ClientConnInterface
|
||||
}
|
||||
|
||||
func NewMsgBusClient(cc grpc.ClientConnInterface) MsgBusClient {
|
||||
return &msgBusClient{cc}
|
||||
}
|
||||
|
||||
func (c *msgBusClient) Send(ctx context.Context, in *SendMsgReq, opts ...grpc.CallOption) (*SendMsgRes, error) {
|
||||
cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...)
|
||||
out := new(SendMsgRes)
|
||||
err := c.cc.Invoke(ctx, MsgBus_Send_FullMethodName, in, out, cOpts...)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
return out, nil
|
||||
}
|
||||
|
||||
func (c *msgBusClient) LongSend(ctx context.Context, opts ...grpc.CallOption) (grpc.BidiStreamingClient[SendMsgReq, SendMsgRes], error) {
|
||||
cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...)
|
||||
stream, err := c.cc.NewStream(ctx, &MsgBus_ServiceDesc.Streams[0], MsgBus_LongSend_FullMethodName, cOpts...)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
x := &grpc.GenericClientStream[SendMsgReq, SendMsgRes]{ClientStream: stream}
|
||||
return x, nil
|
||||
}
|
||||
|
||||
// This type alias is provided for backwards compatibility with existing code that references the prior non-generic stream type by name.
|
||||
type MsgBus_LongSendClient = grpc.BidiStreamingClient[SendMsgReq, SendMsgRes]
|
||||
|
||||
// MsgBusServer is the server API for MsgBus service.
|
||||
// All implementations must embed UnimplementedMsgBusServer
|
||||
// for forward compatibility.
|
||||
type MsgBusServer interface {
|
||||
Send(context.Context, *SendMsgReq) (*SendMsgRes, error)
|
||||
LongSend(grpc.BidiStreamingServer[SendMsgReq, SendMsgRes]) error
|
||||
mustEmbedUnimplementedMsgBusServer()
|
||||
}
|
||||
|
||||
// UnimplementedMsgBusServer must be embedded to have
|
||||
// forward compatible implementations.
|
||||
//
|
||||
// NOTE: this should be embedded by value instead of pointer to avoid a nil
|
||||
// pointer dereference when methods are called.
|
||||
type UnimplementedMsgBusServer struct{}
|
||||
|
||||
func (UnimplementedMsgBusServer) Send(context.Context, *SendMsgReq) (*SendMsgRes, error) {
|
||||
return nil, status.Error(codes.Unimplemented, "method Send not implemented")
|
||||
}
|
||||
func (UnimplementedMsgBusServer) LongSend(grpc.BidiStreamingServer[SendMsgReq, SendMsgRes]) error {
|
||||
return status.Error(codes.Unimplemented, "method LongSend not implemented")
|
||||
}
|
||||
func (UnimplementedMsgBusServer) mustEmbedUnimplementedMsgBusServer() {}
|
||||
func (UnimplementedMsgBusServer) testEmbeddedByValue() {}
|
||||
|
||||
// UnsafeMsgBusServer may be embedded to opt out of forward compatibility for this service.
|
||||
// Use of this interface is not recommended, as added methods to MsgBusServer will
|
||||
// result in compilation errors.
|
||||
type UnsafeMsgBusServer interface {
|
||||
mustEmbedUnimplementedMsgBusServer()
|
||||
}
|
||||
|
||||
func RegisterMsgBusServer(s grpc.ServiceRegistrar, srv MsgBusServer) {
|
||||
// If the following call panics, it indicates UnimplementedMsgBusServer was
|
||||
// embedded by pointer and is nil. This will cause panics if an
|
||||
// unimplemented method is ever invoked, so we test this at initialization
|
||||
// time to prevent it from happening at runtime later due to I/O.
|
||||
if t, ok := srv.(interface{ testEmbeddedByValue() }); ok {
|
||||
t.testEmbeddedByValue()
|
||||
}
|
||||
s.RegisterService(&MsgBus_ServiceDesc, srv)
|
||||
}
|
||||
|
||||
func _MsgBus_Send_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
|
||||
in := new(SendMsgReq)
|
||||
if err := dec(in); err != nil {
|
||||
return nil, err
|
||||
}
|
||||
if interceptor == nil {
|
||||
return srv.(MsgBusServer).Send(ctx, in)
|
||||
}
|
||||
info := &grpc.UnaryServerInfo{
|
||||
Server: srv,
|
||||
FullMethod: MsgBus_Send_FullMethodName,
|
||||
}
|
||||
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
|
||||
return srv.(MsgBusServer).Send(ctx, req.(*SendMsgReq))
|
||||
}
|
||||
return interceptor(ctx, in, info, handler)
|
||||
}
|
||||
|
||||
func _MsgBus_LongSend_Handler(srv interface{}, stream grpc.ServerStream) error {
|
||||
return srv.(MsgBusServer).LongSend(&grpc.GenericServerStream[SendMsgReq, SendMsgRes]{ServerStream: stream})
|
||||
}
|
||||
|
||||
// This type alias is provided for backwards compatibility with existing code that references the prior non-generic stream type by name.
|
||||
type MsgBus_LongSendServer = grpc.BidiStreamingServer[SendMsgReq, SendMsgRes]
|
||||
|
||||
// MsgBus_ServiceDesc is the grpc.ServiceDesc for MsgBus service.
|
||||
// It's only intended for direct use with grpc.RegisterService,
|
||||
// and not to be introspected or modified (even as a copy)
|
||||
var MsgBus_ServiceDesc = grpc.ServiceDesc{
|
||||
ServiceName: "PbMsgBus.MsgBus",
|
||||
HandlerType: (*MsgBusServer)(nil),
|
||||
Methods: []grpc.MethodDesc{
|
||||
{
|
||||
MethodName: "Send",
|
||||
Handler: _MsgBus_Send_Handler,
|
||||
},
|
||||
},
|
||||
Streams: []grpc.StreamDesc{
|
||||
{
|
||||
StreamName: "LongSend",
|
||||
Handler: _MsgBus_LongSend_Handler,
|
||||
ServerStreams: true,
|
||||
ClientStreams: true,
|
||||
},
|
||||
},
|
||||
Metadata: "msgbus.proto",
|
||||
}
|
||||
Reference in New Issue
Block a user