|
|
|
@ -104,33 +104,6 @@ func local_request_AuthService_DeleteSession_0(ctx context.Context, marshaler ru
|
|
|
|
|
return msg, metadata, err
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
func request_AuthService_SignUp_0(ctx context.Context, marshaler runtime.Marshaler, client AuthServiceClient, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) {
|
|
|
|
|
var (
|
|
|
|
|
protoReq SignUpRequest
|
|
|
|
|
metadata runtime.ServerMetadata
|
|
|
|
|
)
|
|
|
|
|
if err := marshaler.NewDecoder(req.Body).Decode(&protoReq); err != nil && !errors.Is(err, io.EOF) {
|
|
|
|
|
return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err)
|
|
|
|
|
}
|
|
|
|
|
if req.Body != nil {
|
|
|
|
|
_, _ = io.Copy(io.Discard, req.Body)
|
|
|
|
|
}
|
|
|
|
|
msg, err := client.SignUp(ctx, &protoReq, grpc.Header(&metadata.HeaderMD), grpc.Trailer(&metadata.TrailerMD))
|
|
|
|
|
return msg, metadata, err
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
func local_request_AuthService_SignUp_0(ctx context.Context, marshaler runtime.Marshaler, server AuthServiceServer, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) {
|
|
|
|
|
var (
|
|
|
|
|
protoReq SignUpRequest
|
|
|
|
|
metadata runtime.ServerMetadata
|
|
|
|
|
)
|
|
|
|
|
if err := marshaler.NewDecoder(req.Body).Decode(&protoReq); err != nil && !errors.Is(err, io.EOF) {
|
|
|
|
|
return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err)
|
|
|
|
|
}
|
|
|
|
|
msg, err := server.SignUp(ctx, &protoReq)
|
|
|
|
|
return msg, metadata, err
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
// 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.
|
|
|
|
@ -197,26 +170,6 @@ func RegisterAuthServiceHandlerServer(ctx context.Context, mux *runtime.ServeMux
|
|
|
|
|
}
|
|
|
|
|
forward_AuthService_DeleteSession_0(annotatedContext, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...)
|
|
|
|
|
})
|
|
|
|
|
mux.Handle(http.MethodPost, pattern_AuthService_SignUp_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) {
|
|
|
|
|
ctx, cancel := context.WithCancel(req.Context())
|
|
|
|
|
defer cancel()
|
|
|
|
|
var stream runtime.ServerTransportStream
|
|
|
|
|
ctx = grpc.NewContextWithServerTransportStream(ctx, &stream)
|
|
|
|
|
inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req)
|
|
|
|
|
annotatedContext, err := runtime.AnnotateIncomingContext(ctx, mux, req, "/memos.api.v1.AuthService/SignUp", runtime.WithHTTPPathPattern("/api/v1/auth/signup"))
|
|
|
|
|
if err != nil {
|
|
|
|
|
runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err)
|
|
|
|
|
return
|
|
|
|
|
}
|
|
|
|
|
resp, md, err := local_request_AuthService_SignUp_0(annotatedContext, inboundMarshaler, server, req, pathParams)
|
|
|
|
|
md.HeaderMD, md.TrailerMD = metadata.Join(md.HeaderMD, stream.Header()), metadata.Join(md.TrailerMD, stream.Trailer())
|
|
|
|
|
annotatedContext = runtime.NewServerMetadataContext(annotatedContext, md)
|
|
|
|
|
if err != nil {
|
|
|
|
|
runtime.HTTPError(annotatedContext, mux, outboundMarshaler, w, req, err)
|
|
|
|
|
return
|
|
|
|
|
}
|
|
|
|
|
forward_AuthService_SignUp_0(annotatedContext, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...)
|
|
|
|
|
})
|
|
|
|
|
|
|
|
|
|
return nil
|
|
|
|
|
}
|
|
|
|
@ -308,23 +261,6 @@ func RegisterAuthServiceHandlerClient(ctx context.Context, mux *runtime.ServeMux
|
|
|
|
|
}
|
|
|
|
|
forward_AuthService_DeleteSession_0(annotatedContext, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...)
|
|
|
|
|
})
|
|
|
|
|
mux.Handle(http.MethodPost, pattern_AuthService_SignUp_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) {
|
|
|
|
|
ctx, cancel := context.WithCancel(req.Context())
|
|
|
|
|
defer cancel()
|
|
|
|
|
inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req)
|
|
|
|
|
annotatedContext, err := runtime.AnnotateContext(ctx, mux, req, "/memos.api.v1.AuthService/SignUp", runtime.WithHTTPPathPattern("/api/v1/auth/signup"))
|
|
|
|
|
if err != nil {
|
|
|
|
|
runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err)
|
|
|
|
|
return
|
|
|
|
|
}
|
|
|
|
|
resp, md, err := request_AuthService_SignUp_0(annotatedContext, inboundMarshaler, client, req, pathParams)
|
|
|
|
|
annotatedContext = runtime.NewServerMetadataContext(annotatedContext, md)
|
|
|
|
|
if err != nil {
|
|
|
|
|
runtime.HTTPError(annotatedContext, mux, outboundMarshaler, w, req, err)
|
|
|
|
|
return
|
|
|
|
|
}
|
|
|
|
|
forward_AuthService_SignUp_0(annotatedContext, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...)
|
|
|
|
|
})
|
|
|
|
|
return nil
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
@ -332,12 +268,10 @@ var (
|
|
|
|
|
pattern_AuthService_GetCurrentSession_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2, 2, 3, 2, 4}, []string{"api", "v1", "auth", "sessions", "current"}, ""))
|
|
|
|
|
pattern_AuthService_CreateSession_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2, 2, 3}, []string{"api", "v1", "auth", "sessions"}, ""))
|
|
|
|
|
pattern_AuthService_DeleteSession_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2, 2, 3, 2, 4}, []string{"api", "v1", "auth", "sessions", "current"}, ""))
|
|
|
|
|
pattern_AuthService_SignUp_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2, 2, 3}, []string{"api", "v1", "auth", "signup"}, ""))
|
|
|
|
|
)
|
|
|
|
|
|
|
|
|
|
var (
|
|
|
|
|
forward_AuthService_GetCurrentSession_0 = runtime.ForwardResponseMessage
|
|
|
|
|
forward_AuthService_CreateSession_0 = runtime.ForwardResponseMessage
|
|
|
|
|
forward_AuthService_DeleteSession_0 = runtime.ForwardResponseMessage
|
|
|
|
|
forward_AuthService_SignUp_0 = runtime.ForwardResponseMessage
|
|
|
|
|
)
|
|
|
|
|