v1

package
v0.1.172 Latest Latest
Warning

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

Go to latest
Published: Aug 9, 2023 License: Apache-2.0 Imports: 18 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 GetReadingsRequest

type GetReadingsRequest struct {

	// Name of a sensor
	Name string `protobuf:"bytes,1,opt,name=name,proto3" json:"name,omitempty"`
	// Additional arguments to the method
	Extra *structpb.Struct `protobuf:"bytes,99,opt,name=extra,proto3" json:"extra,omitempty"`
	// contains filtered or unexported fields
}

func (*GetReadingsRequest) Descriptor deprecated

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

Deprecated: Use GetReadingsRequest.ProtoReflect.Descriptor instead.

func (*GetReadingsRequest) GetExtra added in v0.1.6

func (x *GetReadingsRequest) GetExtra() *structpb.Struct

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 map[string]*structpb.Value `` /* 157-byte string literal not displayed */
	// 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() map[string]*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)
	// 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, *GetReadingsRequest) (*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