// Code generated by protoc-gen-micro. DO NOT EDIT. // source: device.proto package device import ( fmt "fmt" proto "github.com/golang/protobuf/proto" math "math" ) import ( context "context" client "github.com/micro/go-micro/client" server "github.com/micro/go-micro/server" ) // Reference imports to suppress errors if they are not otherwise used. var _ = proto.Marshal var _ = fmt.Errorf var _ = math.Inf // This is a compile-time assertion to ensure that this generated file // is compatible with the proto package it is being compiled against. // A compilation error at this line likely means your copy of the // proto package needs to be updated. const _ = proto.ProtoPackageIsVersion3 // please upgrade the proto package // Reference imports to suppress errors if they are not otherwise used. var _ context.Context var _ client.Option var _ server.Option // Client API for DeviceService service type DeviceService interface { AddDevice(ctx context.Context, in *AddDeviceReq, opts ...client.CallOption) (*AddDeviceReply, error) GetDeviceList(ctx context.Context, in *GetDeviceListReq, opts ...client.CallOption) (*GetDeviceListReply, error) GetAllDeviceMenu(ctx context.Context, in *GetAllDeviceMenuReq, opts ...client.CallOption) (*GetAllDeviceMenuReply, error) Unbind(ctx context.Context, in *UnbindReq, opts ...client.CallOption) (*UnbindReply, error) Install(ctx context.Context, in *InstallReq, opts ...client.CallOption) (*InstallReply, error) } type deviceService struct { c client.Client name string } func NewDeviceService(name string, c client.Client) DeviceService { if c == nil { c = client.NewClient() } if len(name) == 0 { name = "device" } return &deviceService{ c: c, name: name, } } func (c *deviceService) AddDevice(ctx context.Context, in *AddDeviceReq, opts ...client.CallOption) (*AddDeviceReply, error) { req := c.c.NewRequest(c.name, "DeviceService.AddDevice", in) out := new(AddDeviceReply) err := c.c.Call(ctx, req, out, opts...) if err != nil { return nil, err } return out, nil } func (c *deviceService) GetDeviceList(ctx context.Context, in *GetDeviceListReq, opts ...client.CallOption) (*GetDeviceListReply, error) { req := c.c.NewRequest(c.name, "DeviceService.GetDeviceList", in) out := new(GetDeviceListReply) err := c.c.Call(ctx, req, out, opts...) if err != nil { return nil, err } return out, nil } func (c *deviceService) GetAllDeviceMenu(ctx context.Context, in *GetAllDeviceMenuReq, opts ...client.CallOption) (*GetAllDeviceMenuReply, error) { req := c.c.NewRequest(c.name, "DeviceService.GetAllDeviceMenu", in) out := new(GetAllDeviceMenuReply) err := c.c.Call(ctx, req, out, opts...) if err != nil { return nil, err } return out, nil } func (c *deviceService) Unbind(ctx context.Context, in *UnbindReq, opts ...client.CallOption) (*UnbindReply, error) { req := c.c.NewRequest(c.name, "DeviceService.Unbind", in) out := new(UnbindReply) err := c.c.Call(ctx, req, out, opts...) if err != nil { return nil, err } return out, nil } func (c *deviceService) Install(ctx context.Context, in *InstallReq, opts ...client.CallOption) (*InstallReply, error) { req := c.c.NewRequest(c.name, "DeviceService.Install", in) out := new(InstallReply) err := c.c.Call(ctx, req, out, opts...) if err != nil { return nil, err } return out, nil } // Server API for DeviceService service type DeviceServiceHandler interface { AddDevice(context.Context, *AddDeviceReq, *AddDeviceReply) error GetDeviceList(context.Context, *GetDeviceListReq, *GetDeviceListReply) error GetAllDeviceMenu(context.Context, *GetAllDeviceMenuReq, *GetAllDeviceMenuReply) error Unbind(context.Context, *UnbindReq, *UnbindReply) error Install(context.Context, *InstallReq, *InstallReply) error } func RegisterDeviceServiceHandler(s server.Server, hdlr DeviceServiceHandler, opts ...server.HandlerOption) error { type deviceService interface { AddDevice(ctx context.Context, in *AddDeviceReq, out *AddDeviceReply) error GetDeviceList(ctx context.Context, in *GetDeviceListReq, out *GetDeviceListReply) error GetAllDeviceMenu(ctx context.Context, in *GetAllDeviceMenuReq, out *GetAllDeviceMenuReply) error Unbind(ctx context.Context, in *UnbindReq, out *UnbindReply) error Install(ctx context.Context, in *InstallReq, out *InstallReply) error } type DeviceService struct { deviceService } h := &deviceServiceHandler{hdlr} return s.Handle(s.NewHandler(&DeviceService{h}, opts...)) } type deviceServiceHandler struct { DeviceServiceHandler } func (h *deviceServiceHandler) AddDevice(ctx context.Context, in *AddDeviceReq, out *AddDeviceReply) error { return h.DeviceServiceHandler.AddDevice(ctx, in, out) } func (h *deviceServiceHandler) GetDeviceList(ctx context.Context, in *GetDeviceListReq, out *GetDeviceListReply) error { return h.DeviceServiceHandler.GetDeviceList(ctx, in, out) } func (h *deviceServiceHandler) GetAllDeviceMenu(ctx context.Context, in *GetAllDeviceMenuReq, out *GetAllDeviceMenuReply) error { return h.DeviceServiceHandler.GetAllDeviceMenu(ctx, in, out) } func (h *deviceServiceHandler) Unbind(ctx context.Context, in *UnbindReq, out *UnbindReply) error { return h.DeviceServiceHandler.Unbind(ctx, in, out) } func (h *deviceServiceHandler) Install(ctx context.Context, in *InstallReq, out *InstallReply) error { return h.DeviceServiceHandler.Install(ctx, in, out) }