2021-10-26 23:32:16 +03:00
|
|
|
// Code generated by protoc-gen-go-micro. DO NOT EDIT.
|
2023-08-15 07:43:43 +03:00
|
|
|
// protoc-gen-go-micro version: v4.0.2
|
2021-03-22 08:59:52 +03:00
|
|
|
// source: service.proto
|
2021-10-26 23:32:16 +03:00
|
|
|
|
2021-05-09 18:47:50 +03:00
|
|
|
package servicepb
|
2021-03-22 08:59:52 +03:00
|
|
|
|
|
|
|
import (
|
|
|
|
context "context"
|
2023-05-05 20:06:27 +03:00
|
|
|
proto "go.unistack.org/micro-config-service/v4/proto"
|
|
|
|
client "go.unistack.org/micro/v4/client"
|
2023-08-15 07:43:43 +03:00
|
|
|
options "go.unistack.org/micro/v4/options"
|
2023-05-05 20:06:27 +03:00
|
|
|
server "go.unistack.org/micro/v4/server"
|
2021-03-22 08:59:52 +03:00
|
|
|
)
|
|
|
|
|
2023-05-05 20:06:27 +03:00
|
|
|
type configServiceClient struct {
|
2021-03-22 08:59:52 +03:00
|
|
|
c client.Client
|
|
|
|
name string
|
|
|
|
}
|
|
|
|
|
2023-08-15 07:43:43 +03:00
|
|
|
func NewConfigServiceClient(name string, c client.Client) proto.ConfigServiceClient {
|
2023-05-05 20:06:27 +03:00
|
|
|
return &configServiceClient{c: c, name: name}
|
2021-03-22 08:59:52 +03:00
|
|
|
}
|
|
|
|
|
2023-08-15 07:43:43 +03:00
|
|
|
func (c *configServiceClient) Load(ctx context.Context, req *proto.LoadRequest, opts ...options.Option) (*proto.LoadResponse, error) {
|
2021-03-22 08:59:52 +03:00
|
|
|
rsp := &proto.LoadResponse{}
|
2023-05-05 20:06:27 +03:00
|
|
|
err := c.c.Call(ctx, c.c.NewRequest(c.name, "ConfigService.Load", req), rsp, opts...)
|
2021-03-22 08:59:52 +03:00
|
|
|
if err != nil {
|
|
|
|
return nil, err
|
|
|
|
}
|
|
|
|
return rsp, nil
|
|
|
|
}
|
|
|
|
|
2023-08-15 07:43:43 +03:00
|
|
|
func (c *configServiceClient) Save(ctx context.Context, req *proto.SaveRequest, opts ...options.Option) (*proto.SaveResponse, error) {
|
2021-03-22 08:59:52 +03:00
|
|
|
rsp := &proto.SaveResponse{}
|
2023-05-05 20:06:27 +03:00
|
|
|
err := c.c.Call(ctx, c.c.NewRequest(c.name, "ConfigService.Save", req), rsp, opts...)
|
2021-03-22 08:59:52 +03:00
|
|
|
if err != nil {
|
|
|
|
return nil, err
|
|
|
|
}
|
|
|
|
return rsp, nil
|
|
|
|
}
|
|
|
|
|
2023-05-05 20:06:27 +03:00
|
|
|
type configServiceServer struct {
|
2023-08-15 07:43:43 +03:00
|
|
|
proto.ConfigServiceServer
|
2021-03-22 08:59:52 +03:00
|
|
|
}
|
|
|
|
|
2023-05-05 20:06:27 +03:00
|
|
|
func (h *configServiceServer) Load(ctx context.Context, req *proto.LoadRequest, rsp *proto.LoadResponse) error {
|
|
|
|
return h.ConfigServiceServer.Load(ctx, req, rsp)
|
2021-03-22 08:59:52 +03:00
|
|
|
}
|
|
|
|
|
2023-05-05 20:06:27 +03:00
|
|
|
func (h *configServiceServer) Save(ctx context.Context, req *proto.SaveRequest, rsp *proto.SaveResponse) error {
|
|
|
|
return h.ConfigServiceServer.Save(ctx, req, rsp)
|
2021-03-22 08:59:52 +03:00
|
|
|
}
|
|
|
|
|
2023-08-15 07:43:43 +03:00
|
|
|
func RegisterConfigServiceServer(s server.Server, sh proto.ConfigServiceServer, opts ...options.Option) error {
|
2023-05-05 20:06:27 +03:00
|
|
|
type configService interface {
|
2021-03-22 08:59:52 +03:00
|
|
|
Load(ctx context.Context, req *proto.LoadRequest, rsp *proto.LoadResponse) error
|
|
|
|
Save(ctx context.Context, req *proto.SaveRequest, rsp *proto.SaveResponse) error
|
|
|
|
}
|
2023-05-05 20:06:27 +03:00
|
|
|
type ConfigService struct {
|
|
|
|
configService
|
2021-03-22 08:59:52 +03:00
|
|
|
}
|
2023-05-05 20:06:27 +03:00
|
|
|
h := &configServiceServer{sh}
|
2023-08-15 07:43:43 +03:00
|
|
|
var nopts []options.Option
|
|
|
|
return s.Handle(&ConfigService{h}, append(nopts, opts...)...)
|
2021-03-22 08:59:52 +03:00
|
|
|
}
|