v1

package
v0.0.9 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Sep 9, 2022 License: AGPL-3.0 Imports: 18 Imported by: 0

Documentation

Overview

Package v1 is a reverse proxy.

It translates gRPC into RESTful JSON APIs.

Index

Constants

This section is empty.

Variables

View Source
var File_proto_api_service_sensors_v1_sensors_proto protoreflect.FileDescriptor
View Source
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 {
	Name        string             `protobuf:"bytes,1,opt,name=name,proto3" json:"name,omitempty"`
	SensorNames []*v1.ResourceName `protobuf:"bytes,2,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) GetName added in v0.0.8

func (x *GetReadingsRequest) GetName() string

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 {
	Name string `protobuf:"bytes,1,opt,name=name,proto3" json:"name,omitempty"`
	// contains filtered or unexported fields
}

func (*GetSensorsRequest) Descriptor deprecated

func (*GetSensorsRequest) Descriptor() ([]byte, []int)

Deprecated: Use GetSensorsRequest.ProtoReflect.Descriptor instead.

func (*GetSensorsRequest) GetName added in v0.0.8

func (x *GetSensorsRequest) GetName() string

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 map[string]*structpb.Value `` /* 157-byte string literal not displayed */
	// contains filtered or unexported fields
}

func (*Readings) Descriptor deprecated

func (*Readings) Descriptor() ([]byte, []int)

Deprecated: Use Readings.ProtoReflect.Descriptor instead.

func (*Readings) GetName

func (x *Readings) GetName() *v1.ResourceName

func (*Readings) GetReadings

func (x *Readings) GetReadings() map[string]*structpb.Value

func (*Readings) ProtoMessage

func (*Readings) ProtoMessage()

func (*Readings) ProtoReflect

func (x *Readings) ProtoReflect() protoreflect.Message

func (*Readings) Reset

func (x *Readings) Reset()

func (*Readings) String

func (x *Readings) String() string

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.

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) GetSensors

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.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL