208 lines
6.8 KiB
Go
208 lines
6.8 KiB
Go
// Code generated by protoc-gen-go-grpc. DO NOT EDIT.
|
|
// versions:
|
|
// - protoc-gen-go-grpc v1.5.1
|
|
// - protoc (unknown)
|
|
// source: data.proto
|
|
|
|
package initial
|
|
|
|
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 (
|
|
Data_Config_FullMethodName = "/initial.Data/Config"
|
|
Data_Areas_FullMethodName = "/initial.Data/Areas"
|
|
Data_Tags_FullMethodName = "/initial.Data/Tags"
|
|
)
|
|
|
|
// DataClient is the client API for Data 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.
|
|
//
|
|
// initial-数据
|
|
type DataClient interface {
|
|
// 获取应用的相关配置信息
|
|
Config(ctx context.Context, in *ConfigRequest, opts ...grpc.CallOption) (*ConfigReply, error)
|
|
// 系统区域数据,默认级别:市
|
|
Areas(ctx context.Context, in *AreasRequest, opts ...grpc.CallOption) (*AreasReply, error)
|
|
// 系统标签数据
|
|
Tags(ctx context.Context, in *Empty, opts ...grpc.CallOption) (*TagsReply, error)
|
|
}
|
|
|
|
type dataClient struct {
|
|
cc grpc.ClientConnInterface
|
|
}
|
|
|
|
func NewDataClient(cc grpc.ClientConnInterface) DataClient {
|
|
return &dataClient{cc}
|
|
}
|
|
|
|
func (c *dataClient) Config(ctx context.Context, in *ConfigRequest, opts ...grpc.CallOption) (*ConfigReply, error) {
|
|
cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...)
|
|
out := new(ConfigReply)
|
|
err := c.cc.Invoke(ctx, Data_Config_FullMethodName, in, out, cOpts...)
|
|
if err != nil {
|
|
return nil, err
|
|
}
|
|
return out, nil
|
|
}
|
|
|
|
func (c *dataClient) Areas(ctx context.Context, in *AreasRequest, opts ...grpc.CallOption) (*AreasReply, error) {
|
|
cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...)
|
|
out := new(AreasReply)
|
|
err := c.cc.Invoke(ctx, Data_Areas_FullMethodName, in, out, cOpts...)
|
|
if err != nil {
|
|
return nil, err
|
|
}
|
|
return out, nil
|
|
}
|
|
|
|
func (c *dataClient) Tags(ctx context.Context, in *Empty, opts ...grpc.CallOption) (*TagsReply, error) {
|
|
cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...)
|
|
out := new(TagsReply)
|
|
err := c.cc.Invoke(ctx, Data_Tags_FullMethodName, in, out, cOpts...)
|
|
if err != nil {
|
|
return nil, err
|
|
}
|
|
return out, nil
|
|
}
|
|
|
|
// DataServer is the server API for Data service.
|
|
// All implementations must embed UnimplementedDataServer
|
|
// for forward compatibility.
|
|
//
|
|
// initial-数据
|
|
type DataServer interface {
|
|
// 获取应用的相关配置信息
|
|
Config(context.Context, *ConfigRequest) (*ConfigReply, error)
|
|
// 系统区域数据,默认级别:市
|
|
Areas(context.Context, *AreasRequest) (*AreasReply, error)
|
|
// 系统标签数据
|
|
Tags(context.Context, *Empty) (*TagsReply, error)
|
|
mustEmbedUnimplementedDataServer()
|
|
}
|
|
|
|
// UnimplementedDataServer 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 UnimplementedDataServer struct{}
|
|
|
|
func (UnimplementedDataServer) Config(context.Context, *ConfigRequest) (*ConfigReply, error) {
|
|
return nil, status.Errorf(codes.Unimplemented, "method Config not implemented")
|
|
}
|
|
func (UnimplementedDataServer) Areas(context.Context, *AreasRequest) (*AreasReply, error) {
|
|
return nil, status.Errorf(codes.Unimplemented, "method Areas not implemented")
|
|
}
|
|
func (UnimplementedDataServer) Tags(context.Context, *Empty) (*TagsReply, error) {
|
|
return nil, status.Errorf(codes.Unimplemented, "method Tags not implemented")
|
|
}
|
|
func (UnimplementedDataServer) mustEmbedUnimplementedDataServer() {}
|
|
func (UnimplementedDataServer) testEmbeddedByValue() {}
|
|
|
|
// UnsafeDataServer may be embedded to opt out of forward compatibility for this service.
|
|
// Use of this interface is not recommended, as added methods to DataServer will
|
|
// result in compilation errors.
|
|
type UnsafeDataServer interface {
|
|
mustEmbedUnimplementedDataServer()
|
|
}
|
|
|
|
func RegisterDataServer(s grpc.ServiceRegistrar, srv DataServer) {
|
|
// If the following call pancis, it indicates UnimplementedDataServer 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(&Data_ServiceDesc, srv)
|
|
}
|
|
|
|
func _Data_Config_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
|
|
in := new(ConfigRequest)
|
|
if err := dec(in); err != nil {
|
|
return nil, err
|
|
}
|
|
if interceptor == nil {
|
|
return srv.(DataServer).Config(ctx, in)
|
|
}
|
|
info := &grpc.UnaryServerInfo{
|
|
Server: srv,
|
|
FullMethod: Data_Config_FullMethodName,
|
|
}
|
|
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
|
|
return srv.(DataServer).Config(ctx, req.(*ConfigRequest))
|
|
}
|
|
return interceptor(ctx, in, info, handler)
|
|
}
|
|
|
|
func _Data_Areas_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
|
|
in := new(AreasRequest)
|
|
if err := dec(in); err != nil {
|
|
return nil, err
|
|
}
|
|
if interceptor == nil {
|
|
return srv.(DataServer).Areas(ctx, in)
|
|
}
|
|
info := &grpc.UnaryServerInfo{
|
|
Server: srv,
|
|
FullMethod: Data_Areas_FullMethodName,
|
|
}
|
|
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
|
|
return srv.(DataServer).Areas(ctx, req.(*AreasRequest))
|
|
}
|
|
return interceptor(ctx, in, info, handler)
|
|
}
|
|
|
|
func _Data_Tags_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
|
|
in := new(Empty)
|
|
if err := dec(in); err != nil {
|
|
return nil, err
|
|
}
|
|
if interceptor == nil {
|
|
return srv.(DataServer).Tags(ctx, in)
|
|
}
|
|
info := &grpc.UnaryServerInfo{
|
|
Server: srv,
|
|
FullMethod: Data_Tags_FullMethodName,
|
|
}
|
|
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
|
|
return srv.(DataServer).Tags(ctx, req.(*Empty))
|
|
}
|
|
return interceptor(ctx, in, info, handler)
|
|
}
|
|
|
|
// Data_ServiceDesc is the grpc.ServiceDesc for Data service.
|
|
// It's only intended for direct use with grpc.RegisterService,
|
|
// and not to be introspected or modified (even as a copy)
|
|
var Data_ServiceDesc = grpc.ServiceDesc{
|
|
ServiceName: "initial.Data",
|
|
HandlerType: (*DataServer)(nil),
|
|
Methods: []grpc.MethodDesc{
|
|
{
|
|
MethodName: "Config",
|
|
Handler: _Data_Config_Handler,
|
|
},
|
|
{
|
|
MethodName: "Areas",
|
|
Handler: _Data_Areas_Handler,
|
|
},
|
|
{
|
|
MethodName: "Tags",
|
|
Handler: _Data_Tags_Handler,
|
|
},
|
|
},
|
|
Streams: []grpc.StreamDesc{},
|
|
Metadata: "data.proto",
|
|
}
|