pkgdash/proto/pkgdash_micro_http.pb.go

393 lines
12 KiB
Go
Raw Normal View History

// 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
// 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"
options "go.unistack.org/micro/v4/options"
2023-08-12 20:55:20 +03:00
server "go.unistack.org/micro/v4/server"
http "net/http"
)
2023-08-12 20:55:20 +03:00
var (
PkgdashServiceServerEndpoints = []v4.EndpointMetadata{
{
Name: "PkgdashService.PackagesLookup",
Path: "/v1/packages/{id}",
Method: "GET",
Body: "",
Stream: false,
},
2023-08-12 20:55:20 +03:00
{
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",
2023-08-12 20:55:20 +03:00
Path: "/v1/packages",
Method: "GET",
Body: "",
Stream: false,
},
{
Name: "PkgdashService.PackagesModules",
Path: "/v1/packages/{package}/modules",
Method: "GET",
Body: "",
Stream: false,
},
2023-08-12 20:55:20 +03:00
{
Name: "PkgdashService.PackagesUpdate",
Path: "/v1/packages/{id}",
Method: "PUT",
2023-08-12 20:55:20 +03:00
Body: "*",
Stream: false,
},
{
Name: "PkgdashService.CommentsCreate",
Path: "/v1/packages/{package}/comments",
2023-08-12 20:55:20 +03:00
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}/comments/{id}",
Method: "GET",
Body: "",
2023-08-12 20:55:20 +03:00
Stream: false,
},
{
Name: "PkgdashService.CommentsList",
Path: "/v1/packages/{package}/comments",
2023-08-12 20:55:20 +03:00
Method: "GET",
Body: "",
Stream: false,
},
2023-08-14 14:27:29 +03:00
{
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",
2023-08-14 14:27:29 +03:00
Method: "GET",
Body: "",
Stream: false,
},
2023-08-12 20:55:20 +03:00
}
)
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,
2023-08-12 20:55:20 +03:00
v41.ErrorMap(errmap),
)
opts = append(opts,
2023-08-12 20:55:20 +03:00
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/{package}/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,
2023-08-12 20:55:20 +03:00
v41.ErrorMap(errmap),
)
opts = append(opts,
v41.Method(http.MethodPut),
v41.Path("/v1/packages/{id}"),
2023-08-12 20:55:20 +03:00
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,
2023-08-12 20:55:20 +03:00
v41.ErrorMap(errmap),
)
opts = append(opts,
2023-08-12 20:55:20 +03:00
v41.Method(http.MethodPost),
v41.Path("/v1/packages/{package}/comments"),
2023-08-12 20:55:20 +03:00
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,
2023-08-12 20:55:20 +03:00
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,
2023-08-12 20:55:20 +03:00
v41.ErrorMap(errmap),
)
opts = append(opts,
2023-08-12 20:55:20 +03:00
v41.Method(http.MethodGet),
v41.Path("/v1/packages/{package}/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) {
2023-08-14 14:27:29 +03:00
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"),
2023-08-14 14:27:29 +03:00
)
rsp := &ModulesListRsp{}
err := c.c.Call(ctx, c.c.NewRequest(c.name, "PkgdashService.ModulesList", req), rsp, opts...)
2023-08-14 14:27:29 +03:00
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)
2023-08-14 14:27:29 +03:00
}
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
2023-08-12 20:55:20 +03:00
nopts = append(nopts, v4.HandlerEndpoints(PkgdashServiceServerEndpoints))
return s.Handle(&PkgdashService{h}, append(nopts, opts...)...)
}