v1

package
v0.1.87 Latest Latest
Warning

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

Go to latest
Published: Mar 9, 2023 License: Apache-2.0 Imports: 18 Imported by: 5

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 CameraService_ServiceDesc = grpc.ServiceDesc{
	ServiceName: "viam.component.camera.v1.CameraService",
	HandlerType: (*CameraServiceServer)(nil),
	Methods: []grpc.MethodDesc{
		{
			MethodName: "GetImage",
			Handler:    _CameraService_GetImage_Handler,
		},
		{
			MethodName: "RenderFrame",
			Handler:    _CameraService_RenderFrame_Handler,
		},
		{
			MethodName: "GetPointCloud",
			Handler:    _CameraService_GetPointCloud_Handler,
		},
		{
			MethodName: "GetProperties",
			Handler:    _CameraService_GetProperties_Handler,
		},
		{
			MethodName: "DoCommand",
			Handler:    _CameraService_DoCommand_Handler,
		},
	},
	Streams:  []grpc.StreamDesc{},
	Metadata: "component/camera/v1/camera.proto",
}

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

View Source
var File_component_camera_v1_camera_proto protoreflect.FileDescriptor

Functions

func RegisterCameraServiceHandler

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

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

func RegisterCameraServiceHandlerClient

func RegisterCameraServiceHandlerClient(ctx context.Context, mux *runtime.ServeMux, client CameraServiceClient) error

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

func RegisterCameraServiceHandlerFromEndpoint

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

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

func RegisterCameraServiceHandlerServer

func RegisterCameraServiceHandlerServer(ctx context.Context, mux *runtime.ServeMux, server CameraServiceServer) error

RegisterCameraServiceHandlerServer registers the http handlers for service CameraService to "mux". UnaryRPC :call CameraServiceServer 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 RegisterCameraServiceHandlerFromEndpoint instead.

func RegisterCameraServiceServer

func RegisterCameraServiceServer(s grpc.ServiceRegistrar, srv CameraServiceServer)

Types

type CameraServiceClient

type CameraServiceClient interface {
	// GetImage returns a frame from a camera of the underlying robot. A specific MIME type
	// can be requested but may not necessarily be the same one returned.
	GetImage(ctx context.Context, in *GetImageRequest, opts ...grpc.CallOption) (*GetImageResponse, error)
	// RenderFrame renders a frame from a camera of the underlying robot to an HTTP response. A specific MIME type
	// can be requested but may not necessarily be the same one returned.
	RenderFrame(ctx context.Context, in *RenderFrameRequest, opts ...grpc.CallOption) (*httpbody.HttpBody, error)
	// GetPointCloud returns a point cloud from a camera of the underlying robot. A specific MIME type
	// can be requested but may not necessarily be the same one returned.
	GetPointCloud(ctx context.Context, in *GetPointCloudRequest, opts ...grpc.CallOption) (*GetPointCloudResponse, error)
	// GetProperties returns the camera intrinsic parameters and camera distortion parameters from a camera of the underlying robot, if available.
	GetProperties(ctx context.Context, in *GetPropertiesRequest, opts ...grpc.CallOption) (*GetPropertiesResponse, error)
	// DoCommand sends/receives arbitrary commands
	DoCommand(ctx context.Context, in *v1.DoCommandRequest, opts ...grpc.CallOption) (*v1.DoCommandResponse, error)
}

CameraServiceClient is the client API for CameraService 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 CameraServiceServer

type CameraServiceServer interface {
	// GetImage returns a frame from a camera of the underlying robot. A specific MIME type
	// can be requested but may not necessarily be the same one returned.
	GetImage(context.Context, *GetImageRequest) (*GetImageResponse, error)
	// RenderFrame renders a frame from a camera of the underlying robot to an HTTP response. A specific MIME type
	// can be requested but may not necessarily be the same one returned.
	RenderFrame(context.Context, *RenderFrameRequest) (*httpbody.HttpBody, error)
	// GetPointCloud returns a point cloud from a camera of the underlying robot. A specific MIME type
	// can be requested but may not necessarily be the same one returned.
	GetPointCloud(context.Context, *GetPointCloudRequest) (*GetPointCloudResponse, error)
	// GetProperties returns the camera intrinsic parameters and camera distortion parameters from a camera of the underlying robot, if available.
	GetProperties(context.Context, *GetPropertiesRequest) (*GetPropertiesResponse, error)
	// DoCommand sends/receives arbitrary commands
	DoCommand(context.Context, *v1.DoCommandRequest) (*v1.DoCommandResponse, error)
	// contains filtered or unexported methods
}

CameraServiceServer is the server API for CameraService service. All implementations must embed UnimplementedCameraServiceServer for forward compatibility

type DistortionParameters

type DistortionParameters struct {
	Model      string    `protobuf:"bytes,1,opt,name=model,proto3" json:"model,omitempty"`
	Parameters []float64 `protobuf:"fixed64,2,rep,packed,name=parameters,proto3" json:"parameters,omitempty"`
	// contains filtered or unexported fields
}

func (*DistortionParameters) Descriptor deprecated

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

Deprecated: Use DistortionParameters.ProtoReflect.Descriptor instead.

func (*DistortionParameters) GetModel

func (x *DistortionParameters) GetModel() string

func (*DistortionParameters) GetParameters

func (x *DistortionParameters) GetParameters() []float64

func (*DistortionParameters) ProtoMessage

func (*DistortionParameters) ProtoMessage()

func (*DistortionParameters) ProtoReflect

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

func (*DistortionParameters) Reset

func (x *DistortionParameters) Reset()

func (*DistortionParameters) String

func (x *DistortionParameters) String() string

type GetImageRequest

type GetImageRequest struct {

	// Name of a camera
	Name string `protobuf:"bytes,1,opt,name=name,proto3" json:"name,omitempty"`
	// Requested MIME type of response
	MimeType string `protobuf:"bytes,2,opt,name=mime_type,json=mimeType,proto3" json:"mime_type,omitempty"`
	// contains filtered or unexported fields
}

func (*GetImageRequest) Descriptor deprecated

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

Deprecated: Use GetImageRequest.ProtoReflect.Descriptor instead.

func (*GetImageRequest) GetMimeType

func (x *GetImageRequest) GetMimeType() string

func (*GetImageRequest) GetName

func (x *GetImageRequest) GetName() string

func (*GetImageRequest) ProtoMessage

func (*GetImageRequest) ProtoMessage()

func (*GetImageRequest) ProtoReflect

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

func (*GetImageRequest) Reset

func (x *GetImageRequest) Reset()

func (*GetImageRequest) String

func (x *GetImageRequest) String() string

type GetImageResponse

type GetImageResponse struct {

	// Actual MIME type of response
	MimeType string `protobuf:"bytes,1,opt,name=mime_type,json=mimeType,proto3" json:"mime_type,omitempty"`
	// Frame in bytes
	Image []byte `protobuf:"bytes,2,opt,name=image,proto3" json:"image,omitempty"`
	// contains filtered or unexported fields
}

func (*GetImageResponse) Descriptor deprecated

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

Deprecated: Use GetImageResponse.ProtoReflect.Descriptor instead.

func (*GetImageResponse) GetImage

func (x *GetImageResponse) GetImage() []byte

func (*GetImageResponse) GetMimeType

func (x *GetImageResponse) GetMimeType() string

func (*GetImageResponse) ProtoMessage

func (*GetImageResponse) ProtoMessage()

func (*GetImageResponse) ProtoReflect

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

func (*GetImageResponse) Reset

func (x *GetImageResponse) Reset()

func (*GetImageResponse) String

func (x *GetImageResponse) String() string

type GetPointCloudRequest

type GetPointCloudRequest struct {

	// Name of a camera
	Name string `protobuf:"bytes,1,opt,name=name,proto3" json:"name,omitempty"`
	// Requested MIME type of response
	MimeType string `protobuf:"bytes,2,opt,name=mime_type,json=mimeType,proto3" json:"mime_type,omitempty"`
	// contains filtered or unexported fields
}

func (*GetPointCloudRequest) Descriptor deprecated

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

Deprecated: Use GetPointCloudRequest.ProtoReflect.Descriptor instead.

func (*GetPointCloudRequest) GetMimeType

func (x *GetPointCloudRequest) GetMimeType() string

func (*GetPointCloudRequest) GetName

func (x *GetPointCloudRequest) GetName() string

func (*GetPointCloudRequest) ProtoMessage

func (*GetPointCloudRequest) ProtoMessage()

func (*GetPointCloudRequest) ProtoReflect

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

func (*GetPointCloudRequest) Reset

func (x *GetPointCloudRequest) Reset()

func (*GetPointCloudRequest) String

func (x *GetPointCloudRequest) String() string

type GetPointCloudResponse

type GetPointCloudResponse struct {

	// Actual MIME type of response
	MimeType string `protobuf:"bytes,1,opt,name=mime_type,json=mimeType,proto3" json:"mime_type,omitempty"`
	// Frame in bytes
	PointCloud []byte `protobuf:"bytes,2,opt,name=point_cloud,json=pointCloud,proto3" json:"point_cloud,omitempty"`
	// contains filtered or unexported fields
}

func (*GetPointCloudResponse) Descriptor deprecated

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

Deprecated: Use GetPointCloudResponse.ProtoReflect.Descriptor instead.

func (*GetPointCloudResponse) GetMimeType

func (x *GetPointCloudResponse) GetMimeType() string

func (*GetPointCloudResponse) GetPointCloud

func (x *GetPointCloudResponse) GetPointCloud() []byte

func (*GetPointCloudResponse) ProtoMessage

func (*GetPointCloudResponse) ProtoMessage()

func (*GetPointCloudResponse) ProtoReflect

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

func (*GetPointCloudResponse) Reset

func (x *GetPointCloudResponse) Reset()

func (*GetPointCloudResponse) String

func (x *GetPointCloudResponse) String() string

type GetPropertiesRequest

type GetPropertiesRequest struct {

	// Name of a camera
	Name string `protobuf:"bytes,1,opt,name=name,proto3" json:"name,omitempty"`
	// contains filtered or unexported fields
}

func (*GetPropertiesRequest) Descriptor deprecated

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

Deprecated: Use GetPropertiesRequest.ProtoReflect.Descriptor instead.

func (*GetPropertiesRequest) GetName

func (x *GetPropertiesRequest) GetName() string

func (*GetPropertiesRequest) ProtoMessage

func (*GetPropertiesRequest) ProtoMessage()

func (*GetPropertiesRequest) ProtoReflect

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

func (*GetPropertiesRequest) Reset

func (x *GetPropertiesRequest) Reset()

func (*GetPropertiesRequest) String

func (x *GetPropertiesRequest) String() string

type GetPropertiesResponse

type GetPropertiesResponse struct {

	// A boolean property determining whether the camera supports the return of pointcloud data
	SupportsPcd bool `protobuf:"varint,1,opt,name=supports_pcd,json=supportsPcd,proto3" json:"supports_pcd,omitempty"`
	// Parameters for doing a perspective of a 3D scene to a 2D plane
	IntrinsicParameters *IntrinsicParameters `protobuf:"bytes,2,opt,name=intrinsic_parameters,json=intrinsicParameters,proto3" json:"intrinsic_parameters,omitempty"`
	// Parameters for modeling lens distortion in cameras
	DistortionParameters *DistortionParameters `protobuf:"bytes,3,opt,name=distortion_parameters,json=distortionParameters,proto3" json:"distortion_parameters,omitempty"`
	// contains filtered or unexported fields
}

func (*GetPropertiesResponse) Descriptor deprecated

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

Deprecated: Use GetPropertiesResponse.ProtoReflect.Descriptor instead.

func (*GetPropertiesResponse) GetDistortionParameters

func (x *GetPropertiesResponse) GetDistortionParameters() *DistortionParameters

func (*GetPropertiesResponse) GetIntrinsicParameters

func (x *GetPropertiesResponse) GetIntrinsicParameters() *IntrinsicParameters

func (*GetPropertiesResponse) GetSupportsPcd

func (x *GetPropertiesResponse) GetSupportsPcd() bool

func (*GetPropertiesResponse) ProtoMessage

func (*GetPropertiesResponse) ProtoMessage()

func (*GetPropertiesResponse) ProtoReflect

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

func (*GetPropertiesResponse) Reset

func (x *GetPropertiesResponse) Reset()

func (*GetPropertiesResponse) String

func (x *GetPropertiesResponse) String() string

type IntrinsicParameters

type IntrinsicParameters struct {
	WidthPx   uint32  `protobuf:"varint,1,opt,name=width_px,json=widthPx,proto3" json:"width_px,omitempty"`
	HeightPx  uint32  `protobuf:"varint,2,opt,name=height_px,json=heightPx,proto3" json:"height_px,omitempty"`
	FocalXPx  float64 `protobuf:"fixed64,3,opt,name=focal_x_px,json=focalXPx,proto3" json:"focal_x_px,omitempty"`
	FocalYPx  float64 `protobuf:"fixed64,4,opt,name=focal_y_px,json=focalYPx,proto3" json:"focal_y_px,omitempty"`
	CenterXPx float64 `protobuf:"fixed64,5,opt,name=center_x_px,json=centerXPx,proto3" json:"center_x_px,omitempty"`
	CenterYPx float64 `protobuf:"fixed64,6,opt,name=center_y_px,json=centerYPx,proto3" json:"center_y_px,omitempty"`
	// contains filtered or unexported fields
}

func (*IntrinsicParameters) Descriptor deprecated

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

Deprecated: Use IntrinsicParameters.ProtoReflect.Descriptor instead.

func (*IntrinsicParameters) GetCenterXPx

func (x *IntrinsicParameters) GetCenterXPx() float64

func (*IntrinsicParameters) GetCenterYPx

func (x *IntrinsicParameters) GetCenterYPx() float64

func (*IntrinsicParameters) GetFocalXPx

func (x *IntrinsicParameters) GetFocalXPx() float64

func (*IntrinsicParameters) GetFocalYPx

func (x *IntrinsicParameters) GetFocalYPx() float64

func (*IntrinsicParameters) GetHeightPx

func (x *IntrinsicParameters) GetHeightPx() uint32

func (*IntrinsicParameters) GetWidthPx

func (x *IntrinsicParameters) GetWidthPx() uint32

func (*IntrinsicParameters) ProtoMessage

func (*IntrinsicParameters) ProtoMessage()

func (*IntrinsicParameters) ProtoReflect

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

func (*IntrinsicParameters) Reset

func (x *IntrinsicParameters) Reset()

func (*IntrinsicParameters) String

func (x *IntrinsicParameters) String() string

type Property

type Property struct {

	// Video resolution width in px
	WidthPx int32 `protobuf:"varint,1,opt,name=width_px,json=widthPx,proto3" json:"width_px,omitempty"`
	// Video resolution height in px
	HeightPx int32 `protobuf:"varint,2,opt,name=height_px,json=heightPx,proto3" json:"height_px,omitempty"`
	// Video frame format
	FrameFormat string `protobuf:"bytes,3,opt,name=frame_format,json=frameFormat,proto3" json:"frame_format,omitempty"`
	// contains filtered or unexported fields
}

func (*Property) Descriptor deprecated

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

Deprecated: Use Property.ProtoReflect.Descriptor instead.

func (*Property) GetFrameFormat

func (x *Property) GetFrameFormat() string

func (*Property) GetHeightPx added in v0.1.1

func (x *Property) GetHeightPx() int32

func (*Property) GetWidthPx added in v0.1.1

func (x *Property) GetWidthPx() int32

func (*Property) ProtoMessage

func (*Property) ProtoMessage()

func (*Property) ProtoReflect

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

func (*Property) Reset

func (x *Property) Reset()

func (*Property) String

func (x *Property) String() string

type RenderFrameRequest

type RenderFrameRequest struct {

	// Name of a camera
	Name string `protobuf:"bytes,1,opt,name=name,proto3" json:"name,omitempty"`
	// Requested MIME type of response
	MimeType string `protobuf:"bytes,2,opt,name=mime_type,json=mimeType,proto3" json:"mime_type,omitempty"`
	// contains filtered or unexported fields
}

func (*RenderFrameRequest) Descriptor deprecated

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

Deprecated: Use RenderFrameRequest.ProtoReflect.Descriptor instead.

func (*RenderFrameRequest) GetMimeType

func (x *RenderFrameRequest) GetMimeType() string

func (*RenderFrameRequest) GetName

func (x *RenderFrameRequest) GetName() string

func (*RenderFrameRequest) ProtoMessage

func (*RenderFrameRequest) ProtoMessage()

func (*RenderFrameRequest) ProtoReflect

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

func (*RenderFrameRequest) Reset

func (x *RenderFrameRequest) Reset()

func (*RenderFrameRequest) String

func (x *RenderFrameRequest) String() string

type UnimplementedCameraServiceServer

type UnimplementedCameraServiceServer struct {
}

UnimplementedCameraServiceServer must be embedded to have forward compatible implementations.

func (UnimplementedCameraServiceServer) DoCommand added in v0.1.79

func (UnimplementedCameraServiceServer) GetImage

func (UnimplementedCameraServiceServer) GetPointCloud

func (UnimplementedCameraServiceServer) GetProperties

func (UnimplementedCameraServiceServer) RenderFrame

type UnsafeCameraServiceServer

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

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

type Webcam

type Webcam struct {

	// Camera driver label
	Label string `protobuf:"bytes,1,opt,name=label,proto3" json:"label,omitempty"`
	// Camera driver status
	Status string `protobuf:"bytes,2,opt,name=status,proto3" json:"status,omitempty"`
	// Camera properties
	Properties []*Property `protobuf:"bytes,3,rep,name=properties,proto3" json:"properties,omitempty"`
	// contains filtered or unexported fields
}

func (*Webcam) Descriptor deprecated

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

Deprecated: Use Webcam.ProtoReflect.Descriptor instead.

func (*Webcam) GetLabel

func (x *Webcam) GetLabel() string

func (*Webcam) GetProperties

func (x *Webcam) GetProperties() []*Property

func (*Webcam) GetStatus

func (x *Webcam) GetStatus() string

func (*Webcam) ProtoMessage

func (*Webcam) ProtoMessage()

func (*Webcam) ProtoReflect

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

func (*Webcam) Reset

func (x *Webcam) Reset()

func (*Webcam) String

func (x *Webcam) String() string

type Webcams

type Webcams struct {
	Webcams []*Webcam `protobuf:"bytes,1,rep,name=webcams,proto3" json:"webcams,omitempty"`
	// contains filtered or unexported fields
}

func (*Webcams) Descriptor deprecated

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

Deprecated: Use Webcams.ProtoReflect.Descriptor instead.

func (*Webcams) GetWebcams

func (x *Webcams) GetWebcams() []*Webcam

func (*Webcams) ProtoMessage

func (*Webcams) ProtoMessage()

func (*Webcams) ProtoReflect

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

func (*Webcams) Reset

func (x *Webcams) Reset()

func (*Webcams) String

func (x *Webcams) String() string

Jump to

Keyboard shortcuts

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