v1

package
v0.1.313 Latest Latest
Warning

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

Go to latest
Published: Jun 11, 2024 License: Apache-2.0 Imports: 16 Imported by: 1

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_component_sensor_v1_sensor_proto protoreflect.FileDescriptor
View Source
var SensorService_ServiceDesc = grpc.ServiceDesc{
	ServiceName: "viam.component.sensor.v1.SensorService",
	HandlerType: (*SensorServiceServer)(nil),
	Methods: []grpc.MethodDesc{
		{
			MethodName: "GetReadings",
			Handler:    _SensorService_GetReadings_Handler,
		},
		{
			MethodName: "DoCommand",
			Handler:    _SensorService_DoCommand_Handler,
		},
		{
			MethodName: "GetGeometries",
			Handler:    _SensorService_GetGeometries_Handler,
		},
	},
	Streams:  []grpc.StreamDesc{},
	Metadata: "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 SensorServiceClient

type SensorServiceClient interface {
	// GetReadings returns the readings of a sensor of the underlying robot.
	GetReadings(ctx context.Context, in *v1.GetReadingsRequest, opts ...grpc.CallOption) (*v1.GetReadingsResponse, error)
	// DoCommand sends/receives arbitrary commands
	DoCommand(ctx context.Context, in *v1.DoCommandRequest, opts ...grpc.CallOption) (*v1.DoCommandResponse, error)
	// GetGeometries returns the geometries of the component in their current configuration
	GetGeometries(ctx context.Context, in *v1.GetGeometriesRequest, opts ...grpc.CallOption) (*v1.GetGeometriesResponse, 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, *v1.GetReadingsRequest) (*v1.GetReadingsResponse, error)
	// DoCommand sends/receives arbitrary commands
	DoCommand(context.Context, *v1.DoCommandRequest) (*v1.DoCommandResponse, error)
	// GetGeometries returns the geometries of the component in their current configuration
	GetGeometries(context.Context, *v1.GetGeometriesRequest) (*v1.GetGeometriesResponse, 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) DoCommand added in v0.1.79

func (UnimplementedSensorServiceServer) GetGeometries added in v0.1.129

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