// Code generated by protoc-gen-go-grpc. DO NOT EDIT. // versions: // - protoc-gen-go-grpc v1.6.1 // - protoc (unknown) // source: ha/v1/light.proto package hav1 import ( context "context" grpc "google.golang.org/grpc" codes "google.golang.org/grpc/codes" status "google.golang.org/grpc/status" ) // This is a compile-time assertion to ensure that this generated file // is compatible with the grpc package it is being compiled against. // Requires gRPC-Go v1.64.0 or later. const _ = grpc.SupportPackageIsVersion9 const ( LightService_TurnOn_FullMethodName = "/ha.v1.LightService/TurnOn" LightService_TurnOff_FullMethodName = "/ha.v1.LightService/TurnOff" LightService_Toggle_FullMethodName = "/ha.v1.LightService/Toggle" ) // LightServiceClient is the client API for LightService service. // // For semantics around ctx use and closing/ending streaming RPCs, please refer to https://pkg.go.dev/google.golang.org/grpc/?tab=doc#ClientConn.NewStream. type LightServiceClient interface { TurnOn(ctx context.Context, in *TurnOnRequest, opts ...grpc.CallOption) (*LightResponse, error) TurnOff(ctx context.Context, in *TurnOffRequest, opts ...grpc.CallOption) (*LightResponse, error) Toggle(ctx context.Context, in *ToggleRequest, opts ...grpc.CallOption) (*LightResponse, error) } type lightServiceClient struct { cc grpc.ClientConnInterface } func NewLightServiceClient(cc grpc.ClientConnInterface) LightServiceClient { return &lightServiceClient{cc} } func (c *lightServiceClient) TurnOn(ctx context.Context, in *TurnOnRequest, opts ...grpc.CallOption) (*LightResponse, error) { cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...) out := new(LightResponse) err := c.cc.Invoke(ctx, LightService_TurnOn_FullMethodName, in, out, cOpts...) if err != nil { return nil, err } return out, nil } func (c *lightServiceClient) TurnOff(ctx context.Context, in *TurnOffRequest, opts ...grpc.CallOption) (*LightResponse, error) { cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...) out := new(LightResponse) err := c.cc.Invoke(ctx, LightService_TurnOff_FullMethodName, in, out, cOpts...) if err != nil { return nil, err } return out, nil } func (c *lightServiceClient) Toggle(ctx context.Context, in *ToggleRequest, opts ...grpc.CallOption) (*LightResponse, error) { cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...) out := new(LightResponse) err := c.cc.Invoke(ctx, LightService_Toggle_FullMethodName, in, out, cOpts...) if err != nil { return nil, err } return out, nil } // LightServiceServer is the server API for LightService service. // All implementations must embed UnimplementedLightServiceServer // for forward compatibility. type LightServiceServer interface { TurnOn(context.Context, *TurnOnRequest) (*LightResponse, error) TurnOff(context.Context, *TurnOffRequest) (*LightResponse, error) Toggle(context.Context, *ToggleRequest) (*LightResponse, error) mustEmbedUnimplementedLightServiceServer() } // UnimplementedLightServiceServer must be embedded to have // forward compatible implementations. // // NOTE: this should be embedded by value instead of pointer to avoid a nil // pointer dereference when methods are called. type UnimplementedLightServiceServer struct{} func (UnimplementedLightServiceServer) TurnOn(context.Context, *TurnOnRequest) (*LightResponse, error) { return nil, status.Error(codes.Unimplemented, "method TurnOn not implemented") } func (UnimplementedLightServiceServer) TurnOff(context.Context, *TurnOffRequest) (*LightResponse, error) { return nil, status.Error(codes.Unimplemented, "method TurnOff not implemented") } func (UnimplementedLightServiceServer) Toggle(context.Context, *ToggleRequest) (*LightResponse, error) { return nil, status.Error(codes.Unimplemented, "method Toggle not implemented") } func (UnimplementedLightServiceServer) mustEmbedUnimplementedLightServiceServer() {} func (UnimplementedLightServiceServer) testEmbeddedByValue() {} // UnsafeLightServiceServer may be embedded to opt out of forward compatibility for this service. // Use of this interface is not recommended, as added methods to LightServiceServer will // result in compilation errors. type UnsafeLightServiceServer interface { mustEmbedUnimplementedLightServiceServer() } func RegisterLightServiceServer(s grpc.ServiceRegistrar, srv LightServiceServer) { // If the following call panics, it indicates UnimplementedLightServiceServer was // embedded by pointer and is nil. This will cause panics if an // unimplemented method is ever invoked, so we test this at initialization // time to prevent it from happening at runtime later due to I/O. if t, ok := srv.(interface{ testEmbeddedByValue() }); ok { t.testEmbeddedByValue() } s.RegisterService(&LightService_ServiceDesc, srv) } func _LightService_TurnOn_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { in := new(TurnOnRequest) if err := dec(in); err != nil { return nil, err } if interceptor == nil { return srv.(LightServiceServer).TurnOn(ctx, in) } info := &grpc.UnaryServerInfo{ Server: srv, FullMethod: LightService_TurnOn_FullMethodName, } handler := func(ctx context.Context, req interface{}) (interface{}, error) { return srv.(LightServiceServer).TurnOn(ctx, req.(*TurnOnRequest)) } return interceptor(ctx, in, info, handler) } func _LightService_TurnOff_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { in := new(TurnOffRequest) if err := dec(in); err != nil { return nil, err } if interceptor == nil { return srv.(LightServiceServer).TurnOff(ctx, in) } info := &grpc.UnaryServerInfo{ Server: srv, FullMethod: LightService_TurnOff_FullMethodName, } handler := func(ctx context.Context, req interface{}) (interface{}, error) { return srv.(LightServiceServer).TurnOff(ctx, req.(*TurnOffRequest)) } return interceptor(ctx, in, info, handler) } func _LightService_Toggle_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { in := new(ToggleRequest) if err := dec(in); err != nil { return nil, err } if interceptor == nil { return srv.(LightServiceServer).Toggle(ctx, in) } info := &grpc.UnaryServerInfo{ Server: srv, FullMethod: LightService_Toggle_FullMethodName, } handler := func(ctx context.Context, req interface{}) (interface{}, error) { return srv.(LightServiceServer).Toggle(ctx, req.(*ToggleRequest)) } return interceptor(ctx, in, info, handler) } // LightService_ServiceDesc is the grpc.ServiceDesc for LightService service. // It's only intended for direct use with grpc.RegisterService, // and not to be introspected or modified (even as a copy) var LightService_ServiceDesc = grpc.ServiceDesc{ ServiceName: "ha.v1.LightService", HandlerType: (*LightServiceServer)(nil), Methods: []grpc.MethodDesc{ { MethodName: "TurnOn", Handler: _LightService_TurnOn_Handler, }, { MethodName: "TurnOff", Handler: _LightService_TurnOff_Handler, }, { MethodName: "Toggle", Handler: _LightService_Toggle_Handler, }, }, Streams: []grpc.StreamDesc{}, Metadata: "ha/v1/light.proto", }