github.com/tickoalcantara12/micro/v3@v3.0.0-20221007104245-9d75b9bcbab9/proto/config/config.pb.micro.go (about)

     1  // Code generated by protoc-gen-micro. DO NOT EDIT.
     2  // source: config/config.proto
     3  
     4  package config
     5  
     6  import (
     7  	fmt "fmt"
     8  	proto "github.com/golang/protobuf/proto"
     9  	math "math"
    10  )
    11  
    12  import (
    13  	context "context"
    14  	api "github.com/tickoalcantara12/micro/v3/service/api"
    15  	client "github.com/tickoalcantara12/micro/v3/service/client"
    16  	server "github.com/tickoalcantara12/micro/v3/service/server"
    17  )
    18  
    19  // Reference imports to suppress errors if they are not otherwise used.
    20  var _ = proto.Marshal
    21  var _ = fmt.Errorf
    22  var _ = math.Inf
    23  
    24  // This is a compile-time assertion to ensure that this generated file
    25  // is compatible with the proto package it is being compiled against.
    26  // A compilation error at this line likely means your copy of the
    27  // proto package needs to be updated.
    28  const _ = proto.ProtoPackageIsVersion3 // please upgrade the proto package
    29  
    30  // Reference imports to suppress errors if they are not otherwise used.
    31  var _ api.Endpoint
    32  var _ context.Context
    33  var _ client.Option
    34  var _ server.Option
    35  
    36  // Api Endpoints for Config service
    37  
    38  func NewConfigEndpoints() []*api.Endpoint {
    39  	return []*api.Endpoint{}
    40  }
    41  
    42  // Client API for Config service
    43  
    44  type ConfigService interface {
    45  	Get(ctx context.Context, in *GetRequest, opts ...client.CallOption) (*GetResponse, error)
    46  	Set(ctx context.Context, in *SetRequest, opts ...client.CallOption) (*SetResponse, error)
    47  	Delete(ctx context.Context, in *DeleteRequest, opts ...client.CallOption) (*DeleteResponse, error)
    48  	// These methods are here for backwards compatibility reasons
    49  	Read(ctx context.Context, in *ReadRequest, opts ...client.CallOption) (*ReadResponse, error)
    50  }
    51  
    52  type configService struct {
    53  	c    client.Client
    54  	name string
    55  }
    56  
    57  func NewConfigService(name string, c client.Client) ConfigService {
    58  	return &configService{
    59  		c:    c,
    60  		name: name,
    61  	}
    62  }
    63  
    64  func (c *configService) Get(ctx context.Context, in *GetRequest, opts ...client.CallOption) (*GetResponse, error) {
    65  	req := c.c.NewRequest(c.name, "Config.Get", in)
    66  	out := new(GetResponse)
    67  	err := c.c.Call(ctx, req, out, opts...)
    68  	if err != nil {
    69  		return nil, err
    70  	}
    71  	return out, nil
    72  }
    73  
    74  func (c *configService) Set(ctx context.Context, in *SetRequest, opts ...client.CallOption) (*SetResponse, error) {
    75  	req := c.c.NewRequest(c.name, "Config.Set", in)
    76  	out := new(SetResponse)
    77  	err := c.c.Call(ctx, req, out, opts...)
    78  	if err != nil {
    79  		return nil, err
    80  	}
    81  	return out, nil
    82  }
    83  
    84  func (c *configService) Delete(ctx context.Context, in *DeleteRequest, opts ...client.CallOption) (*DeleteResponse, error) {
    85  	req := c.c.NewRequest(c.name, "Config.Delete", in)
    86  	out := new(DeleteResponse)
    87  	err := c.c.Call(ctx, req, out, opts...)
    88  	if err != nil {
    89  		return nil, err
    90  	}
    91  	return out, nil
    92  }
    93  
    94  func (c *configService) Read(ctx context.Context, in *ReadRequest, opts ...client.CallOption) (*ReadResponse, error) {
    95  	req := c.c.NewRequest(c.name, "Config.Read", in)
    96  	out := new(ReadResponse)
    97  	err := c.c.Call(ctx, req, out, opts...)
    98  	if err != nil {
    99  		return nil, err
   100  	}
   101  	return out, nil
   102  }
   103  
   104  // Server API for Config service
   105  
   106  type ConfigHandler interface {
   107  	Get(context.Context, *GetRequest, *GetResponse) error
   108  	Set(context.Context, *SetRequest, *SetResponse) error
   109  	Delete(context.Context, *DeleteRequest, *DeleteResponse) error
   110  	// These methods are here for backwards compatibility reasons
   111  	Read(context.Context, *ReadRequest, *ReadResponse) error
   112  }
   113  
   114  func RegisterConfigHandler(s server.Server, hdlr ConfigHandler, opts ...server.HandlerOption) error {
   115  	type config interface {
   116  		Get(ctx context.Context, in *GetRequest, out *GetResponse) error
   117  		Set(ctx context.Context, in *SetRequest, out *SetResponse) error
   118  		Delete(ctx context.Context, in *DeleteRequest, out *DeleteResponse) error
   119  		Read(ctx context.Context, in *ReadRequest, out *ReadResponse) error
   120  	}
   121  	type Config struct {
   122  		config
   123  	}
   124  	h := &configHandler{hdlr}
   125  	return s.Handle(s.NewHandler(&Config{h}, opts...))
   126  }
   127  
   128  type configHandler struct {
   129  	ConfigHandler
   130  }
   131  
   132  func (h *configHandler) Get(ctx context.Context, in *GetRequest, out *GetResponse) error {
   133  	return h.ConfigHandler.Get(ctx, in, out)
   134  }
   135  
   136  func (h *configHandler) Set(ctx context.Context, in *SetRequest, out *SetResponse) error {
   137  	return h.ConfigHandler.Set(ctx, in, out)
   138  }
   139  
   140  func (h *configHandler) Delete(ctx context.Context, in *DeleteRequest, out *DeleteResponse) error {
   141  	return h.ConfigHandler.Delete(ctx, in, out)
   142  }
   143  
   144  func (h *configHandler) Read(ctx context.Context, in *ReadRequest, out *ReadResponse) error {
   145  	return h.ConfigHandler.Read(ctx, in, out)
   146  }