mirror of
https://github.com/zhufuyi/sponge.git
synced 2025-10-05 16:57:07 +08:00
271 lines
10 KiB
Go
271 lines
10 KiB
Go
// todo generate the protobuf code here
|
|
// delete the templates code start
|
|
|
|
// Code generated by protoc-gen-go-grpc. DO NOT EDIT.
|
|
// versions:
|
|
// - protoc-gen-go-grpc v1.3.0
|
|
// - protoc v4.25.2
|
|
// source: api/serverNameExample/v1/userExample.proto
|
|
|
|
package v1
|
|
|
|
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 (
|
|
UserExample_Create_FullMethodName = "/api.serverNameExample.v1.userExample/Create"
|
|
UserExample_DeleteByID_FullMethodName = "/api.serverNameExample.v1.userExample/DeleteByID"
|
|
UserExample_UpdateByID_FullMethodName = "/api.serverNameExample.v1.userExample/UpdateByID"
|
|
UserExample_GetByID_FullMethodName = "/api.serverNameExample.v1.userExample/GetByID"
|
|
UserExample_List_FullMethodName = "/api.serverNameExample.v1.userExample/List"
|
|
)
|
|
|
|
// UserExampleClient is the client API for UserExample 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 UserExampleClient interface {
|
|
// create userExample
|
|
Create(ctx context.Context, in *CreateUserExampleRequest, opts ...grpc.CallOption) (*CreateUserExampleReply, error)
|
|
// delete userExample by id
|
|
DeleteByID(ctx context.Context, in *DeleteUserExampleByIDRequest, opts ...grpc.CallOption) (*DeleteUserExampleByIDReply, error)
|
|
// update userExample by id
|
|
UpdateByID(ctx context.Context, in *UpdateUserExampleByIDRequest, opts ...grpc.CallOption) (*UpdateUserExampleByIDReply, error)
|
|
// get userExample by id
|
|
GetByID(ctx context.Context, in *GetUserExampleByIDRequest, opts ...grpc.CallOption) (*GetUserExampleByIDReply, error)
|
|
// list of userExample by query parameters
|
|
List(ctx context.Context, in *ListUserExampleRequest, opts ...grpc.CallOption) (*ListUserExampleReply, error)
|
|
}
|
|
|
|
type userExampleClient struct {
|
|
cc grpc.ClientConnInterface
|
|
}
|
|
|
|
func NewUserExampleClient(cc grpc.ClientConnInterface) UserExampleClient {
|
|
return &userExampleClient{cc}
|
|
}
|
|
|
|
func (c *userExampleClient) Create(ctx context.Context, in *CreateUserExampleRequest, opts ...grpc.CallOption) (*CreateUserExampleReply, error) {
|
|
out := new(CreateUserExampleReply)
|
|
err := c.cc.Invoke(ctx, UserExample_Create_FullMethodName, in, out, opts...)
|
|
if err != nil {
|
|
return nil, err
|
|
}
|
|
return out, nil
|
|
}
|
|
|
|
func (c *userExampleClient) DeleteByID(ctx context.Context, in *DeleteUserExampleByIDRequest, opts ...grpc.CallOption) (*DeleteUserExampleByIDReply, error) {
|
|
out := new(DeleteUserExampleByIDReply)
|
|
err := c.cc.Invoke(ctx, UserExample_DeleteByID_FullMethodName, in, out, opts...)
|
|
if err != nil {
|
|
return nil, err
|
|
}
|
|
return out, nil
|
|
}
|
|
|
|
func (c *userExampleClient) UpdateByID(ctx context.Context, in *UpdateUserExampleByIDRequest, opts ...grpc.CallOption) (*UpdateUserExampleByIDReply, error) {
|
|
out := new(UpdateUserExampleByIDReply)
|
|
err := c.cc.Invoke(ctx, UserExample_UpdateByID_FullMethodName, in, out, opts...)
|
|
if err != nil {
|
|
return nil, err
|
|
}
|
|
return out, nil
|
|
}
|
|
|
|
func (c *userExampleClient) GetByID(ctx context.Context, in *GetUserExampleByIDRequest, opts ...grpc.CallOption) (*GetUserExampleByIDReply, error) {
|
|
out := new(GetUserExampleByIDReply)
|
|
err := c.cc.Invoke(ctx, UserExample_GetByID_FullMethodName, in, out, opts...)
|
|
if err != nil {
|
|
return nil, err
|
|
}
|
|
return out, nil
|
|
}
|
|
|
|
func (c *userExampleClient) List(ctx context.Context, in *ListUserExampleRequest, opts ...grpc.CallOption) (*ListUserExampleReply, error) {
|
|
out := new(ListUserExampleReply)
|
|
err := c.cc.Invoke(ctx, UserExample_List_FullMethodName, in, out, opts...)
|
|
if err != nil {
|
|
return nil, err
|
|
}
|
|
return out, nil
|
|
}
|
|
|
|
// UserExampleServer is the server API for UserExample service.
|
|
// All implementations must embed UnimplementedUserExampleServer
|
|
// for forward compatibility
|
|
type UserExampleServer interface {
|
|
// create userExample
|
|
Create(context.Context, *CreateUserExampleRequest) (*CreateUserExampleReply, error)
|
|
// delete userExample by id
|
|
DeleteByID(context.Context, *DeleteUserExampleByIDRequest) (*DeleteUserExampleByIDReply, error)
|
|
// update userExample by id
|
|
UpdateByID(context.Context, *UpdateUserExampleByIDRequest) (*UpdateUserExampleByIDReply, error)
|
|
// get userExample by id
|
|
GetByID(context.Context, *GetUserExampleByIDRequest) (*GetUserExampleByIDReply, error)
|
|
// list of userExample by query parameters
|
|
List(context.Context, *ListUserExampleRequest) (*ListUserExampleReply, error)
|
|
mustEmbedUnimplementedUserExampleServer()
|
|
}
|
|
|
|
// UnimplementedUserExampleServer must be embedded to have forward compatible implementations.
|
|
type UnimplementedUserExampleServer struct {
|
|
}
|
|
|
|
func (UnimplementedUserExampleServer) Create(context.Context, *CreateUserExampleRequest) (*CreateUserExampleReply, error) {
|
|
return nil, status.Errorf(codes.Unimplemented, "method Create not implemented")
|
|
}
|
|
func (UnimplementedUserExampleServer) DeleteByID(context.Context, *DeleteUserExampleByIDRequest) (*DeleteUserExampleByIDReply, error) {
|
|
return nil, status.Errorf(codes.Unimplemented, "method DeleteByID not implemented")
|
|
}
|
|
func (UnimplementedUserExampleServer) UpdateByID(context.Context, *UpdateUserExampleByIDRequest) (*UpdateUserExampleByIDReply, error) {
|
|
return nil, status.Errorf(codes.Unimplemented, "method UpdateByID not implemented")
|
|
}
|
|
func (UnimplementedUserExampleServer) GetByID(context.Context, *GetUserExampleByIDRequest) (*GetUserExampleByIDReply, error) {
|
|
return nil, status.Errorf(codes.Unimplemented, "method GetByID not implemented")
|
|
}
|
|
func (UnimplementedUserExampleServer) List(context.Context, *ListUserExampleRequest) (*ListUserExampleReply, error) {
|
|
return nil, status.Errorf(codes.Unimplemented, "method List not implemented")
|
|
}
|
|
func (UnimplementedUserExampleServer) mustEmbedUnimplementedUserExampleServer() {}
|
|
|
|
// UnsafeUserExampleServer may be embedded to opt out of forward compatibility for this service.
|
|
// Use of this interface is not recommended, as added methods to UserExampleServer will
|
|
// result in compilation errors.
|
|
type UnsafeUserExampleServer interface {
|
|
mustEmbedUnimplementedUserExampleServer()
|
|
}
|
|
|
|
func RegisterUserExampleServer(s grpc.ServiceRegistrar, srv UserExampleServer) {
|
|
s.RegisterService(&UserExample_ServiceDesc, srv)
|
|
}
|
|
|
|
func _UserExample_Create_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
|
|
in := new(CreateUserExampleRequest)
|
|
if err := dec(in); err != nil {
|
|
return nil, err
|
|
}
|
|
if interceptor == nil {
|
|
return srv.(UserExampleServer).Create(ctx, in)
|
|
}
|
|
info := &grpc.UnaryServerInfo{
|
|
Server: srv,
|
|
FullMethod: UserExample_Create_FullMethodName,
|
|
}
|
|
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
|
|
return srv.(UserExampleServer).Create(ctx, req.(*CreateUserExampleRequest))
|
|
}
|
|
return interceptor(ctx, in, info, handler)
|
|
}
|
|
|
|
func _UserExample_DeleteByID_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
|
|
in := new(DeleteUserExampleByIDRequest)
|
|
if err := dec(in); err != nil {
|
|
return nil, err
|
|
}
|
|
if interceptor == nil {
|
|
return srv.(UserExampleServer).DeleteByID(ctx, in)
|
|
}
|
|
info := &grpc.UnaryServerInfo{
|
|
Server: srv,
|
|
FullMethod: UserExample_DeleteByID_FullMethodName,
|
|
}
|
|
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
|
|
return srv.(UserExampleServer).DeleteByID(ctx, req.(*DeleteUserExampleByIDRequest))
|
|
}
|
|
return interceptor(ctx, in, info, handler)
|
|
}
|
|
|
|
func _UserExample_UpdateByID_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
|
|
in := new(UpdateUserExampleByIDRequest)
|
|
if err := dec(in); err != nil {
|
|
return nil, err
|
|
}
|
|
if interceptor == nil {
|
|
return srv.(UserExampleServer).UpdateByID(ctx, in)
|
|
}
|
|
info := &grpc.UnaryServerInfo{
|
|
Server: srv,
|
|
FullMethod: UserExample_UpdateByID_FullMethodName,
|
|
}
|
|
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
|
|
return srv.(UserExampleServer).UpdateByID(ctx, req.(*UpdateUserExampleByIDRequest))
|
|
}
|
|
return interceptor(ctx, in, info, handler)
|
|
}
|
|
|
|
func _UserExample_GetByID_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
|
|
in := new(GetUserExampleByIDRequest)
|
|
if err := dec(in); err != nil {
|
|
return nil, err
|
|
}
|
|
if interceptor == nil {
|
|
return srv.(UserExampleServer).GetByID(ctx, in)
|
|
}
|
|
info := &grpc.UnaryServerInfo{
|
|
Server: srv,
|
|
FullMethod: UserExample_GetByID_FullMethodName,
|
|
}
|
|
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
|
|
return srv.(UserExampleServer).GetByID(ctx, req.(*GetUserExampleByIDRequest))
|
|
}
|
|
return interceptor(ctx, in, info, handler)
|
|
}
|
|
|
|
func _UserExample_List_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
|
|
in := new(ListUserExampleRequest)
|
|
if err := dec(in); err != nil {
|
|
return nil, err
|
|
}
|
|
if interceptor == nil {
|
|
return srv.(UserExampleServer).List(ctx, in)
|
|
}
|
|
info := &grpc.UnaryServerInfo{
|
|
Server: srv,
|
|
FullMethod: UserExample_List_FullMethodName,
|
|
}
|
|
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
|
|
return srv.(UserExampleServer).List(ctx, req.(*ListUserExampleRequest))
|
|
}
|
|
return interceptor(ctx, in, info, handler)
|
|
}
|
|
|
|
// UserExample_ServiceDesc is the grpc.ServiceDesc for UserExample service.
|
|
// It's only intended for direct use with grpc.RegisterService,
|
|
// and not to be introspected or modified (even as a copy)
|
|
var UserExample_ServiceDesc = grpc.ServiceDesc{
|
|
ServiceName: "api.serverNameExample.v1.userExample",
|
|
HandlerType: (*UserExampleServer)(nil),
|
|
Methods: []grpc.MethodDesc{
|
|
{
|
|
MethodName: "Create",
|
|
Handler: _UserExample_Create_Handler,
|
|
},
|
|
{
|
|
MethodName: "DeleteByID",
|
|
Handler: _UserExample_DeleteByID_Handler,
|
|
},
|
|
{
|
|
MethodName: "UpdateByID",
|
|
Handler: _UserExample_UpdateByID_Handler,
|
|
},
|
|
{
|
|
MethodName: "GetByID",
|
|
Handler: _UserExample_GetByID_Handler,
|
|
},
|
|
{
|
|
MethodName: "List",
|
|
Handler: _UserExample_List_Handler,
|
|
},
|
|
},
|
|
Streams: []grpc.StreamDesc{},
|
|
Metadata: "api/serverNameExample/v1/userExample.proto",
|
|
}
|