2021-10-27 01:24:35 +03:00
|
|
|
// Code generated by protoc-gen-go-micro. DO NOT EDIT.
|
2024-12-11 02:00:29 +03:00
|
|
|
// protoc-gen-go-micro version: v3.10.4
|
2021-06-30 17:53:06 +03:00
|
|
|
// source: test.proto
|
2021-10-27 01:24:35 +03:00
|
|
|
|
2021-06-30 17:53:06 +03:00
|
|
|
package pb
|
|
|
|
|
|
|
|
import (
|
|
|
|
context "context"
|
2024-12-11 02:00:29 +03:00
|
|
|
v31 "go.unistack.org/micro-client-http/v3"
|
2023-01-07 19:16:48 +03:00
|
|
|
codec "go.unistack.org/micro-proto/v3/codec"
|
2024-12-11 02:00:29 +03:00
|
|
|
v3 "go.unistack.org/micro-server-http/v3"
|
2021-10-27 01:24:35 +03:00
|
|
|
client "go.unistack.org/micro/v3/client"
|
|
|
|
server "go.unistack.org/micro/v3/server"
|
2022-03-03 18:01:37 +03:00
|
|
|
http "net/http"
|
2021-06-30 17:53:06 +03:00
|
|
|
)
|
|
|
|
|
2024-12-11 02:00:29 +03:00
|
|
|
var (
|
|
|
|
TestServiceServerEndpoints = []v3.EndpointMetadata{
|
|
|
|
{
|
|
|
|
Name: "TestService.TestMultipart",
|
|
|
|
Path: "/users/multipart",
|
|
|
|
Method: "POST",
|
|
|
|
Body: "*",
|
|
|
|
Stream: false,
|
|
|
|
},
|
|
|
|
{
|
|
|
|
Name: "TestService.TestEndpoint",
|
|
|
|
Path: "/users/test",
|
|
|
|
Method: "GET",
|
|
|
|
Body: "",
|
|
|
|
Stream: false,
|
|
|
|
},
|
|
|
|
{
|
|
|
|
Name: "TestService.UserByID",
|
|
|
|
Path: "/users/{id}",
|
|
|
|
Method: "GET",
|
|
|
|
Body: "",
|
|
|
|
Stream: false,
|
|
|
|
},
|
|
|
|
{
|
|
|
|
Name: "TestService.UserImageByID",
|
|
|
|
Path: "/users/{id}/image",
|
|
|
|
Method: "GET",
|
|
|
|
Body: "",
|
|
|
|
Stream: false,
|
|
|
|
},
|
|
|
|
{
|
|
|
|
Name: "TestService.UploadFile",
|
|
|
|
Path: "/users/image/upload",
|
|
|
|
Method: "POST",
|
|
|
|
Body: "",
|
|
|
|
Stream: false,
|
|
|
|
},
|
|
|
|
{
|
|
|
|
Name: "TestService.KzAmlRs",
|
|
|
|
Path: "/aml",
|
|
|
|
Method: "POST",
|
|
|
|
Body: "",
|
|
|
|
Stream: false,
|
|
|
|
},
|
|
|
|
}
|
|
|
|
)
|
|
|
|
|
2021-06-30 17:53:06 +03:00
|
|
|
type testServiceClient struct {
|
|
|
|
c client.Client
|
|
|
|
name string
|
|
|
|
}
|
|
|
|
|
|
|
|
func NewTestServiceClient(name string, c client.Client) TestServiceClient {
|
|
|
|
return &testServiceClient{c: c, name: name}
|
|
|
|
}
|
|
|
|
|
2022-03-03 18:01:37 +03:00
|
|
|
func (c *testServiceClient) TestMultipart(ctx context.Context, req *MultipartReq, opts ...client.CallOption) (*MultipartRsp, error) {
|
|
|
|
opts = append(opts,
|
2024-12-11 02:00:29 +03:00
|
|
|
v31.Method(http.MethodPost),
|
|
|
|
v31.Path("/users/multipart"),
|
|
|
|
v31.Body("*"),
|
2022-03-03 18:01:37 +03:00
|
|
|
)
|
|
|
|
rsp := &MultipartRsp{}
|
|
|
|
err := c.c.Call(ctx, c.c.NewRequest(c.name, "TestService.TestMultipart", req), rsp, opts...)
|
|
|
|
if err != nil {
|
|
|
|
return nil, err
|
|
|
|
}
|
|
|
|
return rsp, nil
|
|
|
|
}
|
|
|
|
|
2021-06-30 17:53:06 +03:00
|
|
|
func (c *testServiceClient) TestEndpoint(ctx context.Context, req *Request, opts ...client.CallOption) (*Response, error) {
|
|
|
|
opts = append(opts,
|
2024-12-11 02:00:29 +03:00
|
|
|
v31.Method(http.MethodGet),
|
|
|
|
v31.Path("/users/test"),
|
2021-06-30 17:53:06 +03:00
|
|
|
)
|
2021-10-27 01:24:35 +03:00
|
|
|
opts = append(opts,
|
2024-12-11 02:00:29 +03:00
|
|
|
v31.Header("client_uid", "true"),
|
|
|
|
v31.Cookie("csrftoken", "true"),
|
2021-10-27 01:24:35 +03:00
|
|
|
)
|
2021-06-30 17:53:06 +03:00
|
|
|
rsp := &Response{}
|
|
|
|
err := c.c.Call(ctx, c.c.NewRequest(c.name, "TestService.TestEndpoint", req), rsp, opts...)
|
|
|
|
if err != nil {
|
|
|
|
return nil, err
|
|
|
|
}
|
|
|
|
return rsp, nil
|
|
|
|
}
|
|
|
|
|
|
|
|
func (c *testServiceClient) UserByID(ctx context.Context, req *Request, opts ...client.CallOption) (*Response, error) {
|
|
|
|
opts = append(opts,
|
2024-12-11 02:00:29 +03:00
|
|
|
v31.Method(http.MethodGet),
|
|
|
|
v31.Path("/users/{id}"),
|
2021-06-30 17:53:06 +03:00
|
|
|
)
|
|
|
|
rsp := &Response{}
|
|
|
|
err := c.c.Call(ctx, c.c.NewRequest(c.name, "TestService.UserByID", req), rsp, opts...)
|
|
|
|
if err != nil {
|
|
|
|
return nil, err
|
|
|
|
}
|
|
|
|
return rsp, nil
|
|
|
|
}
|
|
|
|
|
|
|
|
func (c *testServiceClient) UserImageByID(ctx context.Context, req *Request, opts ...client.CallOption) (*codec.Frame, error) {
|
|
|
|
opts = append(opts,
|
2024-12-11 02:00:29 +03:00
|
|
|
v31.Method(http.MethodGet),
|
|
|
|
v31.Path("/users/{id}/image"),
|
2021-06-30 17:53:06 +03:00
|
|
|
)
|
|
|
|
rsp := &codec.Frame{}
|
|
|
|
err := c.c.Call(ctx, c.c.NewRequest(c.name, "TestService.UserImageByID", req), rsp, opts...)
|
|
|
|
if err != nil {
|
|
|
|
return nil, err
|
|
|
|
}
|
|
|
|
return rsp, nil
|
|
|
|
}
|
|
|
|
|
|
|
|
func (c *testServiceClient) UploadFile(ctx context.Context, req *RequestImage, opts ...client.CallOption) (*ResponseImage, error) {
|
|
|
|
opts = append(opts,
|
2024-12-11 02:00:29 +03:00
|
|
|
v31.Method(http.MethodPost),
|
|
|
|
v31.Path("/users/image/upload"),
|
2021-06-30 17:53:06 +03:00
|
|
|
)
|
|
|
|
rsp := &ResponseImage{}
|
|
|
|
err := c.c.Call(ctx, c.c.NewRequest(c.name, "TestService.UploadFile", req), rsp, opts...)
|
|
|
|
if err != nil {
|
|
|
|
return nil, err
|
|
|
|
}
|
|
|
|
return rsp, nil
|
|
|
|
}
|
|
|
|
|
|
|
|
func (c *testServiceClient) KzAmlRs(ctx context.Context, req *RequestAml, opts ...client.CallOption) (*ResponseAml, error) {
|
|
|
|
opts = append(opts,
|
2024-12-11 02:00:29 +03:00
|
|
|
v31.Method(http.MethodPost),
|
|
|
|
v31.Path("/aml"),
|
2021-06-30 17:53:06 +03:00
|
|
|
)
|
|
|
|
rsp := &ResponseAml{}
|
|
|
|
err := c.c.Call(ctx, c.c.NewRequest(c.name, "TestService.KzAmlRs", req), rsp, opts...)
|
|
|
|
if err != nil {
|
|
|
|
return nil, err
|
|
|
|
}
|
|
|
|
return rsp, nil
|
|
|
|
}
|
|
|
|
|
|
|
|
type testServiceServer struct {
|
|
|
|
TestServiceServer
|
|
|
|
}
|
|
|
|
|
2022-03-03 18:01:37 +03:00
|
|
|
func (h *testServiceServer) TestMultipart(ctx context.Context, req *MultipartReq, rsp *MultipartRsp) error {
|
|
|
|
return h.TestServiceServer.TestMultipart(ctx, req, rsp)
|
|
|
|
}
|
|
|
|
|
2021-06-30 17:53:06 +03:00
|
|
|
func (h *testServiceServer) TestEndpoint(ctx context.Context, req *Request, rsp *Response) error {
|
2024-12-11 02:00:29 +03:00
|
|
|
v3.FillRequest(ctx, req,
|
|
|
|
v3.Header("client_uid", "true"),
|
|
|
|
v3.Cookie("csrftoken", "true"),
|
2021-10-27 01:24:35 +03:00
|
|
|
)
|
2021-06-30 17:53:06 +03:00
|
|
|
return h.TestServiceServer.TestEndpoint(ctx, req, rsp)
|
|
|
|
}
|
|
|
|
|
|
|
|
func (h *testServiceServer) UserByID(ctx context.Context, req *Request, rsp *Response) error {
|
|
|
|
return h.TestServiceServer.UserByID(ctx, req, rsp)
|
|
|
|
}
|
|
|
|
|
|
|
|
func (h *testServiceServer) UserImageByID(ctx context.Context, req *Request, rsp *codec.Frame) error {
|
|
|
|
return h.TestServiceServer.UserImageByID(ctx, req, rsp)
|
|
|
|
}
|
|
|
|
|
|
|
|
func (h *testServiceServer) UploadFile(ctx context.Context, req *RequestImage, rsp *ResponseImage) error {
|
|
|
|
return h.TestServiceServer.UploadFile(ctx, req, rsp)
|
|
|
|
}
|
|
|
|
|
|
|
|
func (h *testServiceServer) KzAmlRs(ctx context.Context, req *RequestAml, rsp *ResponseAml) error {
|
|
|
|
return h.TestServiceServer.KzAmlRs(ctx, req, rsp)
|
|
|
|
}
|
|
|
|
|
|
|
|
func RegisterTestServiceServer(s server.Server, sh TestServiceServer, opts ...server.HandlerOption) error {
|
|
|
|
type testService interface {
|
2022-03-03 18:01:37 +03:00
|
|
|
TestMultipart(ctx context.Context, req *MultipartReq, rsp *MultipartRsp) error
|
2021-06-30 17:53:06 +03:00
|
|
|
TestEndpoint(ctx context.Context, req *Request, rsp *Response) error
|
|
|
|
UserByID(ctx context.Context, req *Request, rsp *Response) error
|
|
|
|
UserImageByID(ctx context.Context, req *Request, rsp *codec.Frame) error
|
|
|
|
UploadFile(ctx context.Context, req *RequestImage, rsp *ResponseImage) error
|
|
|
|
KzAmlRs(ctx context.Context, req *RequestAml, rsp *ResponseAml) error
|
|
|
|
}
|
|
|
|
type TestService struct {
|
|
|
|
testService
|
|
|
|
}
|
|
|
|
h := &testServiceServer{sh}
|
|
|
|
var nopts []server.HandlerOption
|
2024-12-11 02:00:29 +03:00
|
|
|
nopts = append(nopts, v3.HandlerEndpoints(TestServiceServerEndpoints))
|
2021-06-30 17:53:06 +03:00
|
|
|
return s.Handle(s.NewHandler(&TestService{h}, append(nopts, opts...)...))
|
|
|
|
}
|