37 Star 391 Fork 118

联犀/物联网iot模块

加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
文件
克隆/下载
dg_grpc.pb.go 6.62 KB
一键复制 编辑 原始数据 按行查看 历史
杨磊 提交于 2024-01-31 16:19 . feat: 整体大改
// Code generated by protoc-gen-go-grpc. DO NOT EDIT.
// versions:
// - protoc-gen-go-grpc v1.3.0
// - protoc v3.19.4
// source: proto/dg.proto
package dg
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.32.0 or later.
const _ = grpc.SupportPackageIsVersion7
const (
DeviceAuth_LoginAuth_FullMethodName = "/dg.DeviceAuth/loginAuth"
DeviceAuth_AccessAuth_FullMethodName = "/dg.DeviceAuth/accessAuth"
DeviceAuth_DeviceRegister_FullMethodName = "/dg.DeviceAuth/deviceRegister"
)
// DeviceAuthClient is the client API for DeviceAuth 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 DeviceAuthClient interface {
// 设备登录认证
LoginAuth(ctx context.Context, in *LoginAuthReq, opts ...grpc.CallOption) (*Response, error)
// 设备操作认证
AccessAuth(ctx context.Context, in *AccessAuthReq, opts ...grpc.CallOption) (*Response, error)
// 设备动态注册
DeviceRegister(ctx context.Context, in *DeviceRegisterReq, opts ...grpc.CallOption) (*DeviceRegisterResp, error)
}
type deviceAuthClient struct {
cc grpc.ClientConnInterface
}
func NewDeviceAuthClient(cc grpc.ClientConnInterface) DeviceAuthClient {
return &deviceAuthClient{cc}
}
func (c *deviceAuthClient) LoginAuth(ctx context.Context, in *LoginAuthReq, opts ...grpc.CallOption) (*Response, error) {
out := new(Response)
err := c.cc.Invoke(ctx, DeviceAuth_LoginAuth_FullMethodName, in, out, opts...)
if err != nil {
return nil, err
}
return out, nil
}
func (c *deviceAuthClient) AccessAuth(ctx context.Context, in *AccessAuthReq, opts ...grpc.CallOption) (*Response, error) {
out := new(Response)
err := c.cc.Invoke(ctx, DeviceAuth_AccessAuth_FullMethodName, in, out, opts...)
if err != nil {
return nil, err
}
return out, nil
}
func (c *deviceAuthClient) DeviceRegister(ctx context.Context, in *DeviceRegisterReq, opts ...grpc.CallOption) (*DeviceRegisterResp, error) {
out := new(DeviceRegisterResp)
err := c.cc.Invoke(ctx, DeviceAuth_DeviceRegister_FullMethodName, in, out, opts...)
if err != nil {
return nil, err
}
return out, nil
}
// DeviceAuthServer is the server API for DeviceAuth service.
// All implementations must embed UnimplementedDeviceAuthServer
// for forward compatibility
type DeviceAuthServer interface {
// 设备登录认证
LoginAuth(context.Context, *LoginAuthReq) (*Response, error)
// 设备操作认证
AccessAuth(context.Context, *AccessAuthReq) (*Response, error)
// 设备动态注册
DeviceRegister(context.Context, *DeviceRegisterReq) (*DeviceRegisterResp, error)
mustEmbedUnimplementedDeviceAuthServer()
}
// UnimplementedDeviceAuthServer must be embedded to have forward compatible implementations.
type UnimplementedDeviceAuthServer struct {
}
func (UnimplementedDeviceAuthServer) LoginAuth(context.Context, *LoginAuthReq) (*Response, error) {
return nil, status.Errorf(codes.Unimplemented, "method LoginAuth not implemented")
}
func (UnimplementedDeviceAuthServer) AccessAuth(context.Context, *AccessAuthReq) (*Response, error) {
return nil, status.Errorf(codes.Unimplemented, "method AccessAuth not implemented")
}
func (UnimplementedDeviceAuthServer) DeviceRegister(context.Context, *DeviceRegisterReq) (*DeviceRegisterResp, error) {
return nil, status.Errorf(codes.Unimplemented, "method DeviceRegister not implemented")
}
func (UnimplementedDeviceAuthServer) mustEmbedUnimplementedDeviceAuthServer() {}
// UnsafeDeviceAuthServer may be embedded to opt out of forward compatibility for this service.
// Use of this interface is not recommended, as added methods to DeviceAuthServer will
// result in compilation errors.
type UnsafeDeviceAuthServer interface {
mustEmbedUnimplementedDeviceAuthServer()
}
func RegisterDeviceAuthServer(s grpc.ServiceRegistrar, srv DeviceAuthServer) {
s.RegisterService(&DeviceAuth_ServiceDesc, srv)
}
func _DeviceAuth_LoginAuth_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
in := new(LoginAuthReq)
if err := dec(in); err != nil {
return nil, err
}
if interceptor == nil {
return srv.(DeviceAuthServer).LoginAuth(ctx, in)
}
info := &grpc.UnaryServerInfo{
Server: srv,
FullMethod: DeviceAuth_LoginAuth_FullMethodName,
}
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
return srv.(DeviceAuthServer).LoginAuth(ctx, req.(*LoginAuthReq))
}
return interceptor(ctx, in, info, handler)
}
func _DeviceAuth_AccessAuth_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
in := new(AccessAuthReq)
if err := dec(in); err != nil {
return nil, err
}
if interceptor == nil {
return srv.(DeviceAuthServer).AccessAuth(ctx, in)
}
info := &grpc.UnaryServerInfo{
Server: srv,
FullMethod: DeviceAuth_AccessAuth_FullMethodName,
}
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
return srv.(DeviceAuthServer).AccessAuth(ctx, req.(*AccessAuthReq))
}
return interceptor(ctx, in, info, handler)
}
func _DeviceAuth_DeviceRegister_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
in := new(DeviceRegisterReq)
if err := dec(in); err != nil {
return nil, err
}
if interceptor == nil {
return srv.(DeviceAuthServer).DeviceRegister(ctx, in)
}
info := &grpc.UnaryServerInfo{
Server: srv,
FullMethod: DeviceAuth_DeviceRegister_FullMethodName,
}
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
return srv.(DeviceAuthServer).DeviceRegister(ctx, req.(*DeviceRegisterReq))
}
return interceptor(ctx, in, info, handler)
}
// DeviceAuth_ServiceDesc is the grpc.ServiceDesc for DeviceAuth service.
// It's only intended for direct use with grpc.RegisterService,
// and not to be introspected or modified (even as a copy)
var DeviceAuth_ServiceDesc = grpc.ServiceDesc{
ServiceName: "dg.DeviceAuth",
HandlerType: (*DeviceAuthServer)(nil),
Methods: []grpc.MethodDesc{
{
MethodName: "loginAuth",
Handler: _DeviceAuth_LoginAuth_Handler,
},
{
MethodName: "accessAuth",
Handler: _DeviceAuth_AccessAuth_Handler,
},
{
MethodName: "deviceRegister",
Handler: _DeviceAuth_DeviceRegister_Handler,
},
},
Streams: []grpc.StreamDesc{},
Metadata: "proto/dg.proto",
}
Loading...
马建仓 AI 助手
尝试更多
代码解读
代码找茬
代码优化
Go
1
https://gitee.com/unitedrhino/things.git
git@gitee.com:unitedrhino/things.git
unitedrhino
things
物联网iot模块
v1.1.1

搜索帮助