v1

package
v0.0.6 Latest Latest
Warning

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

Go to latest
Published: Aug 15, 2022 License: AGPL-3.0 Imports: 17 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_component_sensor_v1_sensor_proto protoreflect.FileDescriptor
View Source
var SensorService_ServiceDesc = grpc.ServiceDesc{
	ServiceName: "proto.api.component.sensor.v1.SensorService",
	HandlerType: (*SensorServiceServer)(nil),
	Methods: []grpc.MethodDesc{
		{
			MethodName: "GetReadings",
			Handler:    _SensorService_GetReadings_Handler,
		},
	},
	Streams:  []grpc.StreamDesc{},
	Metadata: "proto/api/component/sensor/v1/sensor.proto",
}

SensorService_ServiceDesc is the grpc.ServiceDesc for SensorService service. It's only intended for direct use with grpc.RegisterService, and not to be introspected or modified (even as a copy)

Functions

func RegisterSensorServiceHandler

func RegisterSensorServiceHandler(ctx context.Context, mux *runtime.ServeMux, conn *grpc.ClientConn) error

RegisterSensorServiceHandler registers the http handlers for service SensorService to "mux". The handlers forward requests to the grpc endpoint over "conn".

func RegisterSensorServiceHandlerClient

func RegisterSensorServiceHandlerClient(ctx context.Context, mux *runtime.ServeMux, client SensorServiceClient) error

RegisterSensorServiceHandlerClient registers the http handlers for service SensorService to "mux". The handlers forward requests to the grpc endpoint over the given implementation of "SensorServiceClient". Note: the gRPC framework executes interceptors within the gRPC handler. If the passed in "SensorServiceClient" doesn't go through the normal gRPC flow (creating a gRPC client etc.) then it will be up to the passed in "SensorServiceClient" to call the correct interceptors.

func RegisterSensorServiceHandlerFromEndpoint

func RegisterSensorServiceHandlerFromEndpoint(ctx context.Context, mux *runtime.ServeMux, endpoint string, opts []grpc.DialOption) (err error)

RegisterSensorServiceHandlerFromEndpoint is same as RegisterSensorServiceHandler but automatically dials to "endpoint" and closes the connection when "ctx" gets done.

func RegisterSensorServiceHandlerServer

func RegisterSensorServiceHandlerServer(ctx context.Context, mux *runtime.ServeMux, server SensorServiceServer) error

RegisterSensorServiceHandlerServer registers the http handlers for service SensorService to "mux". UnaryRPC :call SensorServiceServer 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 RegisterSensorServiceHandlerFromEndpoint instead.

func RegisterSensorServiceServer

func RegisterSensorServiceServer(s grpc.ServiceRegistrar, srv SensorServiceServer)

Types

type GetReadingsRequest

type GetReadingsRequest struct {
	Name string `protobuf:"bytes,1,opt,name=name,proto3" json:"name,omitempty"`
	// contains filtered or unexported fields
}

func (*GetReadingsRequest) Descriptor deprecated

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

Deprecated: Use GetReadingsRequest.ProtoReflect.Descriptor instead.

func (*GetReadingsRequest) GetName

func (x *GetReadingsRequest) GetName() string

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 []*structpb.Value `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() []*structpb.Value

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 SensorServiceClient

type SensorServiceClient interface {
	// GetReadings returns the readings of a sensor of the underlying robot.
	GetReadings(ctx context.Context, in *GetReadingsRequest, opts ...grpc.CallOption) (*GetReadingsResponse, error)
}

SensorServiceClient is the client API for SensorService 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 SensorServiceServer

type SensorServiceServer interface {
	// GetReadings returns the readings of a sensor of the underlying robot.
	GetReadings(context.Context, *GetReadingsRequest) (*GetReadingsResponse, error)
	// contains filtered or unexported methods
}

SensorServiceServer is the server API for SensorService service. All implementations must embed UnimplementedSensorServiceServer for forward compatibility

type UnimplementedSensorServiceServer

type UnimplementedSensorServiceServer struct {
}

UnimplementedSensorServiceServer must be embedded to have forward compatible implementations.

func (UnimplementedSensorServiceServer) GetReadings

type UnsafeSensorServiceServer

type UnsafeSensorServiceServer interface {
	// contains filtered or unexported methods
}

UnsafeSensorServiceServer may be embedded to opt out of forward compatibility for this service. Use of this interface is not recommended, as added methods to SensorServiceServer will result in compilation errors.

Jump to

Keyboard shortcuts

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