pkgdash/proto/pkgdash_micro_http.pb.go
Vasiliy Tolstov eb4daf33f1 rename
Signed-off-by: Vasiliy Tolstov <v.tolstov@unistack.org>
2023-08-20 14:19:57 +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.PackageLookup",
Path: "/v1/packages/{id}",
Method: "GET",
Body: "",
Stream: false,
},
{
Name: "PkgdashService.PackageCreate",
Path: "/v1/packages",
Method: "POST",
Body: "*",
Stream: false,
},
{
Name: "PkgdashService.PackageDelete",
Path: "/v1/packages/{id}",
Method: "DELETE",
Body: "",
Stream: false,
},
{
Name: "PkgdashService.PackageList",
Path: "/v1/packages",
Method: "GET",
Body: "",
Stream: false,
},
{
Name: "PkgdashService.PackageModules",
Path: "/v1/packages/{package}/modules",
Method: "GET",
Body: "",
Stream: false,
},
{
Name: "PkgdashService.PackageUpdate",
Path: "/v1/packages/{id}",
Method: "PUT",
Body: "*",
Stream: false,
},
{
Name: "PkgdashService.CommentCreate",
Path: "/v1/packages/{package}/comments",
Method: "POST",
Body: "*",
Stream: false,
},
{
Name: "PkgdashService.CommentLookup",
Path: "/v1/comments/{id}/comments",
Method: "GET",
Body: "",
Stream: false,
},
{
Name: "PkgdashService.CommentLookup",
Path: "/v1/comments/{package}/comments/{id}",
Method: "GET",
Body: "",
Stream: false,
},
{
Name: "PkgdashService.CommentList",
Path: "/v1/packages/{package}/comments",
Method: "GET",
Body: "",
Stream: false,
},
{
Name: "PkgdashService.CommentDelete",
Path: "/v1/packages/{package_id}/comments/{id}",
Method: "DELETE",
Body: "",
Stream: false,
},
{
Name: "PkgdashService.CommentDelete",
Path: "/v1/comments/{id}",
Method: "DELETE",
Body: "",
Stream: false,
},
{
Name: "PkgdashService.ModuleList",
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) PackageLookup(ctx context.Context, req *PackageLookupReq, opts ...options.Option) (*PackageLookupRsp, 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 := &PackageLookupRsp{}
err := c.c.Call(ctx, c.c.NewRequest(c.name, "PkgdashService.PackageLookup", req), rsp, opts...)
if err != nil {
return nil, err
}
return rsp, nil
}
func (c *pkgdashServiceClient) PackageCreate(ctx context.Context, req *PackageCreateReq, opts ...options.Option) (*PackageCreateRsp, 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 := &PackageCreateRsp{}
err := c.c.Call(ctx, c.c.NewRequest(c.name, "PkgdashService.PackageCreate", req), rsp, opts...)
if err != nil {
return nil, err
}
return rsp, nil
}
func (c *pkgdashServiceClient) PackageDelete(ctx context.Context, req *PackageDeleteReq, opts ...options.Option) (*PackageDeleteRsp, 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 := &PackageDeleteRsp{}
err := c.c.Call(ctx, c.c.NewRequest(c.name, "PkgdashService.PackageDelete", req), rsp, opts...)
if err != nil {
return nil, err
}
return rsp, nil
}
func (c *pkgdashServiceClient) PackageList(ctx context.Context, req *PackageListReq, opts ...options.Option) (*PackageListRsp, 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 := &PackageListRsp{}
err := c.c.Call(ctx, c.c.NewRequest(c.name, "PkgdashService.PackageList", req), rsp, opts...)
if err != nil {
return nil, err
}
return rsp, nil
}
func (c *pkgdashServiceClient) PackageModules(ctx context.Context, req *PackageModulesReq, opts ...options.Option) (*PackageModulesRsp, 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}/modules"),
)
rsp := &PackageModulesRsp{}
err := c.c.Call(ctx, c.c.NewRequest(c.name, "PkgdashService.PackageModules", req), rsp, opts...)
if err != nil {
return nil, err
}
return rsp, nil
}
func (c *pkgdashServiceClient) PackageUpdate(ctx context.Context, req *PackageUpdateReq, opts ...options.Option) (*PackageUpdateRsp, 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 := &PackageUpdateRsp{}
err := c.c.Call(ctx, c.c.NewRequest(c.name, "PkgdashService.PackageUpdate", req), rsp, opts...)
if err != nil {
return nil, err
}
return rsp, nil
}
func (c *pkgdashServiceClient) CommentCreate(ctx context.Context, req *CommentCreateReq, opts ...options.Option) (*CommentCreateRsp, 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}/comments"),
v41.Body("*"),
)
rsp := &CommentCreateRsp{}
err := c.c.Call(ctx, c.c.NewRequest(c.name, "PkgdashService.CommentCreate", req), rsp, opts...)
if err != nil {
return nil, err
}
return rsp, nil
}
func (c *pkgdashServiceClient) CommentLookup(ctx context.Context, req *CommentLookupReq, opts ...options.Option) (*CommentLookupRsp, 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 := &CommentLookupRsp{}
err := c.c.Call(ctx, c.c.NewRequest(c.name, "PkgdashService.CommentLookup", req), rsp, opts...)
if err != nil {
return nil, err
}
return rsp, nil
}
func (c *pkgdashServiceClient) CommentList(ctx context.Context, req *CommentListReq, opts ...options.Option) (*CommentListRsp, 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}/comments"),
)
rsp := &CommentListRsp{}
err := c.c.Call(ctx, c.c.NewRequest(c.name, "PkgdashService.CommentList", req), rsp, opts...)
if err != nil {
return nil, err
}
return rsp, nil
}
func (c *pkgdashServiceClient) CommentDelete(ctx context.Context, req *CommentDeleteReq, opts ...options.Option) (*CommentDeleteRsp, 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 := &CommentDeleteRsp{}
err := c.c.Call(ctx, c.c.NewRequest(c.name, "PkgdashService.CommentDelete", req), rsp, opts...)
if err != nil {
return nil, err
}
return rsp, nil
}
func (c *pkgdashServiceClient) ModuleList(ctx context.Context, req *ModuleListReq, opts ...options.Option) (*ModuleListRsp, 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 := &ModuleListRsp{}
err := c.c.Call(ctx, c.c.NewRequest(c.name, "PkgdashService.ModuleList", req), rsp, opts...)
if err != nil {
return nil, err
}
return rsp, nil
}
type pkgdashServiceServer struct {
PkgdashServiceServer
}
func (h *pkgdashServiceServer) PackageLookup(ctx context.Context, req *PackageLookupReq, rsp *PackageLookupRsp) error {
return h.PkgdashServiceServer.PackageLookup(ctx, req, rsp)
}
func (h *pkgdashServiceServer) PackageCreate(ctx context.Context, req *PackageCreateReq, rsp *PackageCreateRsp) error {
return h.PkgdashServiceServer.PackageCreate(ctx, req, rsp)
}
func (h *pkgdashServiceServer) PackageDelete(ctx context.Context, req *PackageDeleteReq, rsp *PackageDeleteRsp) error {
return h.PkgdashServiceServer.PackageDelete(ctx, req, rsp)
}
func (h *pkgdashServiceServer) PackageList(ctx context.Context, req *PackageListReq, rsp *PackageListRsp) error {
return h.PkgdashServiceServer.PackageList(ctx, req, rsp)
}
func (h *pkgdashServiceServer) PackageModules(ctx context.Context, req *PackageModulesReq, rsp *PackageModulesRsp) error {
return h.PkgdashServiceServer.PackageModules(ctx, req, rsp)
}
func (h *pkgdashServiceServer) PackageUpdate(ctx context.Context, req *PackageUpdateReq, rsp *PackageUpdateRsp) error {
return h.PkgdashServiceServer.PackageUpdate(ctx, req, rsp)
}
func (h *pkgdashServiceServer) CommentCreate(ctx context.Context, req *CommentCreateReq, rsp *CommentCreateRsp) error {
return h.PkgdashServiceServer.CommentCreate(ctx, req, rsp)
}
func (h *pkgdashServiceServer) CommentLookup(ctx context.Context, req *CommentLookupReq, rsp *CommentLookupRsp) error {
return h.PkgdashServiceServer.CommentLookup(ctx, req, rsp)
}
func (h *pkgdashServiceServer) CommentList(ctx context.Context, req *CommentListReq, rsp *CommentListRsp) error {
return h.PkgdashServiceServer.CommentList(ctx, req, rsp)
}
func (h *pkgdashServiceServer) CommentDelete(ctx context.Context, req *CommentDeleteReq, rsp *CommentDeleteRsp) error {
return h.PkgdashServiceServer.CommentDelete(ctx, req, rsp)
}
func (h *pkgdashServiceServer) ModuleList(ctx context.Context, req *ModuleListReq, rsp *ModuleListRsp) error {
return h.PkgdashServiceServer.ModuleList(ctx, req, rsp)
}
func RegisterPkgdashServiceServer(s server.Server, sh PkgdashServiceServer, opts ...options.Option) error {
type pkgdashService interface {
PackageLookup(ctx context.Context, req *PackageLookupReq, rsp *PackageLookupRsp) error
PackageCreate(ctx context.Context, req *PackageCreateReq, rsp *PackageCreateRsp) error
PackageDelete(ctx context.Context, req *PackageDeleteReq, rsp *PackageDeleteRsp) error
PackageList(ctx context.Context, req *PackageListReq, rsp *PackageListRsp) error
PackageModules(ctx context.Context, req *PackageModulesReq, rsp *PackageModulesRsp) error
PackageUpdate(ctx context.Context, req *PackageUpdateReq, rsp *PackageUpdateRsp) error
CommentCreate(ctx context.Context, req *CommentCreateReq, rsp *CommentCreateRsp) error
CommentLookup(ctx context.Context, req *CommentLookupReq, rsp *CommentLookupRsp) error
CommentList(ctx context.Context, req *CommentListReq, rsp *CommentListRsp) error
CommentDelete(ctx context.Context, req *CommentDeleteReq, rsp *CommentDeleteRsp) error
ModuleList(ctx context.Context, req *ModuleListReq, rsp *ModuleListRsp) 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...)...)
}