proto_user_service

package
v0.0.0-...-be0dec0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jan 26, 2023 License: Apache-2.0 Imports: 17 Imported by: 0

Documentation

Overview

Package proto_user_service is a reverse proxy.

It translates gRPC into RESTful JSON APIs.

Index

Constants

This section is empty.

Variables

View Source
var File_proto_service_v1_service_proto protoreflect.FileDescriptor
View Source
var UserService_ServiceDesc = grpc.ServiceDesc{
	ServiceName: "proto.service.v1.UserService",
	HandlerType: (*UserServiceServer)(nil),
	Methods: []grpc.MethodDesc{
		{
			MethodName: "GetUsers",
			Handler:    _UserService_GetUsers_Handler,
		},
		{
			MethodName: "UpdateUser",
			Handler:    _UserService_UpdateUser_Handler,
		},
	},
	Streams:  []grpc.StreamDesc{},
	Metadata: "proto/service/v1/service.proto",
}

UserService_ServiceDesc is the grpc.ServiceDesc for UserService service. It's only intended for direct use with grpc.RegisterService, and not to be introspected or modified (even as a copy)

Functions

func RegisterUserServiceHandler

func RegisterUserServiceHandler(ctx context.Context, mux *runtime.ServeMux, conn *grpc.ClientConn) error

RegisterUserServiceHandler registers the http handlers for service UserService to "mux". The handlers forward requests to the grpc endpoint over "conn".

func RegisterUserServiceHandlerClient

func RegisterUserServiceHandlerClient(ctx context.Context, mux *runtime.ServeMux, client UserServiceClient) error

RegisterUserServiceHandlerClient registers the http handlers for service UserService to "mux". The handlers forward requests to the grpc endpoint over the given implementation of "UserServiceClient". Note: the gRPC framework executes interceptors within the gRPC handler. If the passed in "UserServiceClient" doesn't go through the normal gRPC flow (creating a gRPC client etc.) then it will be up to the passed in "UserServiceClient" to call the correct interceptors.

func RegisterUserServiceHandlerFromEndpoint

func RegisterUserServiceHandlerFromEndpoint(ctx context.Context, mux *runtime.ServeMux, endpoint string, opts []grpc.DialOption) (err error)

RegisterUserServiceHandlerFromEndpoint is same as RegisterUserServiceHandler but automatically dials to "endpoint" and closes the connection when "ctx" gets done.

func RegisterUserServiceHandlerServer

func RegisterUserServiceHandlerServer(ctx context.Context, mux *runtime.ServeMux, server UserServiceServer) error

RegisterUserServiceHandlerServer registers the http handlers for service UserService to "mux". UnaryRPC :call UserServiceServer directly. StreamingRPC :currently unsupported pending https://github.com/grpc/grpc-go/issues/906. Note that using this registration option will cause many gRPC library features to stop working. Consider using RegisterUserServiceHandlerFromEndpoint instead.

func RegisterUserServiceServer

func RegisterUserServiceServer(s grpc.ServiceRegistrar, srv UserServiceServer)

Types

type GetUsersRequest

type GetUsersRequest struct {
	Name  *string `protobuf:"bytes,1,opt,name=name,proto3,oneof" json:"name,omitempty"`   //mapped to querry URL parameter ?name = ""
	Email *string `protobuf:"bytes,2,opt,name=email,proto3,oneof" json:"email,omitempty"` //mapped to querry URL parameter ?email = ""
	Id    *string `protobuf:"bytes,3,opt,name=id,proto3,oneof" json:"id,omitempty"`       //mapped to querry URL parameter ?id = ""
	Age   *string `protobuf:"bytes,4,opt,name=age,proto3,oneof" json:"age,omitempty"`     //mapped to querry URL parameter ? age = ""
	// contains filtered or unexported fields
}

func (*GetUsersRequest) Descriptor deprecated

func (*GetUsersRequest) Descriptor() ([]byte, []int)

Deprecated: Use GetUsersRequest.ProtoReflect.Descriptor instead.

func (*GetUsersRequest) GetAge

func (x *GetUsersRequest) GetAge() string

func (*GetUsersRequest) GetEmail

func (x *GetUsersRequest) GetEmail() string

func (*GetUsersRequest) GetId

func (x *GetUsersRequest) GetId() string

func (*GetUsersRequest) GetName

func (x *GetUsersRequest) GetName() string

func (*GetUsersRequest) ProtoMessage

func (*GetUsersRequest) ProtoMessage()

func (*GetUsersRequest) ProtoReflect

func (x *GetUsersRequest) ProtoReflect() protoreflect.Message

func (*GetUsersRequest) Reset

func (x *GetUsersRequest) Reset()

func (*GetUsersRequest) String

func (x *GetUsersRequest) String() string

type GetUsersResponse

type GetUsersResponse struct {
	Users []*v1.User `protobuf:"bytes,1,rep,name=users,proto3" json:"users,omitempty"`
	// contains filtered or unexported fields
}

func (*GetUsersResponse) Descriptor deprecated

func (*GetUsersResponse) Descriptor() ([]byte, []int)

Deprecated: Use GetUsersResponse.ProtoReflect.Descriptor instead.

func (*GetUsersResponse) GetUsers

func (x *GetUsersResponse) GetUsers() []*v1.User

func (*GetUsersResponse) ProtoMessage

func (*GetUsersResponse) ProtoMessage()

func (*GetUsersResponse) ProtoReflect

func (x *GetUsersResponse) ProtoReflect() protoreflect.Message

func (*GetUsersResponse) Reset

func (x *GetUsersResponse) Reset()

func (*GetUsersResponse) String

func (x *GetUsersResponse) String() string

type UnimplementedUserServiceServer

type UnimplementedUserServiceServer struct {
}

UnimplementedUserServiceServer must be embedded to have forward compatible implementations.

func (UnimplementedUserServiceServer) GetUsers

func (UnimplementedUserServiceServer) UpdateUser

type UnsafeUserServiceServer

type UnsafeUserServiceServer interface {
	// contains filtered or unexported methods
}

UnsafeUserServiceServer may be embedded to opt out of forward compatibility for this service. Use of this interface is not recommended, as added methods to UserServiceServer will result in compilation errors.

type UpdateUserRequest

type UpdateUserRequest struct {
	Id    string  `protobuf:"bytes,1,opt,name=id,proto3" json:"id,omitempty"`             //mapped to URL
	Name  *string `protobuf:"bytes,2,opt,name=name,proto3,oneof" json:"name,omitempty"`   //mapped to body
	Email *string `protobuf:"bytes,3,opt,name=email,proto3,oneof" json:"email,omitempty"` //mapped to body
	Age   *string `protobuf:"bytes,4,opt,name=age,proto3,oneof" json:"age,omitempty"`     //mapped to body
	// contains filtered or unexported fields
}

func (*UpdateUserRequest) Descriptor deprecated

func (*UpdateUserRequest) Descriptor() ([]byte, []int)

Deprecated: Use UpdateUserRequest.ProtoReflect.Descriptor instead.

func (*UpdateUserRequest) GetAge

func (x *UpdateUserRequest) GetAge() string

func (*UpdateUserRequest) GetEmail

func (x *UpdateUserRequest) GetEmail() string

func (*UpdateUserRequest) GetId

func (x *UpdateUserRequest) GetId() string

func (*UpdateUserRequest) GetName

func (x *UpdateUserRequest) GetName() string

func (*UpdateUserRequest) ProtoMessage

func (*UpdateUserRequest) ProtoMessage()

func (*UpdateUserRequest) ProtoReflect

func (x *UpdateUserRequest) ProtoReflect() protoreflect.Message

func (*UpdateUserRequest) Reset

func (x *UpdateUserRequest) Reset()

func (*UpdateUserRequest) String

func (x *UpdateUserRequest) String() string

type UpdateUserResponse

type UpdateUserResponse struct {
	User *v1.User `protobuf:"bytes,1,opt,name=user,proto3" json:"user,omitempty"`
	// contains filtered or unexported fields
}

This is response for update users.

func (*UpdateUserResponse) Descriptor deprecated

func (*UpdateUserResponse) Descriptor() ([]byte, []int)

Deprecated: Use UpdateUserResponse.ProtoReflect.Descriptor instead.

func (*UpdateUserResponse) GetUser

func (x *UpdateUserResponse) GetUser() *v1.User

func (*UpdateUserResponse) ProtoMessage

func (*UpdateUserResponse) ProtoMessage()

func (*UpdateUserResponse) ProtoReflect

func (x *UpdateUserResponse) ProtoReflect() protoreflect.Message

func (*UpdateUserResponse) Reset

func (x *UpdateUserResponse) Reset()

func (*UpdateUserResponse) String

func (x *UpdateUserResponse) String() string

type UserServiceClient

type UserServiceClient interface {
	GetUsers(ctx context.Context, in *GetUsersRequest, opts ...grpc.CallOption) (*GetUsersResponse, error)
	UpdateUser(ctx context.Context, in *UpdateUserRequest, opts ...grpc.CallOption) (*UpdateUserResponse, error)
}

UserServiceClient is the client API for UserService 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 UserServiceServer

type UserServiceServer interface {
	GetUsers(context.Context, *GetUsersRequest) (*GetUsersResponse, error)
	UpdateUser(context.Context, *UpdateUserRequest) (*UpdateUserResponse, error)
	// contains filtered or unexported methods
}

UserServiceServer is the server API for UserService service. All implementations must embed UnimplementedUserServiceServer for forward compatibility

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL