@@ -11,50 +11,84 @@ import (
|
||||
client "go.unistack.org/micro/v4/client"
|
||||
options "go.unistack.org/micro/v4/options"
|
||||
server "go.unistack.org/micro/v4/server"
|
||||
emptypb "google.golang.org/protobuf/types/known/emptypb"
|
||||
http "net/http"
|
||||
)
|
||||
|
||||
var (
|
||||
PkgdashServiceServerEndpoints = []v4.EndpointMetadata{
|
||||
{
|
||||
Name: "PkgdashService.ListPackage",
|
||||
Name: "PkgdashService.PackagesCreate",
|
||||
Path: "/v1/packages",
|
||||
Method: "POST",
|
||||
Body: "*",
|
||||
Stream: false,
|
||||
},
|
||||
{
|
||||
Name: "PkgdashService.PackagesDelete",
|
||||
Path: "/v1/packages/{id}",
|
||||
Method: "DELETE",
|
||||
Body: "",
|
||||
Stream: false,
|
||||
},
|
||||
{
|
||||
Name: "PkgdashService.PackagesList",
|
||||
Path: "/v1/packages",
|
||||
Method: "GET",
|
||||
Body: "",
|
||||
Stream: false,
|
||||
},
|
||||
{
|
||||
Name: "PkgdashService.UpdatePackage",
|
||||
Path: "/v1/package/{id}",
|
||||
Name: "PkgdashService.PackagesUpdate",
|
||||
Path: "/v1/packages/{id}",
|
||||
Method: "PUT",
|
||||
Body: "*",
|
||||
Stream: false,
|
||||
},
|
||||
{
|
||||
Name: "PkgdashService.CommentsCreate",
|
||||
Path: "/v1/packages/{package_id}/comments",
|
||||
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",
|
||||
Name: "PkgdashService.CommentsLookup",
|
||||
Path: "/v1/comments/{id}/comments",
|
||||
Method: "GET",
|
||||
Body: "",
|
||||
Stream: false,
|
||||
},
|
||||
{
|
||||
Name: "PkgdashService.GetComments",
|
||||
Path: "/v1/comment",
|
||||
Name: "PkgdashService.CommentsLookup",
|
||||
Path: "/v1/comments/{package_id}/comments/{id}",
|
||||
Method: "GET",
|
||||
Body: "",
|
||||
Stream: false,
|
||||
},
|
||||
{
|
||||
Name: "PkgdashService.CommentsList",
|
||||
Path: "/v1/packages/{package_id}/comments",
|
||||
Method: "GET",
|
||||
Body: "",
|
||||
Stream: false,
|
||||
},
|
||||
{
|
||||
Name: "PkgdashService.CommentsDelete",
|
||||
Path: "/v1/packages/{package_id}/comments/{id}",
|
||||
Method: "DELETE",
|
||||
Body: "",
|
||||
Stream: false,
|
||||
},
|
||||
{
|
||||
Name: "PkgdashService.CommentsDelete",
|
||||
Path: "/v1/comments/{id}",
|
||||
Method: "DELETE",
|
||||
Body: "",
|
||||
Stream: false,
|
||||
},
|
||||
{
|
||||
Name: "PkgdashService.ModulesList",
|
||||
Path: "/v1/modules",
|
||||
Method: "GET",
|
||||
Body: "",
|
||||
Stream: false,
|
||||
@@ -71,7 +105,44 @@ func NewPkgdashServiceClient(name string, c client.Client) PkgdashServiceClient
|
||||
return &pkgdashServiceClient{c: c, name: name}
|
||||
}
|
||||
|
||||
func (c *pkgdashServiceClient) ListPackage(ctx context.Context, req *emptypb.Empty, opts ...options.Option) (*ListPackageRsp, error) {
|
||||
func (c *pkgdashServiceClient) PackagesCreate(ctx context.Context, req *PackagesCreateReq, opts ...options.Option) (*PackagesCreateRsp, error) {
|
||||
errmap := make(map[string]interface{}, 1)
|
||||
errmap["default"] = &ErrorRsp{}
|
||||
opts = append(opts,
|
||||
v41.ErrorMap(errmap),
|
||||
)
|
||||
opts = append(opts,
|
||||
v41.Method(http.MethodPost),
|
||||
v41.Path("/v1/packages"),
|
||||
v41.Body("*"),
|
||||
)
|
||||
rsp := &PackagesCreateRsp{}
|
||||
err := c.c.Call(ctx, c.c.NewRequest(c.name, "PkgdashService.PackagesCreate", req), rsp, opts...)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
return rsp, nil
|
||||
}
|
||||
|
||||
func (c *pkgdashServiceClient) PackagesDelete(ctx context.Context, req *PackagesDeleteReq, opts ...options.Option) (*PackagesDeleteRsp, error) {
|
||||
errmap := make(map[string]interface{}, 1)
|
||||
errmap["default"] = &ErrorRsp{}
|
||||
opts = append(opts,
|
||||
v41.ErrorMap(errmap),
|
||||
)
|
||||
opts = append(opts,
|
||||
v41.Method(http.MethodDelete),
|
||||
v41.Path("/v1/packages/{id}"),
|
||||
)
|
||||
rsp := &PackagesDeleteRsp{}
|
||||
err := c.c.Call(ctx, c.c.NewRequest(c.name, "PkgdashService.PackagesDelete", req), rsp, opts...)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
return rsp, nil
|
||||
}
|
||||
|
||||
func (c *pkgdashServiceClient) PackagesList(ctx context.Context, req *PackagesListReq, opts ...options.Option) (*PackagesListRsp, error) {
|
||||
errmap := make(map[string]interface{}, 1)
|
||||
errmap["default"] = &ErrorRsp{}
|
||||
opts = append(opts,
|
||||
@@ -81,15 +152,34 @@ func (c *pkgdashServiceClient) ListPackage(ctx context.Context, req *emptypb.Emp
|
||||
v41.Method(http.MethodGet),
|
||||
v41.Path("/v1/packages"),
|
||||
)
|
||||
rsp := &ListPackageRsp{}
|
||||
err := c.c.Call(ctx, c.c.NewRequest(c.name, "PkgdashService.ListPackage", req), rsp, opts...)
|
||||
rsp := &PackagesListRsp{}
|
||||
err := c.c.Call(ctx, c.c.NewRequest(c.name, "PkgdashService.PackagesList", req), rsp, opts...)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
return rsp, nil
|
||||
}
|
||||
|
||||
func (c *pkgdashServiceClient) UpdatePackage(ctx context.Context, req *UpdatePackageReq, opts ...options.Option) (*UpdatePackageRsp, error) {
|
||||
func (c *pkgdashServiceClient) PackagesUpdate(ctx context.Context, req *PackagesUpdateReq, opts ...options.Option) (*PackagesUpdateRsp, error) {
|
||||
errmap := make(map[string]interface{}, 1)
|
||||
errmap["default"] = &ErrorRsp{}
|
||||
opts = append(opts,
|
||||
v41.ErrorMap(errmap),
|
||||
)
|
||||
opts = append(opts,
|
||||
v41.Method(http.MethodPut),
|
||||
v41.Path("/v1/packages/{id}"),
|
||||
v41.Body("*"),
|
||||
)
|
||||
rsp := &PackagesUpdateRsp{}
|
||||
err := c.c.Call(ctx, c.c.NewRequest(c.name, "PkgdashService.PackagesUpdate", req), rsp, opts...)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
return rsp, nil
|
||||
}
|
||||
|
||||
func (c *pkgdashServiceClient) CommentsCreate(ctx context.Context, req *CommentsCreateReq, opts ...options.Option) (*CommentsCreateRsp, error) {
|
||||
errmap := make(map[string]interface{}, 1)
|
||||
errmap["default"] = &ErrorRsp{}
|
||||
opts = append(opts,
|
||||
@@ -97,56 +187,18 @@ func (c *pkgdashServiceClient) UpdatePackage(ctx context.Context, req *UpdatePac
|
||||
)
|
||||
opts = append(opts,
|
||||
v41.Method(http.MethodPost),
|
||||
v41.Path("/v1/package/{id}"),
|
||||
v41.Path("/v1/packages/{package_id}/comments"),
|
||||
v41.Body("*"),
|
||||
)
|
||||
rsp := &UpdatePackageRsp{}
|
||||
err := c.c.Call(ctx, c.c.NewRequest(c.name, "PkgdashService.UpdatePackage", req), rsp, opts...)
|
||||
rsp := &CommentsCreateRsp{}
|
||||
err := c.c.Call(ctx, c.c.NewRequest(c.name, "PkgdashService.CommentsCreate", req), rsp, opts...)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
return rsp, nil
|
||||
}
|
||||
|
||||
func (c *pkgdashServiceClient) AddComment(ctx context.Context, req *AddCommentReq, opts ...options.Option) (*AddCommentRsp, error) {
|
||||
errmap := make(map[string]interface{}, 1)
|
||||
errmap["default"] = &ErrorRsp{}
|
||||
opts = append(opts,
|
||||
v41.ErrorMap(errmap),
|
||||
)
|
||||
opts = append(opts,
|
||||
v41.Method(http.MethodPost),
|
||||
v41.Path("/v1/package/{pkg}/comment"),
|
||||
v41.Body("*"),
|
||||
)
|
||||
rsp := &AddCommentRsp{}
|
||||
err := c.c.Call(ctx, c.c.NewRequest(c.name, "PkgdashService.AddComment", req), rsp, opts...)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
return rsp, nil
|
||||
}
|
||||
|
||||
func (c *pkgdashServiceClient) AddPackage(ctx context.Context, req *AddPackageReq, opts ...options.Option) (*AddPackageRsp, error) {
|
||||
errmap := make(map[string]interface{}, 1)
|
||||
errmap["default"] = &ErrorRsp{}
|
||||
opts = append(opts,
|
||||
v41.ErrorMap(errmap),
|
||||
)
|
||||
opts = append(opts,
|
||||
v41.Method(http.MethodPost),
|
||||
v41.Path("/v1/package"),
|
||||
v41.Body("*"),
|
||||
)
|
||||
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
|
||||
}
|
||||
|
||||
func (c *pkgdashServiceClient) GetModule(ctx context.Context, req *GetModuleReq, opts ...options.Option) (*GetModuleRsp, error) {
|
||||
func (c *pkgdashServiceClient) CommentsLookup(ctx context.Context, req *CommentsLookupReq, opts ...options.Option) (*CommentsLookupRsp, error) {
|
||||
errmap := make(map[string]interface{}, 1)
|
||||
errmap["default"] = &ErrorRsp{}
|
||||
opts = append(opts,
|
||||
@@ -154,17 +206,17 @@ func (c *pkgdashServiceClient) GetModule(ctx context.Context, req *GetModuleReq,
|
||||
)
|
||||
opts = append(opts,
|
||||
v41.Method(http.MethodGet),
|
||||
v41.Path("/v1/module"),
|
||||
v41.Path("/v1/comments/{id}/comments"),
|
||||
)
|
||||
rsp := &GetModuleRsp{}
|
||||
err := c.c.Call(ctx, c.c.NewRequest(c.name, "PkgdashService.GetModule", req), rsp, opts...)
|
||||
rsp := &CommentsLookupRsp{}
|
||||
err := c.c.Call(ctx, c.c.NewRequest(c.name, "PkgdashService.CommentsLookup", req), rsp, opts...)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
return rsp, nil
|
||||
}
|
||||
|
||||
func (c *pkgdashServiceClient) GetComments(ctx context.Context, req *GetCommentsReq, opts ...options.Option) (*GetCommentsRsp, error) {
|
||||
func (c *pkgdashServiceClient) CommentsList(ctx context.Context, req *CommentsListReq, opts ...options.Option) (*CommentsListRsp, error) {
|
||||
errmap := make(map[string]interface{}, 1)
|
||||
errmap["default"] = &ErrorRsp{}
|
||||
opts = append(opts,
|
||||
@@ -172,10 +224,46 @@ func (c *pkgdashServiceClient) GetComments(ctx context.Context, req *GetComments
|
||||
)
|
||||
opts = append(opts,
|
||||
v41.Method(http.MethodGet),
|
||||
v41.Path("/v1/comment"),
|
||||
v41.Path("/v1/packages/{package_id}/comments"),
|
||||
)
|
||||
rsp := &GetCommentsRsp{}
|
||||
err := c.c.Call(ctx, c.c.NewRequest(c.name, "PkgdashService.GetComments", req), rsp, opts...)
|
||||
rsp := &CommentsListRsp{}
|
||||
err := c.c.Call(ctx, c.c.NewRequest(c.name, "PkgdashService.CommentsList", req), rsp, opts...)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
return rsp, nil
|
||||
}
|
||||
|
||||
func (c *pkgdashServiceClient) CommentsDelete(ctx context.Context, req *CommentsDeleteReq, opts ...options.Option) (*CommentsDeleteRsp, error) {
|
||||
errmap := make(map[string]interface{}, 1)
|
||||
errmap["default"] = &ErrorRsp{}
|
||||
opts = append(opts,
|
||||
v41.ErrorMap(errmap),
|
||||
)
|
||||
opts = append(opts,
|
||||
v41.Method(http.MethodDelete),
|
||||
v41.Path("/v1/packages/{package_id}/comments/{id}"),
|
||||
)
|
||||
rsp := &CommentsDeleteRsp{}
|
||||
err := c.c.Call(ctx, c.c.NewRequest(c.name, "PkgdashService.CommentsDelete", req), rsp, opts...)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
return rsp, nil
|
||||
}
|
||||
|
||||
func (c *pkgdashServiceClient) ModulesList(ctx context.Context, req *ModulesListReq, opts ...options.Option) (*ModulesListRsp, error) {
|
||||
errmap := make(map[string]interface{}, 1)
|
||||
errmap["default"] = &ErrorRsp{}
|
||||
opts = append(opts,
|
||||
v41.ErrorMap(errmap),
|
||||
)
|
||||
opts = append(opts,
|
||||
v41.Method(http.MethodGet),
|
||||
v41.Path("/v1/modules"),
|
||||
)
|
||||
rsp := &ModulesListRsp{}
|
||||
err := c.c.Call(ctx, c.c.NewRequest(c.name, "PkgdashService.ModulesList", req), rsp, opts...)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
@@ -186,38 +274,53 @@ type pkgdashServiceServer struct {
|
||||
PkgdashServiceServer
|
||||
}
|
||||
|
||||
func (h *pkgdashServiceServer) ListPackage(ctx context.Context, req *emptypb.Empty, rsp *ListPackageRsp) error {
|
||||
return h.PkgdashServiceServer.ListPackage(ctx, req, rsp)
|
||||
func (h *pkgdashServiceServer) PackagesCreate(ctx context.Context, req *PackagesCreateReq, rsp *PackagesCreateRsp) error {
|
||||
return h.PkgdashServiceServer.PackagesCreate(ctx, req, rsp)
|
||||
}
|
||||
|
||||
func (h *pkgdashServiceServer) UpdatePackage(ctx context.Context, req *UpdatePackageReq, rsp *UpdatePackageRsp) error {
|
||||
return h.PkgdashServiceServer.UpdatePackage(ctx, req, rsp)
|
||||
func (h *pkgdashServiceServer) PackagesDelete(ctx context.Context, req *PackagesDeleteReq, rsp *PackagesDeleteRsp) error {
|
||||
return h.PkgdashServiceServer.PackagesDelete(ctx, req, rsp)
|
||||
}
|
||||
|
||||
func (h *pkgdashServiceServer) AddComment(ctx context.Context, req *AddCommentReq, rsp *AddCommentRsp) error {
|
||||
return h.PkgdashServiceServer.AddComment(ctx, req, rsp)
|
||||
func (h *pkgdashServiceServer) PackagesList(ctx context.Context, req *PackagesListReq, rsp *PackagesListRsp) error {
|
||||
return h.PkgdashServiceServer.PackagesList(ctx, req, rsp)
|
||||
}
|
||||
|
||||
func (h *pkgdashServiceServer) AddPackage(ctx context.Context, req *AddPackageReq, rsp *AddPackageRsp) error {
|
||||
return h.PkgdashServiceServer.AddPackage(ctx, req, rsp)
|
||||
func (h *pkgdashServiceServer) PackagesUpdate(ctx context.Context, req *PackagesUpdateReq, rsp *PackagesUpdateRsp) error {
|
||||
return h.PkgdashServiceServer.PackagesUpdate(ctx, req, rsp)
|
||||
}
|
||||
|
||||
func (h *pkgdashServiceServer) GetModule(ctx context.Context, req *GetModuleReq, rsp *GetModuleRsp) error {
|
||||
return h.PkgdashServiceServer.GetModule(ctx, req, rsp)
|
||||
func (h *pkgdashServiceServer) CommentsCreate(ctx context.Context, req *CommentsCreateReq, rsp *CommentsCreateRsp) error {
|
||||
return h.PkgdashServiceServer.CommentsCreate(ctx, req, rsp)
|
||||
}
|
||||
|
||||
func (h *pkgdashServiceServer) GetComments(ctx context.Context, req *GetCommentsReq, rsp *GetCommentsRsp) error {
|
||||
return h.PkgdashServiceServer.GetComments(ctx, req, rsp)
|
||||
func (h *pkgdashServiceServer) CommentsLookup(ctx context.Context, req *CommentsLookupReq, rsp *CommentsLookupRsp) error {
|
||||
return h.PkgdashServiceServer.CommentsLookup(ctx, req, rsp)
|
||||
}
|
||||
|
||||
func (h *pkgdashServiceServer) CommentsList(ctx context.Context, req *CommentsListReq, rsp *CommentsListRsp) error {
|
||||
return h.PkgdashServiceServer.CommentsList(ctx, req, rsp)
|
||||
}
|
||||
|
||||
func (h *pkgdashServiceServer) CommentsDelete(ctx context.Context, req *CommentsDeleteReq, rsp *CommentsDeleteRsp) error {
|
||||
return h.PkgdashServiceServer.CommentsDelete(ctx, req, rsp)
|
||||
}
|
||||
|
||||
func (h *pkgdashServiceServer) ModulesList(ctx context.Context, req *ModulesListReq, rsp *ModulesListRsp) error {
|
||||
return h.PkgdashServiceServer.ModulesList(ctx, req, rsp)
|
||||
}
|
||||
|
||||
func RegisterPkgdashServiceServer(s server.Server, sh PkgdashServiceServer, opts ...options.Option) error {
|
||||
type pkgdashService interface {
|
||||
ListPackage(ctx context.Context, req *emptypb.Empty, rsp *ListPackageRsp) error
|
||||
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
|
||||
GetComments(ctx context.Context, req *GetCommentsReq, rsp *GetCommentsRsp) error
|
||||
PackagesCreate(ctx context.Context, req *PackagesCreateReq, rsp *PackagesCreateRsp) error
|
||||
PackagesDelete(ctx context.Context, req *PackagesDeleteReq, rsp *PackagesDeleteRsp) error
|
||||
PackagesList(ctx context.Context, req *PackagesListReq, rsp *PackagesListRsp) error
|
||||
PackagesUpdate(ctx context.Context, req *PackagesUpdateReq, rsp *PackagesUpdateRsp) error
|
||||
CommentsCreate(ctx context.Context, req *CommentsCreateReq, rsp *CommentsCreateRsp) error
|
||||
CommentsLookup(ctx context.Context, req *CommentsLookupReq, rsp *CommentsLookupRsp) error
|
||||
CommentsList(ctx context.Context, req *CommentsListReq, rsp *CommentsListRsp) error
|
||||
CommentsDelete(ctx context.Context, req *CommentsDeleteReq, rsp *CommentsDeleteRsp) error
|
||||
ModulesList(ctx context.Context, req *ModulesListReq, rsp *ModulesListRsp) error
|
||||
}
|
||||
type PkgdashService struct {
|
||||
pkgdashService
|
||||
|
Reference in New Issue
Block a user