pkgdash/proto/pkgdash_micro_http.pb.go
Vasiliy Tolstov 0e18a63f10 use worker
Signed-off-by: Vasiliy Tolstov <v.tolstov@unistack.org>
2023-08-18 23:59:15 +03:00

393 lines
12 KiB
Go

// Code generated by protoc-gen-go-micro. DO NOT EDIT.
// protoc-gen-go-micro version: v4.0.2
// source: pkgdash.proto
package pkgdashpb
import (
context "context"
v41 "go.unistack.org/micro-client-http/v4"
v4 "go.unistack.org/micro-server-http/v4"
client "go.unistack.org/micro/v4/client"
options "go.unistack.org/micro/v4/options"
server "go.unistack.org/micro/v4/server"
http "net/http"
)
var (
PkgdashServiceServerEndpoints = []v4.EndpointMetadata{
{
Name: "PkgdashService.PackagesLookup",
Path: "/v1/packages/{id}",
Method: "GET",
Body: "",
Stream: false,
},
{
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.PackagesModules",
Path: "/v1/packages/{id}/modules",
Method: "GET",
Body: "",
Stream: false,
},
{
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.CommentsLookup",
Path: "/v1/comments/{id}/comments",
Method: "GET",
Body: "",
Stream: false,
},
{
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,
},
}
)
type pkgdashServiceClient struct {
c client.Client
name string
}
func NewPkgdashServiceClient(name string, c client.Client) PkgdashServiceClient {
return &pkgdashServiceClient{c: c, name: name}
}
func (c *pkgdashServiceClient) PackagesLookup(ctx context.Context, req *PackagesLookupReq, opts ...options.Option) (*PackagesLookupRsp, 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/packages/{id}"),
)
rsp := &PackagesLookupRsp{}
err := c.c.Call(ctx, c.c.NewRequest(c.name, "PkgdashService.PackagesLookup", req), rsp, opts...)
if err != nil {
return nil, err
}
return rsp, nil
}
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,
v41.ErrorMap(errmap),
)
opts = append(opts,
v41.Method(http.MethodGet),
v41.Path("/v1/packages"),
)
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) PackagesModules(ctx context.Context, req *PackagesModulesReq, opts ...options.Option) (*PackagesModulesRsp, 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/packages/{id}/modules"),
)
rsp := &PackagesModulesRsp{}
err := c.c.Call(ctx, c.c.NewRequest(c.name, "PkgdashService.PackagesModules", req), rsp, opts...)
if err != nil {
return nil, err
}
return rsp, nil
}
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,
v41.ErrorMap(errmap),
)
opts = append(opts,
v41.Method(http.MethodPost),
v41.Path("/v1/packages/{package_id}/comments"),
v41.Body("*"),
)
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) CommentsLookup(ctx context.Context, req *CommentsLookupReq, opts ...options.Option) (*CommentsLookupRsp, 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/comments/{id}/comments"),
)
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) CommentsList(ctx context.Context, req *CommentsListReq, opts ...options.Option) (*CommentsListRsp, 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/packages/{package_id}/comments"),
)
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
}
return rsp, nil
}
type pkgdashServiceServer struct {
PkgdashServiceServer
}
func (h *pkgdashServiceServer) PackagesLookup(ctx context.Context, req *PackagesLookupReq, rsp *PackagesLookupRsp) error {
return h.PkgdashServiceServer.PackagesLookup(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) PackagesDelete(ctx context.Context, req *PackagesDeleteReq, rsp *PackagesDeleteRsp) error {
return h.PkgdashServiceServer.PackagesDelete(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) PackagesModules(ctx context.Context, req *PackagesModulesReq, rsp *PackagesModulesRsp) error {
return h.PkgdashServiceServer.PackagesModules(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) CommentsCreate(ctx context.Context, req *CommentsCreateReq, rsp *CommentsCreateRsp) error {
return h.PkgdashServiceServer.CommentsCreate(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 {
PackagesLookup(ctx context.Context, req *PackagesLookupReq, rsp *PackagesLookupRsp) 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
PackagesModules(ctx context.Context, req *PackagesModulesReq, rsp *PackagesModulesRsp) 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
}
h := &pkgdashServiceServer{sh}
var nopts []options.Option
nopts = append(nopts, v4.HandlerEndpoints(PkgdashServiceServerEndpoints))
return s.Handle(&PkgdashService{h}, append(nopts, opts...)...)
}