17
flow/proto/micro_errors.pb.go
Normal file
17
flow/proto/micro_errors.pb.go
Normal file
@@ -0,0 +1,17 @@
|
||||
// Code generated by protoc-gen-go-micro. DO NOT EDIT.
|
||||
// protoc-gen-go-micro version: v3.10.4
|
||||
|
||||
package pb
|
||||
|
||||
import (
|
||||
protojson "google.golang.org/protobuf/encoding/protojson"
|
||||
)
|
||||
|
||||
var (
|
||||
marshaler = protojson.MarshalOptions{}
|
||||
)
|
||||
|
||||
func (m *Error) Error() string {
|
||||
buf, _ := marshaler.Marshal(m)
|
||||
return string(buf)
|
||||
}
|
@@ -1,7 +1,7 @@
|
||||
// Code generated by protoc-gen-go. DO NOT EDIT.
|
||||
// versions:
|
||||
// protoc-gen-go v1.26.0
|
||||
// protoc v3.21.12
|
||||
// protoc v5.28.3
|
||||
// source: test.proto
|
||||
|
||||
package pb
|
||||
|
@@ -1,52 +1,19 @@
|
||||
// Code generated by protoc-gen-go-micro. DO NOT EDIT.
|
||||
// versions:
|
||||
// - protoc-gen-go-micro v3.10.2
|
||||
// - protoc v3.21.12
|
||||
// - protoc-gen-go-micro v3.10.4
|
||||
// - protoc v5.28.3
|
||||
// source: test.proto
|
||||
|
||||
package pb
|
||||
|
||||
import (
|
||||
context "context"
|
||||
v3 "go.unistack.org/micro-server-http/v3"
|
||||
client "go.unistack.org/micro/v3/client"
|
||||
)
|
||||
|
||||
var (
|
||||
TestServiceName = "TestService"
|
||||
)
|
||||
var (
|
||||
TestServiceServerEndpoints = []v3.EndpointMetadata{
|
||||
{
|
||||
Name: "TestService.LookupUser",
|
||||
Path: "/v1/user/{name}",
|
||||
Method: "GET",
|
||||
Body: "",
|
||||
Stream: false,
|
||||
},
|
||||
{
|
||||
Name: "TestService.UpdateUser",
|
||||
Path: "/v1/user/{name}",
|
||||
Method: "PUT",
|
||||
Body: "*",
|
||||
Stream: false,
|
||||
},
|
||||
{
|
||||
Name: "TestService.DeleteUser",
|
||||
Path: "/v1/user/{name}",
|
||||
Method: "DELETE",
|
||||
Body: "",
|
||||
Stream: false,
|
||||
},
|
||||
{
|
||||
Name: "TestService.MailUser",
|
||||
Path: "/v1/user/{name}/mail",
|
||||
Method: "POST",
|
||||
Body: "*",
|
||||
Stream: false,
|
||||
},
|
||||
}
|
||||
)
|
||||
|
||||
type TestServiceClient interface {
|
||||
LookupUser(ctx context.Context, req *LookupUserReq, opts ...client.CallOption) (*LookupUserRsp, error)
|
||||
|
@@ -1,19 +1,52 @@
|
||||
// Code generated by protoc-gen-go-micro. DO NOT EDIT.
|
||||
// protoc-gen-go-micro version: v3.10.2
|
||||
// protoc-gen-go-micro version: v3.10.4
|
||||
// source: test.proto
|
||||
|
||||
package pb
|
||||
|
||||
import (
|
||||
context "context"
|
||||
v3 "go.unistack.org/micro-client-http/v3"
|
||||
v31 "go.unistack.org/micro-server-http/v3"
|
||||
v31 "go.unistack.org/micro-client-http/v3"
|
||||
v3 "go.unistack.org/micro-server-http/v3"
|
||||
client "go.unistack.org/micro/v3/client"
|
||||
server "go.unistack.org/micro/v3/server"
|
||||
http "net/http"
|
||||
time "time"
|
||||
)
|
||||
|
||||
var (
|
||||
TestServiceServerEndpoints = []v3.EndpointMetadata{
|
||||
{
|
||||
Name: "TestService.LookupUser",
|
||||
Path: "/v1/user/{name}",
|
||||
Method: "GET",
|
||||
Body: "",
|
||||
Stream: false,
|
||||
},
|
||||
{
|
||||
Name: "TestService.UpdateUser",
|
||||
Path: "/v1/user/{name}",
|
||||
Method: "PUT",
|
||||
Body: "*",
|
||||
Stream: false,
|
||||
},
|
||||
{
|
||||
Name: "TestService.DeleteUser",
|
||||
Path: "/v1/user/{name}",
|
||||
Method: "DELETE",
|
||||
Body: "",
|
||||
Stream: false,
|
||||
},
|
||||
{
|
||||
Name: "TestService.MailUser",
|
||||
Path: "/v1/user/{name}/mail",
|
||||
Method: "POST",
|
||||
Body: "*",
|
||||
Stream: false,
|
||||
},
|
||||
}
|
||||
)
|
||||
|
||||
type testServiceClient struct {
|
||||
c client.Client
|
||||
name string
|
||||
@@ -27,11 +60,11 @@ func (c *testServiceClient) LookupUser(ctx context.Context, req *LookupUserReq,
|
||||
errmap := make(map[string]interface{}, 1)
|
||||
errmap["default"] = &Error{}
|
||||
opts = append(opts,
|
||||
v3.ErrorMap(errmap),
|
||||
v31.ErrorMap(errmap),
|
||||
)
|
||||
opts = append(opts,
|
||||
v3.Method(http.MethodGet),
|
||||
v3.Path("/v1/user/{name}"),
|
||||
v31.Method(http.MethodGet),
|
||||
v31.Path("/v1/user/{name}"),
|
||||
)
|
||||
td := time.Duration(5000000000)
|
||||
opts = append(opts, client.WithRequestTimeout(td))
|
||||
@@ -47,12 +80,12 @@ func (c *testServiceClient) UpdateUser(ctx context.Context, req *UpdateUserReq,
|
||||
errmap := make(map[string]interface{}, 1)
|
||||
errmap["default"] = &Error{}
|
||||
opts = append(opts,
|
||||
v3.ErrorMap(errmap),
|
||||
v31.ErrorMap(errmap),
|
||||
)
|
||||
opts = append(opts,
|
||||
v3.Method(http.MethodPut),
|
||||
v3.Path("/v1/user/{name}"),
|
||||
v3.Body("*"),
|
||||
v31.Method(http.MethodPut),
|
||||
v31.Path("/v1/user/{name}"),
|
||||
v31.Body("*"),
|
||||
)
|
||||
td := time.Duration(5000000000)
|
||||
opts = append(opts, client.WithRequestTimeout(td))
|
||||
@@ -68,11 +101,11 @@ func (c *testServiceClient) DeleteUser(ctx context.Context, req *DeleteUserReq,
|
||||
errmap := make(map[string]interface{}, 1)
|
||||
errmap["default"] = &Error{}
|
||||
opts = append(opts,
|
||||
v3.ErrorMap(errmap),
|
||||
v31.ErrorMap(errmap),
|
||||
)
|
||||
opts = append(opts,
|
||||
v3.Method(http.MethodDelete),
|
||||
v3.Path("/v1/user/{name}"),
|
||||
v31.Method(http.MethodDelete),
|
||||
v31.Path("/v1/user/{name}"),
|
||||
)
|
||||
td := time.Duration(5000000000)
|
||||
opts = append(opts, client.WithRequestTimeout(td))
|
||||
@@ -88,12 +121,12 @@ func (c *testServiceClient) MailUser(ctx context.Context, req *MailUserReq, opts
|
||||
errmap := make(map[string]interface{}, 1)
|
||||
errmap["default"] = &Error{}
|
||||
opts = append(opts,
|
||||
v3.ErrorMap(errmap),
|
||||
v31.ErrorMap(errmap),
|
||||
)
|
||||
opts = append(opts,
|
||||
v3.Method(http.MethodPost),
|
||||
v3.Path("/v1/user/{name}/mail"),
|
||||
v3.Body("*"),
|
||||
v31.Method(http.MethodPost),
|
||||
v31.Path("/v1/user/{name}/mail"),
|
||||
v31.Body("*"),
|
||||
)
|
||||
td := time.Duration(5000000000)
|
||||
opts = append(opts, client.WithRequestTimeout(td))
|
||||
@@ -153,6 +186,6 @@ func RegisterTestServiceServer(s server.Server, sh TestServiceServer, opts ...se
|
||||
}
|
||||
h := &testServiceServer{sh}
|
||||
var nopts []server.HandlerOption
|
||||
nopts = append(nopts, v31.HandlerEndpoints(TestServiceServerEndpoints))
|
||||
nopts = append(nopts, v3.HandlerEndpoints(TestServiceServerEndpoints))
|
||||
return s.Handle(s.NewHandler(&TestService{h}, append(nopts, opts...)...))
|
||||
}
|
||||
|
Reference in New Issue
Block a user