pkgdash/proto/pkgdash_micro_http.pb.go

423 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.PackageLookup",
Path: "/v1/packages/{id}",
Method: "GET",
Body: "",
Stream: false,
},
2023-08-12 20:55:20 +03:00
{
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",
2023-08-12 20:55:20 +03:00
Path: "/v1/packages",
Method: "GET",
Body: "",
Stream: false,
},
{
Name: "PkgdashService.HandlerList",
Path: "/v1/packages/{package}/handlers",
Method: "GET",
Body: "",
Stream: false,
},
{
Name: "PkgdashService.PackageModules",
Path: "/v1/packages/{package}/modules",
Method: "GET",
Body: "",
Stream: false,
},
2023-08-12 20:55:20 +03:00
{
Name: "PkgdashService.PackageUpdate",
Path: "/v1/packages/{id}",
Method: "PUT",
2023-08-12 20:55:20 +03:00
Body: "*",
Stream: false,
},
{
Name: "PkgdashService.CommentCreate",
Path: "/v1/packages/{package}/comments",
2023-08-12 20:55:20 +03:00
Method: "POST",
Body: "*",
Stream: false,
},
{
Name: "PkgdashService.CommentLookup",
Path: "/v1/comments/{id}",
Method: "GET",
Body: "",
Stream: false,
},
{
Name: "PkgdashService.CommentLookup",
Path: "/v1/comments/{package}/comments/{id}",
Method: "GET",
Body: "",
2023-08-12 20:55:20 +03:00
Stream: false,
},
{
Name: "PkgdashService.CommentList",
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.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",
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) 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,
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 := &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) HandlerList(ctx context.Context, req *HandlerListReq, opts ...options.Option) (*HandlerListRsp, 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}/handlers"),
)
rsp := &HandlerListRsp{}
err := c.c.Call(ctx, c.c.NewRequest(c.name, "PkgdashService.HandlerList", 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,
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 := &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,
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 := &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,
2023-08-12 20:55:20 +03:00
v41.ErrorMap(errmap),
)
opts = append(opts,
v41.Method(http.MethodGet),
v41.Path("/v1/comments/{id}"),
)
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,
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 := &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) {
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 := &ModuleListRsp{}
err := c.c.Call(ctx, c.c.NewRequest(c.name, "PkgdashService.ModuleList", 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) 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) HandlerList(ctx context.Context, req *HandlerListReq, rsp *HandlerListRsp) error {
return h.PkgdashServiceServer.HandlerList(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)
2023-08-14 14:27:29 +03:00
}
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
HandlerList(ctx context.Context, req *HandlerListReq, rsp *HandlerListRsp) 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
2023-08-12 20:55:20 +03:00
nopts = append(nopts, v4.HandlerEndpoints(PkgdashServiceServerEndpoints))
return s.Handle(&PkgdashService{h}, append(nopts, opts...)...)
}