Documentation ¶
Overview ¶
Package v1 is a reverse proxy.
It translates gRPC into RESTful JSON APIs.
Index ¶
- Variables
- func RegisterSensorsServiceHandler(ctx context.Context, mux *runtime.ServeMux, conn *grpc.ClientConn) error
- func RegisterSensorsServiceHandlerClient(ctx context.Context, mux *runtime.ServeMux, client SensorsServiceClient) error
- func RegisterSensorsServiceHandlerFromEndpoint(ctx context.Context, mux *runtime.ServeMux, endpoint string, ...) (err error)
- func RegisterSensorsServiceHandlerServer(ctx context.Context, mux *runtime.ServeMux, server SensorsServiceServer) error
- func RegisterSensorsServiceServer(s grpc.ServiceRegistrar, srv SensorsServiceServer)
- type GetReadingsRequest
- func (*GetReadingsRequest) Descriptor() ([]byte, []int)deprecated
- func (x *GetReadingsRequest) GetSensorNames() []*v1.ResourceName
- func (*GetReadingsRequest) ProtoMessage()
- func (x *GetReadingsRequest) ProtoReflect() protoreflect.Message
- func (x *GetReadingsRequest) Reset()
- func (x *GetReadingsRequest) String() string
- type GetReadingsResponse
- func (*GetReadingsResponse) Descriptor() ([]byte, []int)deprecated
- func (x *GetReadingsResponse) GetReadings() []*Readings
- func (*GetReadingsResponse) ProtoMessage()
- func (x *GetReadingsResponse) ProtoReflect() protoreflect.Message
- func (x *GetReadingsResponse) Reset()
- func (x *GetReadingsResponse) String() string
- type GetSensorsRequest
- type GetSensorsResponse
- func (*GetSensorsResponse) Descriptor() ([]byte, []int)deprecated
- func (x *GetSensorsResponse) GetSensorNames() []*v1.ResourceName
- func (*GetSensorsResponse) ProtoMessage()
- func (x *GetSensorsResponse) ProtoReflect() protoreflect.Message
- func (x *GetSensorsResponse) Reset()
- func (x *GetSensorsResponse) String() string
- type Readings
- func (*Readings) Descriptor() ([]byte, []int)deprecated
- func (x *Readings) GetName() *v1.ResourceName
- func (x *Readings) GetReadings() []*structpb.Value
- func (*Readings) ProtoMessage()
- func (x *Readings) ProtoReflect() protoreflect.Message
- func (x *Readings) Reset()
- func (x *Readings) String() string
- type SensorsServiceClient
- type SensorsServiceServer
- type UnimplementedSensorsServiceServer
- type UnsafeSensorsServiceServer
Constants ¶
This section is empty.
Variables ¶
var File_proto_api_service_sensors_v1_sensors_proto protoreflect.FileDescriptor
var SensorsService_ServiceDesc = grpc.ServiceDesc{ ServiceName: "proto.api.service.sensors.v1.SensorsService", HandlerType: (*SensorsServiceServer)(nil), Methods: []grpc.MethodDesc{ { MethodName: "GetSensors", Handler: _SensorsService_GetSensors_Handler, }, { MethodName: "GetReadings", Handler: _SensorsService_GetReadings_Handler, }, }, Streams: []grpc.StreamDesc{}, Metadata: "proto/api/service/sensors/v1/sensors.proto", }
SensorsService_ServiceDesc is the grpc.ServiceDesc for SensorsService service. It's only intended for direct use with grpc.RegisterService, and not to be introspected or modified (even as a copy)
Functions ¶
func RegisterSensorsServiceHandler ¶
func RegisterSensorsServiceHandler(ctx context.Context, mux *runtime.ServeMux, conn *grpc.ClientConn) error
RegisterSensorsServiceHandler registers the http handlers for service SensorsService to "mux". The handlers forward requests to the grpc endpoint over "conn".
func RegisterSensorsServiceHandlerClient ¶
func RegisterSensorsServiceHandlerClient(ctx context.Context, mux *runtime.ServeMux, client SensorsServiceClient) error
RegisterSensorsServiceHandlerClient registers the http handlers for service SensorsService to "mux". The handlers forward requests to the grpc endpoint over the given implementation of "SensorsServiceClient". Note: the gRPC framework executes interceptors within the gRPC handler. If the passed in "SensorsServiceClient" doesn't go through the normal gRPC flow (creating a gRPC client etc.) then it will be up to the passed in "SensorsServiceClient" to call the correct interceptors.
func RegisterSensorsServiceHandlerFromEndpoint ¶
func RegisterSensorsServiceHandlerFromEndpoint(ctx context.Context, mux *runtime.ServeMux, endpoint string, opts []grpc.DialOption) (err error)
RegisterSensorsServiceHandlerFromEndpoint is same as RegisterSensorsServiceHandler but automatically dials to "endpoint" and closes the connection when "ctx" gets done.
func RegisterSensorsServiceHandlerServer ¶
func RegisterSensorsServiceHandlerServer(ctx context.Context, mux *runtime.ServeMux, server SensorsServiceServer) error
RegisterSensorsServiceHandlerServer registers the http handlers for service SensorsService to "mux". UnaryRPC :call SensorsServiceServer directly. StreamingRPC :currently unsupported pending https://github.com/grpc/grpc-go/issues/906. Note that using this registration option will cause many gRPC library features to stop working. Consider using RegisterSensorsServiceHandlerFromEndpoint instead.
func RegisterSensorsServiceServer ¶
func RegisterSensorsServiceServer(s grpc.ServiceRegistrar, srv SensorsServiceServer)
Types ¶
type GetReadingsRequest ¶
type GetReadingsRequest struct { SensorNames []*v1.ResourceName `protobuf:"bytes,1,rep,name=sensor_names,json=sensorNames,proto3" json:"sensor_names,omitempty"` // contains filtered or unexported fields }
func (*GetReadingsRequest) Descriptor
deprecated
func (*GetReadingsRequest) Descriptor() ([]byte, []int)
Deprecated: Use GetReadingsRequest.ProtoReflect.Descriptor instead.
func (*GetReadingsRequest) GetSensorNames ¶
func (x *GetReadingsRequest) GetSensorNames() []*v1.ResourceName
func (*GetReadingsRequest) ProtoMessage ¶
func (*GetReadingsRequest) ProtoMessage()
func (*GetReadingsRequest) ProtoReflect ¶
func (x *GetReadingsRequest) ProtoReflect() protoreflect.Message
func (*GetReadingsRequest) Reset ¶
func (x *GetReadingsRequest) Reset()
func (*GetReadingsRequest) String ¶
func (x *GetReadingsRequest) String() string
type GetReadingsResponse ¶
type GetReadingsResponse struct { Readings []*Readings `protobuf:"bytes,1,rep,name=readings,proto3" json:"readings,omitempty"` // contains filtered or unexported fields }
func (*GetReadingsResponse) Descriptor
deprecated
func (*GetReadingsResponse) Descriptor() ([]byte, []int)
Deprecated: Use GetReadingsResponse.ProtoReflect.Descriptor instead.
func (*GetReadingsResponse) GetReadings ¶
func (x *GetReadingsResponse) GetReadings() []*Readings
func (*GetReadingsResponse) ProtoMessage ¶
func (*GetReadingsResponse) ProtoMessage()
func (*GetReadingsResponse) ProtoReflect ¶
func (x *GetReadingsResponse) ProtoReflect() protoreflect.Message
func (*GetReadingsResponse) Reset ¶
func (x *GetReadingsResponse) Reset()
func (*GetReadingsResponse) String ¶
func (x *GetReadingsResponse) String() string
type GetSensorsRequest ¶
type GetSensorsRequest struct {
// contains filtered or unexported fields
}
func (*GetSensorsRequest) Descriptor
deprecated
func (*GetSensorsRequest) Descriptor() ([]byte, []int)
Deprecated: Use GetSensorsRequest.ProtoReflect.Descriptor instead.
func (*GetSensorsRequest) ProtoMessage ¶
func (*GetSensorsRequest) ProtoMessage()
func (*GetSensorsRequest) ProtoReflect ¶
func (x *GetSensorsRequest) ProtoReflect() protoreflect.Message
func (*GetSensorsRequest) Reset ¶
func (x *GetSensorsRequest) Reset()
func (*GetSensorsRequest) String ¶
func (x *GetSensorsRequest) String() string
type GetSensorsResponse ¶
type GetSensorsResponse struct { SensorNames []*v1.ResourceName `protobuf:"bytes,1,rep,name=sensor_names,json=sensorNames,proto3" json:"sensor_names,omitempty"` // contains filtered or unexported fields }
func (*GetSensorsResponse) Descriptor
deprecated
func (*GetSensorsResponse) Descriptor() ([]byte, []int)
Deprecated: Use GetSensorsResponse.ProtoReflect.Descriptor instead.
func (*GetSensorsResponse) GetSensorNames ¶
func (x *GetSensorsResponse) GetSensorNames() []*v1.ResourceName
func (*GetSensorsResponse) ProtoMessage ¶
func (*GetSensorsResponse) ProtoMessage()
func (*GetSensorsResponse) ProtoReflect ¶
func (x *GetSensorsResponse) ProtoReflect() protoreflect.Message
func (*GetSensorsResponse) Reset ¶
func (x *GetSensorsResponse) Reset()
func (*GetSensorsResponse) String ¶
func (x *GetSensorsResponse) String() string
type Readings ¶
type Readings struct { Name *v1.ResourceName `protobuf:"bytes,1,opt,name=name,proto3" json:"name,omitempty"` Readings []*structpb.Value `protobuf:"bytes,2,rep,name=readings,proto3" json:"readings,omitempty"` // contains filtered or unexported fields }
func (*Readings) Descriptor
deprecated
func (*Readings) GetName ¶
func (x *Readings) GetName() *v1.ResourceName
func (*Readings) GetReadings ¶
func (*Readings) ProtoMessage ¶
func (*Readings) ProtoMessage()
func (*Readings) ProtoReflect ¶
func (x *Readings) ProtoReflect() protoreflect.Message
type SensorsServiceClient ¶
type SensorsServiceClient interface { // GetSensors returns the list of all sensors. GetSensors(ctx context.Context, in *GetSensorsRequest, opts ...grpc.CallOption) (*GetSensorsResponse, error) // GetReadings returns the list of readings for all sensors specified. GetReadings(ctx context.Context, in *GetReadingsRequest, opts ...grpc.CallOption) (*GetReadingsResponse, error) }
SensorsServiceClient is the client API for SensorsService 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.
func NewSensorsServiceClient ¶
func NewSensorsServiceClient(cc grpc.ClientConnInterface) SensorsServiceClient
type SensorsServiceServer ¶
type SensorsServiceServer interface { // GetSensors returns the list of all sensors. GetSensors(context.Context, *GetSensorsRequest) (*GetSensorsResponse, error) // GetReadings returns the list of readings for all sensors specified. GetReadings(context.Context, *GetReadingsRequest) (*GetReadingsResponse, error) // contains filtered or unexported methods }
SensorsServiceServer is the server API for SensorsService service. All implementations must embed UnimplementedSensorsServiceServer for forward compatibility
type UnimplementedSensorsServiceServer ¶
type UnimplementedSensorsServiceServer struct { }
UnimplementedSensorsServiceServer must be embedded to have forward compatible implementations.
func (UnimplementedSensorsServiceServer) GetReadings ¶
func (UnimplementedSensorsServiceServer) GetReadings(context.Context, *GetReadingsRequest) (*GetReadingsResponse, error)
func (UnimplementedSensorsServiceServer) GetSensors ¶
func (UnimplementedSensorsServiceServer) GetSensors(context.Context, *GetSensorsRequest) (*GetSensorsResponse, error)
type UnsafeSensorsServiceServer ¶
type UnsafeSensorsServiceServer interface {
// contains filtered or unexported methods
}
UnsafeSensorsServiceServer may be embedded to opt out of forward compatibility for this service. Use of this interface is not recommended, as added methods to SensorsServiceServer will result in compilation errors.