2023-08-11 21:27:38 +03:00
|
|
|
// Code generated by protoc-gen-go-micro. DO NOT EDIT.
|
2023-08-12 20:55:20 +03:00
|
|
|
// protoc-gen-go-micro version: v4.0.2
|
2023-08-11 21:27:38 +03:00
|
|
|
// source: pkgdash.proto
|
|
|
|
|
|
|
|
package pkgdashpb
|
|
|
|
|
|
|
|
import (
|
|
|
|
context "context"
|
2023-08-12 20:55:20 +03:00
|
|
|
v41 "go.unistack.org/micro-client-http/v4"
|
|
|
|
v4 "go.unistack.org/micro-server-http/v4"
|
|
|
|
client "go.unistack.org/micro/v4/client"
|
2023-08-12 20:59:01 +03:00
|
|
|
options "go.unistack.org/micro/v4/options"
|
2023-08-12 20:55:20 +03:00
|
|
|
server "go.unistack.org/micro/v4/server"
|
2023-08-12 19:26:50 +03:00
|
|
|
emptypb "google.golang.org/protobuf/types/known/emptypb"
|
2023-08-11 21:27:38 +03:00
|
|
|
http "net/http"
|
|
|
|
)
|
|
|
|
|
2023-08-12 20:55:20 +03:00
|
|
|
var (
|
|
|
|
PkgdashServiceServerEndpoints = []v4.EndpointMetadata{
|
|
|
|
{
|
|
|
|
Name: "PkgdashService.ListPackage",
|
|
|
|
Path: "/v1/packages",
|
|
|
|
Method: "GET",
|
|
|
|
Body: "",
|
|
|
|
Stream: false,
|
|
|
|
},
|
|
|
|
{
|
|
|
|
Name: "PkgdashService.UpdatePackage",
|
|
|
|
Path: "/v1/package/{id}",
|
|
|
|
Method: "POST",
|
|
|
|
Body: "*",
|
|
|
|
Stream: false,
|
|
|
|
},
|
|
|
|
{
|
|
|
|
Name: "PkgdashService.AddComment",
|
|
|
|
Path: "/v1/package/{pkg}/comment",
|
|
|
|
Method: "POST",
|
|
|
|
Body: "*",
|
|
|
|
Stream: false,
|
|
|
|
},
|
|
|
|
{
|
|
|
|
Name: "PkgdashService.AddPackage",
|
|
|
|
Path: "/v1/package",
|
|
|
|
Method: "POST",
|
|
|
|
Body: "*",
|
|
|
|
Stream: false,
|
|
|
|
},
|
|
|
|
{
|
|
|
|
Name: "PkgdashService.GetModule",
|
|
|
|
Path: "/v1/module",
|
|
|
|
Method: "GET",
|
|
|
|
Body: "",
|
|
|
|
Stream: false,
|
|
|
|
},
|
|
|
|
}
|
|
|
|
)
|
|
|
|
|
2023-08-11 21:27:38 +03:00
|
|
|
type pkgdashServiceClient struct {
|
|
|
|
c client.Client
|
|
|
|
name string
|
|
|
|
}
|
|
|
|
|
|
|
|
func NewPkgdashServiceClient(name string, c client.Client) PkgdashServiceClient {
|
|
|
|
return &pkgdashServiceClient{c: c, name: name}
|
|
|
|
}
|
|
|
|
|
2023-08-12 20:59:01 +03:00
|
|
|
func (c *pkgdashServiceClient) ListPackage(ctx context.Context, req *emptypb.Empty, opts ...options.Option) (*ListPackageRsp, error) {
|
2023-08-11 21:27:38 +03:00
|
|
|
errmap := make(map[string]interface{}, 1)
|
|
|
|
errmap["default"] = &ErrorRsp{}
|
|
|
|
opts = append(opts,
|
2023-08-12 20:55:20 +03:00
|
|
|
v41.ErrorMap(errmap),
|
2023-08-11 21:27:38 +03:00
|
|
|
)
|
|
|
|
opts = append(opts,
|
2023-08-12 20:55:20 +03:00
|
|
|
v41.Method(http.MethodGet),
|
|
|
|
v41.Path("/v1/packages"),
|
2023-08-11 21:27:38 +03:00
|
|
|
)
|
|
|
|
rsp := &ListPackageRsp{}
|
|
|
|
err := c.c.Call(ctx, c.c.NewRequest(c.name, "PkgdashService.ListPackage", req), rsp, opts...)
|
|
|
|
if err != nil {
|
|
|
|
return nil, err
|
|
|
|
}
|
|
|
|
return rsp, nil
|
|
|
|
}
|
|
|
|
|
2023-08-12 20:59:01 +03:00
|
|
|
func (c *pkgdashServiceClient) UpdatePackage(ctx context.Context, req *UpdatePackageReq, opts ...options.Option) (*UpdatePackageRsp, error) {
|
2023-08-11 21:27:38 +03:00
|
|
|
errmap := make(map[string]interface{}, 1)
|
|
|
|
errmap["default"] = &ErrorRsp{}
|
|
|
|
opts = append(opts,
|
2023-08-12 20:55:20 +03:00
|
|
|
v41.ErrorMap(errmap),
|
2023-08-11 21:27:38 +03:00
|
|
|
)
|
|
|
|
opts = append(opts,
|
2023-08-12 20:55:20 +03:00
|
|
|
v41.Method(http.MethodPost),
|
|
|
|
v41.Path("/v1/package/{id}"),
|
|
|
|
v41.Body("*"),
|
2023-08-11 21:27:38 +03:00
|
|
|
)
|
2023-08-11 21:45:08 +03:00
|
|
|
rsp := &UpdatePackageRsp{}
|
|
|
|
err := c.c.Call(ctx, c.c.NewRequest(c.name, "PkgdashService.UpdatePackage", req), rsp, opts...)
|
2023-08-11 21:27:38 +03:00
|
|
|
if err != nil {
|
|
|
|
return nil, err
|
|
|
|
}
|
|
|
|
return rsp, nil
|
|
|
|
}
|
|
|
|
|
2023-08-12 20:59:01 +03:00
|
|
|
func (c *pkgdashServiceClient) AddComment(ctx context.Context, req *AddCommentReq, opts ...options.Option) (*AddCommentRsp, error) {
|
2023-08-11 21:27:38 +03:00
|
|
|
errmap := make(map[string]interface{}, 1)
|
|
|
|
errmap["default"] = &ErrorRsp{}
|
|
|
|
opts = append(opts,
|
2023-08-12 20:55:20 +03:00
|
|
|
v41.ErrorMap(errmap),
|
2023-08-11 21:27:38 +03:00
|
|
|
)
|
|
|
|
opts = append(opts,
|
2023-08-12 20:55:20 +03:00
|
|
|
v41.Method(http.MethodPost),
|
|
|
|
v41.Path("/v1/package/{pkg}/comment"),
|
|
|
|
v41.Body("*"),
|
2023-08-11 21:27:38 +03:00
|
|
|
)
|
2023-08-11 21:45:08 +03:00
|
|
|
rsp := &AddCommentRsp{}
|
2023-08-11 21:27:38 +03:00
|
|
|
err := c.c.Call(ctx, c.c.NewRequest(c.name, "PkgdashService.AddComment", req), rsp, opts...)
|
|
|
|
if err != nil {
|
|
|
|
return nil, err
|
|
|
|
}
|
|
|
|
return rsp, nil
|
|
|
|
}
|
|
|
|
|
2023-08-12 20:59:01 +03:00
|
|
|
func (c *pkgdashServiceClient) AddPackage(ctx context.Context, req *AddPackageReq, opts ...options.Option) (*AddPackageRsp, error) {
|
2023-08-11 21:45:08 +03:00
|
|
|
errmap := make(map[string]interface{}, 1)
|
|
|
|
errmap["default"] = &ErrorRsp{}
|
|
|
|
opts = append(opts,
|
2023-08-12 20:55:20 +03:00
|
|
|
v41.ErrorMap(errmap),
|
2023-08-11 21:45:08 +03:00
|
|
|
)
|
|
|
|
opts = append(opts,
|
2023-08-12 20:55:20 +03:00
|
|
|
v41.Method(http.MethodPost),
|
|
|
|
v41.Path("/v1/package"),
|
|
|
|
v41.Body("*"),
|
2023-08-11 21:45:08 +03:00
|
|
|
)
|
|
|
|
rsp := &AddPackageRsp{}
|
|
|
|
err := c.c.Call(ctx, c.c.NewRequest(c.name, "PkgdashService.AddPackage", req), rsp, opts...)
|
|
|
|
if err != nil {
|
|
|
|
return nil, err
|
|
|
|
}
|
|
|
|
return rsp, nil
|
|
|
|
}
|
|
|
|
|
2023-08-12 20:59:01 +03:00
|
|
|
func (c *pkgdashServiceClient) GetModule(ctx context.Context, req *GetModuleReq, opts ...options.Option) (*GetModuleRsp, error) {
|
2023-08-11 21:45:08 +03:00
|
|
|
errmap := make(map[string]interface{}, 1)
|
|
|
|
errmap["default"] = &ErrorRsp{}
|
|
|
|
opts = append(opts,
|
2023-08-12 20:55:20 +03:00
|
|
|
v41.ErrorMap(errmap),
|
2023-08-11 21:45:08 +03:00
|
|
|
)
|
|
|
|
opts = append(opts,
|
2023-08-12 20:55:20 +03:00
|
|
|
v41.Method(http.MethodGet),
|
|
|
|
v41.Path("/v1/module"),
|
2023-08-11 21:45:08 +03:00
|
|
|
)
|
|
|
|
rsp := &GetModuleRsp{}
|
|
|
|
err := c.c.Call(ctx, c.c.NewRequest(c.name, "PkgdashService.GetModule", req), rsp, opts...)
|
|
|
|
if err != nil {
|
|
|
|
return nil, err
|
|
|
|
}
|
|
|
|
return rsp, nil
|
|
|
|
}
|
|
|
|
|
2023-08-11 21:27:38 +03:00
|
|
|
type pkgdashServiceServer struct {
|
|
|
|
PkgdashServiceServer
|
|
|
|
}
|
|
|
|
|
2023-08-12 19:26:50 +03:00
|
|
|
func (h *pkgdashServiceServer) ListPackage(ctx context.Context, req *emptypb.Empty, rsp *ListPackageRsp) error {
|
2023-08-11 21:27:38 +03:00
|
|
|
return h.PkgdashServiceServer.ListPackage(ctx, req, rsp)
|
|
|
|
}
|
|
|
|
|
2023-08-11 21:45:08 +03:00
|
|
|
func (h *pkgdashServiceServer) UpdatePackage(ctx context.Context, req *UpdatePackageReq, rsp *UpdatePackageRsp) error {
|
|
|
|
return h.PkgdashServiceServer.UpdatePackage(ctx, req, rsp)
|
2023-08-11 21:27:38 +03:00
|
|
|
}
|
|
|
|
|
2023-08-11 21:45:08 +03:00
|
|
|
func (h *pkgdashServiceServer) AddComment(ctx context.Context, req *AddCommentReq, rsp *AddCommentRsp) error {
|
2023-08-11 21:27:38 +03:00
|
|
|
return h.PkgdashServiceServer.AddComment(ctx, req, rsp)
|
|
|
|
}
|
|
|
|
|
2023-08-11 21:45:08 +03:00
|
|
|
func (h *pkgdashServiceServer) AddPackage(ctx context.Context, req *AddPackageReq, rsp *AddPackageRsp) error {
|
|
|
|
return h.PkgdashServiceServer.AddPackage(ctx, req, rsp)
|
|
|
|
}
|
|
|
|
|
|
|
|
func (h *pkgdashServiceServer) GetModule(ctx context.Context, req *GetModuleReq, rsp *GetModuleRsp) error {
|
|
|
|
return h.PkgdashServiceServer.GetModule(ctx, req, rsp)
|
|
|
|
}
|
|
|
|
|
2023-08-12 20:59:01 +03:00
|
|
|
func RegisterPkgdashServiceServer(s server.Server, sh PkgdashServiceServer, opts ...options.Option) error {
|
2023-08-11 21:27:38 +03:00
|
|
|
type pkgdashService interface {
|
2023-08-12 19:26:50 +03:00
|
|
|
ListPackage(ctx context.Context, req *emptypb.Empty, rsp *ListPackageRsp) error
|
2023-08-11 21:45:08 +03:00
|
|
|
UpdatePackage(ctx context.Context, req *UpdatePackageReq, rsp *UpdatePackageRsp) error
|
|
|
|
AddComment(ctx context.Context, req *AddCommentReq, rsp *AddCommentRsp) error
|
|
|
|
AddPackage(ctx context.Context, req *AddPackageReq, rsp *AddPackageRsp) error
|
|
|
|
GetModule(ctx context.Context, req *GetModuleReq, rsp *GetModuleRsp) error
|
2023-08-11 21:27:38 +03:00
|
|
|
}
|
|
|
|
type PkgdashService struct {
|
|
|
|
pkgdashService
|
|
|
|
}
|
|
|
|
h := &pkgdashServiceServer{sh}
|
2023-08-12 20:59:01 +03:00
|
|
|
var nopts []options.Option
|
2023-08-12 20:55:20 +03:00
|
|
|
nopts = append(nopts, v4.HandlerEndpoints(PkgdashServiceServerEndpoints))
|
2023-08-12 20:59:01 +03:00
|
|
|
return s.Handle(&PkgdashService{h}, append(nopts, opts...)...)
|
2023-08-11 21:27:38 +03:00
|
|
|
}
|