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: 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_service_sensors_v1_sensors_proto protoreflect.FileDescriptor
View Source
var SensorsService_ServiceDesc = grpc.ServiceDesc{
	ServiceName: "viam.service.sensors.v1.SensorsService",
	HandlerType: (*SensorsServiceServer)(nil),
	Methods: []grpc.MethodDesc{
		{
			MethodName: "GetSensors",
			Handler:    _SensorsService_GetSensors_Handler,
		},
		{
			MethodName: "GetReadings",
			Handler:    _SensorsService_GetReadings_Handler,
		},
		{
			MethodName: "DoCommand",
			Handler:    _SensorsService_DoCommand_Handler,
		},
	},
	Streams:  []grpc.StreamDesc{},
	Metadata: "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 deprecated

type GetReadingsRequest struct {

	// Deprecated: The entire proto file service/sensors/v1/sensors.proto is marked as deprecated.
	Name string `protobuf:"bytes,1,opt,name=name,proto3" json:"name,omitempty"`
	// Deprecated: The entire proto file service/sensors/v1/sensors.proto is marked as deprecated.
	SensorNames []*v1.ResourceName `protobuf:"bytes,2,rep,name=sensor_names,json=sensorNames,proto3" json:"sensor_names,omitempty"`
	// Additional arguments to the method
	//
	// Deprecated: The entire proto file service/sensors/v1/sensors.proto is marked as deprecated.
	Extra *structpb.Struct `protobuf:"bytes,99,opt,name=extra,proto3" json:"extra,omitempty"`
	// contains filtered or unexported fields
}

Deprecated: The entire proto file service/sensors/v1/sensors.proto is marked as deprecated.

func (*GetReadingsRequest) Descriptor deprecated

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

Deprecated: Use GetReadingsRequest.ProtoReflect.Descriptor instead.

func (*GetReadingsRequest) GetExtra deprecated added in v0.1.6

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

Deprecated: The entire proto file service/sensors/v1/sensors.proto is marked as deprecated.

func (*GetReadingsRequest) GetName deprecated

func (x *GetReadingsRequest) GetName() string

Deprecated: The entire proto file service/sensors/v1/sensors.proto is marked as deprecated.

func (*GetReadingsRequest) GetSensorNames deprecated

func (x *GetReadingsRequest) GetSensorNames() []*v1.ResourceName

Deprecated: The entire proto file service/sensors/v1/sensors.proto is marked as deprecated.

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 deprecated

type GetReadingsResponse struct {

	// Deprecated: The entire proto file service/sensors/v1/sensors.proto is marked as deprecated.
	Readings []*Readings `protobuf:"bytes,1,rep,name=readings,proto3" json:"readings,omitempty"`
	// contains filtered or unexported fields
}

Deprecated: The entire proto file service/sensors/v1/sensors.proto is marked as deprecated.

func (*GetReadingsResponse) Descriptor deprecated

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

Deprecated: Use GetReadingsResponse.ProtoReflect.Descriptor instead.

func (*GetReadingsResponse) GetReadings deprecated

func (x *GetReadingsResponse) GetReadings() []*Readings

Deprecated: The entire proto file service/sensors/v1/sensors.proto is marked as deprecated.

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 deprecated

type GetSensorsRequest struct {

	// Deprecated: The entire proto file service/sensors/v1/sensors.proto is marked as deprecated.
	Name string `protobuf:"bytes,1,opt,name=name,proto3" json:"name,omitempty"`
	// Additional arguments to the method
	//
	// Deprecated: The entire proto file service/sensors/v1/sensors.proto is marked as deprecated.
	Extra *structpb.Struct `protobuf:"bytes,99,opt,name=extra,proto3" json:"extra,omitempty"`
	// contains filtered or unexported fields
}

The sensors service messages are deprecated

Deprecated: The entire proto file service/sensors/v1/sensors.proto is marked as deprecated.

func (*GetSensorsRequest) Descriptor deprecated

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

Deprecated: Use GetSensorsRequest.ProtoReflect.Descriptor instead.

func (*GetSensorsRequest) GetExtra deprecated added in v0.1.6

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

Deprecated: The entire proto file service/sensors/v1/sensors.proto is marked as deprecated.

func (*GetSensorsRequest) GetName deprecated

func (x *GetSensorsRequest) GetName() string

Deprecated: The entire proto file service/sensors/v1/sensors.proto is marked as deprecated.

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 deprecated

type GetSensorsResponse struct {

	// Deprecated: The entire proto file service/sensors/v1/sensors.proto is marked as deprecated.
	SensorNames []*v1.ResourceName `protobuf:"bytes,1,rep,name=sensor_names,json=sensorNames,proto3" json:"sensor_names,omitempty"`
	// contains filtered or unexported fields
}

Deprecated: The entire proto file service/sensors/v1/sensors.proto is marked as deprecated.

func (*GetSensorsResponse) Descriptor deprecated

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

Deprecated: Use GetSensorsResponse.ProtoReflect.Descriptor instead.

func (*GetSensorsResponse) GetSensorNames deprecated

func (x *GetSensorsResponse) GetSensorNames() []*v1.ResourceName

Deprecated: The entire proto file service/sensors/v1/sensors.proto is marked as deprecated.

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 deprecated

type Readings struct {

	// Deprecated: The entire proto file service/sensors/v1/sensors.proto is marked as deprecated.
	Name *v1.ResourceName `protobuf:"bytes,1,opt,name=name,proto3" json:"name,omitempty"`
	// Deprecated: The entire proto file service/sensors/v1/sensors.proto is marked as deprecated.
	Readings map[string]*structpb.Value `` /* 157-byte string literal not displayed */
	// contains filtered or unexported fields
}

Deprecated: The entire proto file service/sensors/v1/sensors.proto is marked as deprecated.

func (*Readings) Descriptor deprecated

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

Deprecated: Use Readings.ProtoReflect.Descriptor instead.

func (*Readings) GetName deprecated

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

Deprecated: The entire proto file service/sensors/v1/sensors.proto is marked as deprecated.

func (*Readings) GetReadings deprecated

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

Deprecated: The entire proto file service/sensors/v1/sensors.proto is marked as deprecated.

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 {
	// Deprecated: Do not use.
	// GetSensors returns the list of all sensors.
	GetSensors(ctx context.Context, in *GetSensorsRequest, opts ...grpc.CallOption) (*GetSensorsResponse, error)
	// Deprecated: Do not use.
	// GetReadings returns the list of readings for all sensors specified.
	GetReadings(ctx context.Context, in *GetReadingsRequest, opts ...grpc.CallOption) (*GetReadingsResponse, error)
	// Deprecated: Do not use.
	// DoCommand sends/receives arbitrary commands
	DoCommand(ctx context.Context, in *v1.DoCommandRequest, opts ...grpc.CallOption) (*v1.DoCommandResponse, 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 {
	// Deprecated: Do not use.
	// GetSensors returns the list of all sensors.
	GetSensors(context.Context, *GetSensorsRequest) (*GetSensorsResponse, error)
	// Deprecated: Do not use.
	// GetReadings returns the list of readings for all sensors specified.
	GetReadings(context.Context, *GetReadingsRequest) (*GetReadingsResponse, error)
	// Deprecated: Do not use.
	// DoCommand sends/receives arbitrary commands
	DoCommand(context.Context, *v1.DoCommandRequest) (*v1.DoCommandResponse, 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) DoCommand added in v0.1.80

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