Documentation ¶
Overview ¶
Package grpc is a reverse proxy.
It translates gRPC into RESTful JSON APIs.
Index ¶
- Variables
- func RegisterAuthServiceHandler(ctx context.Context, mux *runtime.ServeMux, conn *grpc.ClientConn) error
- func RegisterAuthServiceHandlerClient(ctx context.Context, mux *runtime.ServeMux, client AuthServiceClient) error
- func RegisterAuthServiceHandlerFromEndpoint(ctx context.Context, mux *runtime.ServeMux, endpoint string, ...) (err error)
- func RegisterAuthServiceHandlerServer(ctx context.Context, mux *runtime.ServeMux, server AuthServiceServer) error
- func RegisterAuthServiceServer(s grpc.ServiceRegistrar, srv AuthServiceServer)
- type AuthServiceClient
- type AuthServiceServer
- type SignInRequest
- func (*SignInRequest) Descriptor() ([]byte, []int)deprecated
- func (x *SignInRequest) GetEmail() string
- func (x *SignInRequest) GetPassword() string
- func (*SignInRequest) ProtoMessage()
- func (x *SignInRequest) ProtoReflect() protoreflect.Message
- func (x *SignInRequest) Reset()
- func (x *SignInRequest) String() string
- type SignInResponse
- func (*SignInResponse) Descriptor() ([]byte, []int)deprecated
- func (x *SignInResponse) GetId() string
- func (x *SignInResponse) GetName() string
- func (x *SignInResponse) GetToken() string
- func (*SignInResponse) ProtoMessage()
- func (x *SignInResponse) ProtoReflect() protoreflect.Message
- func (x *SignInResponse) Reset()
- func (x *SignInResponse) String() string
- type SignOutRequest
- func (*SignOutRequest) Descriptor() ([]byte, []int)deprecated
- func (x *SignOutRequest) GetId() string
- func (x *SignOutRequest) GetToken() string
- func (*SignOutRequest) ProtoMessage()
- func (x *SignOutRequest) ProtoReflect() protoreflect.Message
- func (x *SignOutRequest) Reset()
- func (x *SignOutRequest) String() string
- type SignOutResponse
- type SignUpRequest
- func (*SignUpRequest) Descriptor() ([]byte, []int)deprecated
- func (x *SignUpRequest) GetEmail() string
- func (x *SignUpRequest) GetName() string
- func (x *SignUpRequest) GetPassword() string
- func (*SignUpRequest) ProtoMessage()
- func (x *SignUpRequest) ProtoReflect() protoreflect.Message
- func (x *SignUpRequest) Reset()
- func (x *SignUpRequest) String() string
- type SignUpResponse
- func (*SignUpResponse) Descriptor() ([]byte, []int)deprecated
- func (x *SignUpResponse) GetEmail() string
- func (x *SignUpResponse) GetId() string
- func (x *SignUpResponse) GetName() string
- func (x *SignUpResponse) GetPassword() string
- func (x *SignUpResponse) GetToken() string
- func (*SignUpResponse) ProtoMessage()
- func (x *SignUpResponse) ProtoReflect() protoreflect.Message
- func (x *SignUpResponse) Reset()
- func (x *SignUpResponse) String() string
- type UnimplementedAuthServiceServer
- func (UnimplementedAuthServiceServer) SignIn(context.Context, *SignInRequest) (*SignInResponse, error)
- func (UnimplementedAuthServiceServer) SignOut(context.Context, *SignOutRequest) (*SignOutResponse, error)
- func (UnimplementedAuthServiceServer) SignUp(context.Context, *SignUpRequest) (*SignUpResponse, error)
- type UnsafeAuthServiceServer
Constants ¶
This section is empty.
Variables ¶
var AuthService_ServiceDesc = grpc.ServiceDesc{ ServiceName: "auth.AuthService", HandlerType: (*AuthServiceServer)(nil), Methods: []grpc.MethodDesc{ { MethodName: "SignUp", Handler: _AuthService_SignUp_Handler, }, { MethodName: "SignIn", Handler: _AuthService_SignIn_Handler, }, { MethodName: "SignOut", Handler: _AuthService_SignOut_Handler, }, }, Streams: []grpc.StreamDesc{}, Metadata: "services/auth/grpc/auth.proto", }
AuthService_ServiceDesc is the grpc.ServiceDesc for AuthService service. It's only intended for direct use with grpc.RegisterService, and not to be introspected or modified (even as a copy)
var File_services_auth_grpc_auth_proto protoreflect.FileDescriptor
Functions ¶
func RegisterAuthServiceHandler ¶
func RegisterAuthServiceHandler(ctx context.Context, mux *runtime.ServeMux, conn *grpc.ClientConn) error
RegisterAuthServiceHandler registers the http handlers for service AuthService to "mux". The handlers forward requests to the grpc endpoint over "conn".
func RegisterAuthServiceHandlerClient ¶
func RegisterAuthServiceHandlerClient(ctx context.Context, mux *runtime.ServeMux, client AuthServiceClient) error
RegisterAuthServiceHandlerClient registers the http handlers for service AuthService to "mux". The handlers forward requests to the grpc endpoint over the given implementation of "AuthServiceClient". Note: the gRPC framework executes interceptors within the gRPC handler. If the passed in "AuthServiceClient" doesn't go through the normal gRPC flow (creating a gRPC client etc.) then it will be up to the passed in "AuthServiceClient" to call the correct interceptors.
func RegisterAuthServiceHandlerFromEndpoint ¶
func RegisterAuthServiceHandlerFromEndpoint(ctx context.Context, mux *runtime.ServeMux, endpoint string, opts []grpc.DialOption) (err error)
RegisterAuthServiceHandlerFromEndpoint is same as RegisterAuthServiceHandler but automatically dials to "endpoint" and closes the connection when "ctx" gets done.
func RegisterAuthServiceHandlerServer ¶
func RegisterAuthServiceHandlerServer(ctx context.Context, mux *runtime.ServeMux, server AuthServiceServer) error
RegisterAuthServiceHandlerServer registers the http handlers for service AuthService to "mux". UnaryRPC :call AuthServiceServer 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 RegisterAuthServiceHandlerFromEndpoint instead.
func RegisterAuthServiceServer ¶
func RegisterAuthServiceServer(s grpc.ServiceRegistrar, srv AuthServiceServer)
Types ¶
type AuthServiceClient ¶
type AuthServiceClient interface { SignUp(ctx context.Context, in *SignUpRequest, opts ...grpc.CallOption) (*SignUpResponse, error) SignIn(ctx context.Context, in *SignInRequest, opts ...grpc.CallOption) (*SignInResponse, error) SignOut(ctx context.Context, in *SignOutRequest, opts ...grpc.CallOption) (*SignOutResponse, error) }
AuthServiceClient is the client API for AuthService 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.
func NewAuthServiceClient ¶
func NewAuthServiceClient(cc grpc.ClientConnInterface) AuthServiceClient
type AuthServiceServer ¶
type AuthServiceServer interface { SignUp(context.Context, *SignUpRequest) (*SignUpResponse, error) SignIn(context.Context, *SignInRequest) (*SignInResponse, error) SignOut(context.Context, *SignOutRequest) (*SignOutResponse, error) // contains filtered or unexported methods }
AuthServiceServer is the server API for AuthService service. All implementations must embed UnimplementedAuthServiceServer for forward compatibility
type SignInRequest ¶
type SignInRequest struct { Email string `protobuf:"bytes,1,opt,name=email,proto3" json:"email,omitempty"` Password string `protobuf:"bytes,2,opt,name=password,proto3" json:"password,omitempty"` // contains filtered or unexported fields }
func (*SignInRequest) Descriptor
deprecated
func (*SignInRequest) Descriptor() ([]byte, []int)
Deprecated: Use SignInRequest.ProtoReflect.Descriptor instead.
func (*SignInRequest) GetEmail ¶
func (x *SignInRequest) GetEmail() string
func (*SignInRequest) GetPassword ¶
func (x *SignInRequest) GetPassword() string
func (*SignInRequest) ProtoMessage ¶
func (*SignInRequest) ProtoMessage()
func (*SignInRequest) ProtoReflect ¶
func (x *SignInRequest) ProtoReflect() protoreflect.Message
func (*SignInRequest) Reset ¶
func (x *SignInRequest) Reset()
func (*SignInRequest) String ¶
func (x *SignInRequest) String() string
type SignInResponse ¶
type SignInResponse struct { Id string `protobuf:"bytes,1,opt,name=id,proto3" json:"id,omitempty"` Token string `protobuf:"bytes,2,opt,name=token,proto3" json:"token,omitempty"` Name string `protobuf:"bytes,3,opt,name=name,proto3" json:"name,omitempty"` // contains filtered or unexported fields }
func (*SignInResponse) Descriptor
deprecated
func (*SignInResponse) Descriptor() ([]byte, []int)
Deprecated: Use SignInResponse.ProtoReflect.Descriptor instead.
func (*SignInResponse) GetId ¶
func (x *SignInResponse) GetId() string
func (*SignInResponse) GetName ¶
func (x *SignInResponse) GetName() string
func (*SignInResponse) GetToken ¶
func (x *SignInResponse) GetToken() string
func (*SignInResponse) ProtoMessage ¶
func (*SignInResponse) ProtoMessage()
func (*SignInResponse) ProtoReflect ¶
func (x *SignInResponse) ProtoReflect() protoreflect.Message
func (*SignInResponse) Reset ¶
func (x *SignInResponse) Reset()
func (*SignInResponse) String ¶
func (x *SignInResponse) String() string
type SignOutRequest ¶
type SignOutRequest struct { Token string `protobuf:"bytes,1,opt,name=token,proto3" json:"token,omitempty"` Id string `protobuf:"bytes,2,opt,name=id,proto3" json:"id,omitempty"` // contains filtered or unexported fields }
func (*SignOutRequest) Descriptor
deprecated
func (*SignOutRequest) Descriptor() ([]byte, []int)
Deprecated: Use SignOutRequest.ProtoReflect.Descriptor instead.
func (*SignOutRequest) GetId ¶
func (x *SignOutRequest) GetId() string
func (*SignOutRequest) GetToken ¶
func (x *SignOutRequest) GetToken() string
func (*SignOutRequest) ProtoMessage ¶
func (*SignOutRequest) ProtoMessage()
func (*SignOutRequest) ProtoReflect ¶
func (x *SignOutRequest) ProtoReflect() protoreflect.Message
func (*SignOutRequest) Reset ¶
func (x *SignOutRequest) Reset()
func (*SignOutRequest) String ¶
func (x *SignOutRequest) String() string
type SignOutResponse ¶
type SignOutResponse struct { Message string `protobuf:"bytes,1,opt,name=message,proto3" json:"message,omitempty"` // contains filtered or unexported fields }
func (*SignOutResponse) Descriptor
deprecated
func (*SignOutResponse) Descriptor() ([]byte, []int)
Deprecated: Use SignOutResponse.ProtoReflect.Descriptor instead.
func (*SignOutResponse) GetMessage ¶
func (x *SignOutResponse) GetMessage() string
func (*SignOutResponse) ProtoMessage ¶
func (*SignOutResponse) ProtoMessage()
func (*SignOutResponse) ProtoReflect ¶
func (x *SignOutResponse) ProtoReflect() protoreflect.Message
func (*SignOutResponse) Reset ¶
func (x *SignOutResponse) Reset()
func (*SignOutResponse) String ¶
func (x *SignOutResponse) String() string
type SignUpRequest ¶
type SignUpRequest struct { Email string `protobuf:"bytes,1,opt,name=email,proto3" json:"email,omitempty"` Password string `protobuf:"bytes,2,opt,name=password,proto3" json:"password,omitempty"` Name string `protobuf:"bytes,3,opt,name=name,proto3" json:"name,omitempty"` // contains filtered or unexported fields }
func (*SignUpRequest) Descriptor
deprecated
func (*SignUpRequest) Descriptor() ([]byte, []int)
Deprecated: Use SignUpRequest.ProtoReflect.Descriptor instead.
func (*SignUpRequest) GetEmail ¶
func (x *SignUpRequest) GetEmail() string
func (*SignUpRequest) GetName ¶
func (x *SignUpRequest) GetName() string
func (*SignUpRequest) GetPassword ¶
func (x *SignUpRequest) GetPassword() string
func (*SignUpRequest) ProtoMessage ¶
func (*SignUpRequest) ProtoMessage()
func (*SignUpRequest) ProtoReflect ¶
func (x *SignUpRequest) ProtoReflect() protoreflect.Message
func (*SignUpRequest) Reset ¶
func (x *SignUpRequest) Reset()
func (*SignUpRequest) String ¶
func (x *SignUpRequest) String() string
type SignUpResponse ¶
type SignUpResponse struct { Id string `protobuf:"bytes,1,opt,name=id,proto3" json:"id,omitempty"` Token string `protobuf:"bytes,2,opt,name=token,proto3" json:"token,omitempty"` Email string `protobuf:"bytes,3,opt,name=email,proto3" json:"email,omitempty"` Password string `protobuf:"bytes,4,opt,name=password,proto3" json:"password,omitempty"` Name string `protobuf:"bytes,5,opt,name=name,proto3" json:"name,omitempty"` // contains filtered or unexported fields }
func (*SignUpResponse) Descriptor
deprecated
func (*SignUpResponse) Descriptor() ([]byte, []int)
Deprecated: Use SignUpResponse.ProtoReflect.Descriptor instead.
func (*SignUpResponse) GetEmail ¶
func (x *SignUpResponse) GetEmail() string
func (*SignUpResponse) GetId ¶
func (x *SignUpResponse) GetId() string
func (*SignUpResponse) GetName ¶
func (x *SignUpResponse) GetName() string
func (*SignUpResponse) GetPassword ¶
func (x *SignUpResponse) GetPassword() string
func (*SignUpResponse) GetToken ¶
func (x *SignUpResponse) GetToken() string
func (*SignUpResponse) ProtoMessage ¶
func (*SignUpResponse) ProtoMessage()
func (*SignUpResponse) ProtoReflect ¶
func (x *SignUpResponse) ProtoReflect() protoreflect.Message
func (*SignUpResponse) Reset ¶
func (x *SignUpResponse) Reset()
func (*SignUpResponse) String ¶
func (x *SignUpResponse) String() string
type UnimplementedAuthServiceServer ¶
type UnimplementedAuthServiceServer struct { }
UnimplementedAuthServiceServer must be embedded to have forward compatible implementations.
func (UnimplementedAuthServiceServer) SignIn ¶
func (UnimplementedAuthServiceServer) SignIn(context.Context, *SignInRequest) (*SignInResponse, error)
func (UnimplementedAuthServiceServer) SignOut ¶
func (UnimplementedAuthServiceServer) SignOut(context.Context, *SignOutRequest) (*SignOutResponse, error)
func (UnimplementedAuthServiceServer) SignUp ¶
func (UnimplementedAuthServiceServer) SignUp(context.Context, *SignUpRequest) (*SignUpResponse, error)
type UnsafeAuthServiceServer ¶
type UnsafeAuthServiceServer interface {
// contains filtered or unexported methods
}
UnsafeAuthServiceServer may be embedded to opt out of forward compatibility for this service. Use of this interface is not recommended, as added methods to AuthServiceServer will result in compilation errors.