Signed-off-by: Vasiliy Tolstov <v.tolstov@unistack.org>
This commit is contained in:
2023-08-12 20:59:01 +03:00
parent a11bb6b95c
commit dc0c660021
4 changed files with 23 additions and 38 deletions

View File

@@ -9,6 +9,7 @@ import (
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"
emptypb "google.golang.org/protobuf/types/known/emptypb"
http "net/http"
@@ -63,7 +64,7 @@ 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 ...client.CallOption) (*ListPackageRsp, error) {
func (c *pkgdashServiceClient) ListPackage(ctx context.Context, req *emptypb.Empty, opts ...options.Option) (*ListPackageRsp, error) {
errmap := make(map[string]interface{}, 1)
errmap["default"] = &ErrorRsp{}
opts = append(opts,
@@ -81,7 +82,7 @@ func (c *pkgdashServiceClient) ListPackage(ctx context.Context, req *emptypb.Emp
return rsp, nil
}
func (c *pkgdashServiceClient) UpdatePackage(ctx context.Context, req *UpdatePackageReq, opts ...client.CallOption) (*UpdatePackageRsp, error) {
func (c *pkgdashServiceClient) UpdatePackage(ctx context.Context, req *UpdatePackageReq, opts ...options.Option) (*UpdatePackageRsp, error) {
errmap := make(map[string]interface{}, 1)
errmap["default"] = &ErrorRsp{}
opts = append(opts,
@@ -100,7 +101,7 @@ func (c *pkgdashServiceClient) UpdatePackage(ctx context.Context, req *UpdatePac
return rsp, nil
}
func (c *pkgdashServiceClient) AddComment(ctx context.Context, req *AddCommentReq, opts ...client.CallOption) (*AddCommentRsp, error) {
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,
@@ -119,7 +120,7 @@ func (c *pkgdashServiceClient) AddComment(ctx context.Context, req *AddCommentRe
return rsp, nil
}
func (c *pkgdashServiceClient) AddPackage(ctx context.Context, req *AddPackageReq, opts ...client.CallOption) (*AddPackageRsp, error) {
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,
@@ -138,7 +139,7 @@ func (c *pkgdashServiceClient) AddPackage(ctx context.Context, req *AddPackageRe
return rsp, nil
}
func (c *pkgdashServiceClient) GetModule(ctx context.Context, req *GetModuleReq, opts ...client.CallOption) (*GetModuleRsp, error) {
func (c *pkgdashServiceClient) GetModule(ctx context.Context, req *GetModuleReq, opts ...options.Option) (*GetModuleRsp, error) {
errmap := make(map[string]interface{}, 1)
errmap["default"] = &ErrorRsp{}
opts = append(opts,
@@ -180,7 +181,7 @@ func (h *pkgdashServiceServer) GetModule(ctx context.Context, req *GetModuleReq,
return h.PkgdashServiceServer.GetModule(ctx, req, rsp)
}
func RegisterPkgdashServiceServer(s server.Server, sh PkgdashServiceServer, opts ...server.HandlerOption) error {
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
@@ -192,7 +193,7 @@ func RegisterPkgdashServiceServer(s server.Server, sh PkgdashServiceServer, opts
pkgdashService
}
h := &pkgdashServiceServer{sh}
var nopts []server.HandlerOption
var nopts []options.Option
nopts = append(nopts, v4.HandlerEndpoints(PkgdashServiceServerEndpoints))
return s.Handle(s.NewHandler(&PkgdashService{h}, append(nopts, opts...)...))
return s.Handle(&PkgdashService{h}, append(nopts, opts...)...)
}