208 lines
		
	
	
		
			7.0 KiB
		
	
	
	
		
			Go
		
	
	
	
			
		
		
	
	
			208 lines
		
	
	
		
			7.0 KiB
		
	
	
	
		
			Go
		
	
	
	
| // Code generated by protoc-gen-go-grpc. DO NOT EDIT.
 | |
| // versions:
 | |
| // - protoc-gen-go-grpc v1.5.1
 | |
| // - protoc             (unknown)
 | |
| // source: check.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 (
 | |
| 	Check_Hello_FullMethodName   = "/initial.Check/Hello"
 | |
| 	Check_Config_FullMethodName  = "/initial.Check/Config"
 | |
| 	Check_Updates_FullMethodName = "/initial.Check/Updates"
 | |
| )
 | |
| 
 | |
| // CheckClient is the client API for Check 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 CheckClient interface {
 | |
| 	// HELLO
 | |
| 	Hello(ctx context.Context, in *Crc, opts ...grpc.CallOption) (*StatusReply, error)
 | |
| 	// 获取应用的相关配置信息
 | |
| 	Config(ctx context.Context, in *ConfigRequest, opts ...grpc.CallOption) (*ConfigReply, error)
 | |
| 	// 检查更新
 | |
| 	Updates(ctx context.Context, in *CheckForUpdatesRequest, opts ...grpc.CallOption) (*CheckForUpdatesReply, error)
 | |
| }
 | |
| 
 | |
| type checkClient struct {
 | |
| 	cc grpc.ClientConnInterface
 | |
| }
 | |
| 
 | |
| func NewCheckClient(cc grpc.ClientConnInterface) CheckClient {
 | |
| 	return &checkClient{cc}
 | |
| }
 | |
| 
 | |
| func (c *checkClient) Hello(ctx context.Context, in *Crc, opts ...grpc.CallOption) (*StatusReply, error) {
 | |
| 	cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...)
 | |
| 	out := new(StatusReply)
 | |
| 	err := c.cc.Invoke(ctx, Check_Hello_FullMethodName, in, out, cOpts...)
 | |
| 	if err != nil {
 | |
| 		return nil, err
 | |
| 	}
 | |
| 	return out, nil
 | |
| }
 | |
| 
 | |
| func (c *checkClient) 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, Check_Config_FullMethodName, in, out, cOpts...)
 | |
| 	if err != nil {
 | |
| 		return nil, err
 | |
| 	}
 | |
| 	return out, nil
 | |
| }
 | |
| 
 | |
| func (c *checkClient) Updates(ctx context.Context, in *CheckForUpdatesRequest, opts ...grpc.CallOption) (*CheckForUpdatesReply, error) {
 | |
| 	cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...)
 | |
| 	out := new(CheckForUpdatesReply)
 | |
| 	err := c.cc.Invoke(ctx, Check_Updates_FullMethodName, in, out, cOpts...)
 | |
| 	if err != nil {
 | |
| 		return nil, err
 | |
| 	}
 | |
| 	return out, nil
 | |
| }
 | |
| 
 | |
| // CheckServer is the server API for Check service.
 | |
| // All implementations must embed UnimplementedCheckServer
 | |
| // for forward compatibility.
 | |
| //
 | |
| // initial-检测是否有新版或新的配置
 | |
| type CheckServer interface {
 | |
| 	// HELLO
 | |
| 	Hello(context.Context, *Crc) (*StatusReply, error)
 | |
| 	// 获取应用的相关配置信息
 | |
| 	Config(context.Context, *ConfigRequest) (*ConfigReply, error)
 | |
| 	// 检查更新
 | |
| 	Updates(context.Context, *CheckForUpdatesRequest) (*CheckForUpdatesReply, error)
 | |
| 	mustEmbedUnimplementedCheckServer()
 | |
| }
 | |
| 
 | |
| // UnimplementedCheckServer 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 UnimplementedCheckServer struct{}
 | |
| 
 | |
| func (UnimplementedCheckServer) Hello(context.Context, *Crc) (*StatusReply, error) {
 | |
| 	return nil, status.Errorf(codes.Unimplemented, "method Hello not implemented")
 | |
| }
 | |
| func (UnimplementedCheckServer) Config(context.Context, *ConfigRequest) (*ConfigReply, error) {
 | |
| 	return nil, status.Errorf(codes.Unimplemented, "method Config not implemented")
 | |
| }
 | |
| func (UnimplementedCheckServer) Updates(context.Context, *CheckForUpdatesRequest) (*CheckForUpdatesReply, error) {
 | |
| 	return nil, status.Errorf(codes.Unimplemented, "method Updates not implemented")
 | |
| }
 | |
| func (UnimplementedCheckServer) mustEmbedUnimplementedCheckServer() {}
 | |
| func (UnimplementedCheckServer) testEmbeddedByValue()               {}
 | |
| 
 | |
| // UnsafeCheckServer may be embedded to opt out of forward compatibility for this service.
 | |
| // Use of this interface is not recommended, as added methods to CheckServer will
 | |
| // result in compilation errors.
 | |
| type UnsafeCheckServer interface {
 | |
| 	mustEmbedUnimplementedCheckServer()
 | |
| }
 | |
| 
 | |
| func RegisterCheckServer(s grpc.ServiceRegistrar, srv CheckServer) {
 | |
| 	// If the following call pancis, it indicates UnimplementedCheckServer 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(&Check_ServiceDesc, srv)
 | |
| }
 | |
| 
 | |
| func _Check_Hello_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
 | |
| 	in := new(Crc)
 | |
| 	if err := dec(in); err != nil {
 | |
| 		return nil, err
 | |
| 	}
 | |
| 	if interceptor == nil {
 | |
| 		return srv.(CheckServer).Hello(ctx, in)
 | |
| 	}
 | |
| 	info := &grpc.UnaryServerInfo{
 | |
| 		Server:     srv,
 | |
| 		FullMethod: Check_Hello_FullMethodName,
 | |
| 	}
 | |
| 	handler := func(ctx context.Context, req interface{}) (interface{}, error) {
 | |
| 		return srv.(CheckServer).Hello(ctx, req.(*Crc))
 | |
| 	}
 | |
| 	return interceptor(ctx, in, info, handler)
 | |
| }
 | |
| 
 | |
| func _Check_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.(CheckServer).Config(ctx, in)
 | |
| 	}
 | |
| 	info := &grpc.UnaryServerInfo{
 | |
| 		Server:     srv,
 | |
| 		FullMethod: Check_Config_FullMethodName,
 | |
| 	}
 | |
| 	handler := func(ctx context.Context, req interface{}) (interface{}, error) {
 | |
| 		return srv.(CheckServer).Config(ctx, req.(*ConfigRequest))
 | |
| 	}
 | |
| 	return interceptor(ctx, in, info, handler)
 | |
| }
 | |
| 
 | |
| func _Check_Updates_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
 | |
| 	in := new(CheckForUpdatesRequest)
 | |
| 	if err := dec(in); err != nil {
 | |
| 		return nil, err
 | |
| 	}
 | |
| 	if interceptor == nil {
 | |
| 		return srv.(CheckServer).Updates(ctx, in)
 | |
| 	}
 | |
| 	info := &grpc.UnaryServerInfo{
 | |
| 		Server:     srv,
 | |
| 		FullMethod: Check_Updates_FullMethodName,
 | |
| 	}
 | |
| 	handler := func(ctx context.Context, req interface{}) (interface{}, error) {
 | |
| 		return srv.(CheckServer).Updates(ctx, req.(*CheckForUpdatesRequest))
 | |
| 	}
 | |
| 	return interceptor(ctx, in, info, handler)
 | |
| }
 | |
| 
 | |
| // Check_ServiceDesc is the grpc.ServiceDesc for Check service.
 | |
| // It's only intended for direct use with grpc.RegisterService,
 | |
| // and not to be introspected or modified (even as a copy)
 | |
| var Check_ServiceDesc = grpc.ServiceDesc{
 | |
| 	ServiceName: "initial.Check",
 | |
| 	HandlerType: (*CheckServer)(nil),
 | |
| 	Methods: []grpc.MethodDesc{
 | |
| 		{
 | |
| 			MethodName: "Hello",
 | |
| 			Handler:    _Check_Hello_Handler,
 | |
| 		},
 | |
| 		{
 | |
| 			MethodName: "Config",
 | |
| 			Handler:    _Check_Config_Handler,
 | |
| 		},
 | |
| 		{
 | |
| 			MethodName: "Updates",
 | |
| 			Handler:    _Check_Updates_Handler,
 | |
| 		},
 | |
| 	},
 | |
| 	Streams:  []grpc.StreamDesc{},
 | |
| 	Metadata: "check.proto",
 | |
| }
 |