Documentation ¶
Overview ¶
Package v1 is a reverse proxy.
It translates gRPC into RESTful JSON APIs.
Index ¶
- Variables
- func RegisterServoServiceHandler(ctx context.Context, mux *runtime.ServeMux, conn *grpc.ClientConn) error
- func RegisterServoServiceHandlerClient(ctx context.Context, mux *runtime.ServeMux, client ServoServiceClient) error
- func RegisterServoServiceHandlerFromEndpoint(ctx context.Context, mux *runtime.ServeMux, endpoint string, ...) (err error)
- func RegisterServoServiceHandlerServer(ctx context.Context, mux *runtime.ServeMux, server ServoServiceServer) error
- func RegisterServoServiceServer(s grpc.ServiceRegistrar, srv ServoServiceServer)
- type GetPositionRequest
- func (*GetPositionRequest) Descriptor() ([]byte, []int)deprecated
- func (x *GetPositionRequest) GetExtra() *structpb.Struct
- func (x *GetPositionRequest) GetName() string
- func (*GetPositionRequest) ProtoMessage()
- func (x *GetPositionRequest) ProtoReflect() protoreflect.Message
- func (x *GetPositionRequest) Reset()
- func (x *GetPositionRequest) String() string
- type GetPositionResponse
- func (*GetPositionResponse) Descriptor() ([]byte, []int)deprecated
- func (x *GetPositionResponse) GetPositionDeg() uint32
- func (*GetPositionResponse) ProtoMessage()
- func (x *GetPositionResponse) ProtoReflect() protoreflect.Message
- func (x *GetPositionResponse) Reset()
- func (x *GetPositionResponse) String() string
- type IsMovingRequest
- type IsMovingResponse
- type MoveRequest
- func (*MoveRequest) Descriptor() ([]byte, []int)deprecated
- func (x *MoveRequest) GetAngleDeg() uint32
- func (x *MoveRequest) GetExtra() *structpb.Struct
- func (x *MoveRequest) GetName() string
- func (*MoveRequest) ProtoMessage()
- func (x *MoveRequest) ProtoReflect() protoreflect.Message
- func (x *MoveRequest) Reset()
- func (x *MoveRequest) String() string
- type MoveResponse
- type ServoServiceClient
- type ServoServiceServer
- type Status
- type StopRequest
- func (*StopRequest) Descriptor() ([]byte, []int)deprecated
- func (x *StopRequest) GetExtra() *structpb.Struct
- func (x *StopRequest) GetName() string
- func (*StopRequest) ProtoMessage()
- func (x *StopRequest) ProtoReflect() protoreflect.Message
- func (x *StopRequest) Reset()
- func (x *StopRequest) String() string
- type StopResponse
- type UnimplementedServoServiceServer
- func (UnimplementedServoServiceServer) DoCommand(context.Context, *v1.DoCommandRequest) (*v1.DoCommandResponse, error)
- func (UnimplementedServoServiceServer) GetGeometries(context.Context, *v1.GetGeometriesRequest) (*v1.GetGeometriesResponse, error)
- func (UnimplementedServoServiceServer) GetPosition(context.Context, *GetPositionRequest) (*GetPositionResponse, error)
- func (UnimplementedServoServiceServer) IsMoving(context.Context, *IsMovingRequest) (*IsMovingResponse, error)
- func (UnimplementedServoServiceServer) Move(context.Context, *MoveRequest) (*MoveResponse, error)
- func (UnimplementedServoServiceServer) Stop(context.Context, *StopRequest) (*StopResponse, error)
- type UnsafeServoServiceServer
Constants ¶
This section is empty.
Variables ¶
var File_component_servo_v1_servo_proto protoreflect.FileDescriptor
var ServoService_ServiceDesc = grpc.ServiceDesc{ ServiceName: "viam.component.servo.v1.ServoService", HandlerType: (*ServoServiceServer)(nil), Methods: []grpc.MethodDesc{ { MethodName: "Move", Handler: _ServoService_Move_Handler, }, { MethodName: "GetPosition", Handler: _ServoService_GetPosition_Handler, }, { MethodName: "Stop", Handler: _ServoService_Stop_Handler, }, { MethodName: "IsMoving", Handler: _ServoService_IsMoving_Handler, }, { MethodName: "DoCommand", Handler: _ServoService_DoCommand_Handler, }, { MethodName: "GetGeometries", Handler: _ServoService_GetGeometries_Handler, }, }, Streams: []grpc.StreamDesc{}, Metadata: "component/servo/v1/servo.proto", }
ServoService_ServiceDesc is the grpc.ServiceDesc for ServoService service. It's only intended for direct use with grpc.RegisterService, and not to be introspected or modified (even as a copy)
Functions ¶
func RegisterServoServiceHandler ¶
func RegisterServoServiceHandler(ctx context.Context, mux *runtime.ServeMux, conn *grpc.ClientConn) error
RegisterServoServiceHandler registers the http handlers for service ServoService to "mux". The handlers forward requests to the grpc endpoint over "conn".
func RegisterServoServiceHandlerClient ¶
func RegisterServoServiceHandlerClient(ctx context.Context, mux *runtime.ServeMux, client ServoServiceClient) error
RegisterServoServiceHandlerClient registers the http handlers for service ServoService to "mux". The handlers forward requests to the grpc endpoint over the given implementation of "ServoServiceClient". Note: the gRPC framework executes interceptors within the gRPC handler. If the passed in "ServoServiceClient" doesn't go through the normal gRPC flow (creating a gRPC client etc.) then it will be up to the passed in "ServoServiceClient" to call the correct interceptors.
func RegisterServoServiceHandlerFromEndpoint ¶
func RegisterServoServiceHandlerFromEndpoint(ctx context.Context, mux *runtime.ServeMux, endpoint string, opts []grpc.DialOption) (err error)
RegisterServoServiceHandlerFromEndpoint is same as RegisterServoServiceHandler but automatically dials to "endpoint" and closes the connection when "ctx" gets done.
func RegisterServoServiceHandlerServer ¶
func RegisterServoServiceHandlerServer(ctx context.Context, mux *runtime.ServeMux, server ServoServiceServer) error
RegisterServoServiceHandlerServer registers the http handlers for service ServoService to "mux". UnaryRPC :call ServoServiceServer 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 RegisterServoServiceHandlerFromEndpoint instead.
func RegisterServoServiceServer ¶
func RegisterServoServiceServer(s grpc.ServiceRegistrar, srv ServoServiceServer)
Types ¶
type GetPositionRequest ¶
type GetPositionRequest struct { // the name of the servo, as registered 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 (*GetPositionRequest) Descriptor
deprecated
func (*GetPositionRequest) Descriptor() ([]byte, []int)
Deprecated: Use GetPositionRequest.ProtoReflect.Descriptor instead.
func (*GetPositionRequest) GetExtra ¶ added in v0.1.6
func (x *GetPositionRequest) GetExtra() *structpb.Struct
func (*GetPositionRequest) GetName ¶
func (x *GetPositionRequest) GetName() string
func (*GetPositionRequest) ProtoMessage ¶
func (*GetPositionRequest) ProtoMessage()
func (*GetPositionRequest) ProtoReflect ¶
func (x *GetPositionRequest) ProtoReflect() protoreflect.Message
func (*GetPositionRequest) Reset ¶
func (x *GetPositionRequest) Reset()
func (*GetPositionRequest) String ¶
func (x *GetPositionRequest) String() string
type GetPositionResponse ¶
type GetPositionResponse struct { // the degrees from neutral by which the servo is currently rotated. PositionDeg uint32 `protobuf:"varint,1,opt,name=position_deg,json=positionDeg,proto3" json:"position_deg,omitempty"` // contains filtered or unexported fields }
func (*GetPositionResponse) Descriptor
deprecated
func (*GetPositionResponse) Descriptor() ([]byte, []int)
Deprecated: Use GetPositionResponse.ProtoReflect.Descriptor instead.
func (*GetPositionResponse) GetPositionDeg ¶
func (x *GetPositionResponse) GetPositionDeg() uint32
func (*GetPositionResponse) ProtoMessage ¶
func (*GetPositionResponse) ProtoMessage()
func (*GetPositionResponse) ProtoReflect ¶
func (x *GetPositionResponse) ProtoReflect() protoreflect.Message
func (*GetPositionResponse) Reset ¶
func (x *GetPositionResponse) Reset()
func (*GetPositionResponse) String ¶
func (x *GetPositionResponse) String() string
type IsMovingRequest ¶ added in v0.1.24
type IsMovingRequest struct { Name string `protobuf:"bytes,1,opt,name=name,proto3" json:"name,omitempty"` // contains filtered or unexported fields }
func (*IsMovingRequest) Descriptor
deprecated
added in
v0.1.24
func (*IsMovingRequest) Descriptor() ([]byte, []int)
Deprecated: Use IsMovingRequest.ProtoReflect.Descriptor instead.
func (*IsMovingRequest) GetName ¶ added in v0.1.24
func (x *IsMovingRequest) GetName() string
func (*IsMovingRequest) ProtoMessage ¶ added in v0.1.24
func (*IsMovingRequest) ProtoMessage()
func (*IsMovingRequest) ProtoReflect ¶ added in v0.1.24
func (x *IsMovingRequest) ProtoReflect() protoreflect.Message
func (*IsMovingRequest) Reset ¶ added in v0.1.24
func (x *IsMovingRequest) Reset()
func (*IsMovingRequest) String ¶ added in v0.1.24
func (x *IsMovingRequest) String() string
type IsMovingResponse ¶ added in v0.1.24
type IsMovingResponse struct { IsMoving bool `protobuf:"varint,1,opt,name=is_moving,json=isMoving,proto3" json:"is_moving,omitempty"` // contains filtered or unexported fields }
func (*IsMovingResponse) Descriptor
deprecated
added in
v0.1.24
func (*IsMovingResponse) Descriptor() ([]byte, []int)
Deprecated: Use IsMovingResponse.ProtoReflect.Descriptor instead.
func (*IsMovingResponse) GetIsMoving ¶ added in v0.1.24
func (x *IsMovingResponse) GetIsMoving() bool
func (*IsMovingResponse) ProtoMessage ¶ added in v0.1.24
func (*IsMovingResponse) ProtoMessage()
func (*IsMovingResponse) ProtoReflect ¶ added in v0.1.24
func (x *IsMovingResponse) ProtoReflect() protoreflect.Message
func (*IsMovingResponse) Reset ¶ added in v0.1.24
func (x *IsMovingResponse) Reset()
func (*IsMovingResponse) String ¶ added in v0.1.24
func (x *IsMovingResponse) String() string
type MoveRequest ¶
type MoveRequest struct { // the name of the servo, as registered Name string `protobuf:"bytes,1,opt,name=name,proto3" json:"name,omitempty"` // the degrees by which to rotate the servo. AngleDeg uint32 `protobuf:"varint,2,opt,name=angle_deg,json=angleDeg,proto3" json:"angle_deg,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 (*MoveRequest) Descriptor
deprecated
func (*MoveRequest) Descriptor() ([]byte, []int)
Deprecated: Use MoveRequest.ProtoReflect.Descriptor instead.
func (*MoveRequest) GetAngleDeg ¶
func (x *MoveRequest) GetAngleDeg() uint32
func (*MoveRequest) GetExtra ¶ added in v0.1.6
func (x *MoveRequest) GetExtra() *structpb.Struct
func (*MoveRequest) GetName ¶
func (x *MoveRequest) GetName() string
func (*MoveRequest) ProtoMessage ¶
func (*MoveRequest) ProtoMessage()
func (*MoveRequest) ProtoReflect ¶
func (x *MoveRequest) ProtoReflect() protoreflect.Message
func (*MoveRequest) Reset ¶
func (x *MoveRequest) Reset()
func (*MoveRequest) String ¶
func (x *MoveRequest) String() string
type MoveResponse ¶
type MoveResponse struct {
// contains filtered or unexported fields
}
func (*MoveResponse) Descriptor
deprecated
func (*MoveResponse) Descriptor() ([]byte, []int)
Deprecated: Use MoveResponse.ProtoReflect.Descriptor instead.
func (*MoveResponse) ProtoMessage ¶
func (*MoveResponse) ProtoMessage()
func (*MoveResponse) ProtoReflect ¶
func (x *MoveResponse) ProtoReflect() protoreflect.Message
func (*MoveResponse) Reset ¶
func (x *MoveResponse) Reset()
func (*MoveResponse) String ¶
func (x *MoveResponse) String() string
type ServoServiceClient ¶
type ServoServiceClient interface { // Move requests the servo of the underlying robot to move. // This will block until done or a new operation cancels this one Move(ctx context.Context, in *MoveRequest, opts ...grpc.CallOption) (*MoveResponse, error) // GetPosition returns the current set angle (degrees) of the servo of the underlying robot. GetPosition(ctx context.Context, in *GetPositionRequest, opts ...grpc.CallOption) (*GetPositionResponse, error) // Stop stops a robot's servo Stop(ctx context.Context, in *StopRequest, opts ...grpc.CallOption) (*StopResponse, error) // IsMoving reports if a component is in motion IsMoving(ctx context.Context, in *IsMovingRequest, opts ...grpc.CallOption) (*IsMovingResponse, 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) }
ServoServiceClient is the client API for ServoService 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.
func NewServoServiceClient ¶
func NewServoServiceClient(cc grpc.ClientConnInterface) ServoServiceClient
type ServoServiceServer ¶
type ServoServiceServer interface { // Move requests the servo of the underlying robot to move. // This will block until done or a new operation cancels this one Move(context.Context, *MoveRequest) (*MoveResponse, error) // GetPosition returns the current set angle (degrees) of the servo of the underlying robot. GetPosition(context.Context, *GetPositionRequest) (*GetPositionResponse, error) // Stop stops a robot's servo Stop(context.Context, *StopRequest) (*StopResponse, error) // IsMoving reports if a component is in motion IsMoving(context.Context, *IsMovingRequest) (*IsMovingResponse, 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 }
ServoServiceServer is the server API for ServoService service. All implementations must embed UnimplementedServoServiceServer for forward compatibility
type Status ¶
type Status struct { PositionDeg uint32 `protobuf:"varint,1,opt,name=position_deg,json=positionDeg,proto3" json:"position_deg,omitempty"` IsMoving bool `protobuf:"varint,2,opt,name=is_moving,json=isMoving,proto3" json:"is_moving,omitempty"` // contains filtered or unexported fields }
func (*Status) Descriptor
deprecated
func (*Status) GetIsMoving ¶
func (*Status) GetPositionDeg ¶
func (*Status) ProtoMessage ¶
func (*Status) ProtoMessage()
func (*Status) ProtoReflect ¶
func (x *Status) ProtoReflect() protoreflect.Message
type StopRequest ¶
type StopRequest struct { // Name of a servo 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 (*StopRequest) Descriptor
deprecated
func (*StopRequest) Descriptor() ([]byte, []int)
Deprecated: Use StopRequest.ProtoReflect.Descriptor instead.
func (*StopRequest) GetExtra ¶ added in v0.1.6
func (x *StopRequest) GetExtra() *structpb.Struct
func (*StopRequest) GetName ¶
func (x *StopRequest) GetName() string
func (*StopRequest) ProtoMessage ¶
func (*StopRequest) ProtoMessage()
func (*StopRequest) ProtoReflect ¶
func (x *StopRequest) ProtoReflect() protoreflect.Message
func (*StopRequest) Reset ¶
func (x *StopRequest) Reset()
func (*StopRequest) String ¶
func (x *StopRequest) String() string
type StopResponse ¶
type StopResponse struct {
// contains filtered or unexported fields
}
func (*StopResponse) Descriptor
deprecated
func (*StopResponse) Descriptor() ([]byte, []int)
Deprecated: Use StopResponse.ProtoReflect.Descriptor instead.
func (*StopResponse) ProtoMessage ¶
func (*StopResponse) ProtoMessage()
func (*StopResponse) ProtoReflect ¶
func (x *StopResponse) ProtoReflect() protoreflect.Message
func (*StopResponse) Reset ¶
func (x *StopResponse) Reset()
func (*StopResponse) String ¶
func (x *StopResponse) String() string
type UnimplementedServoServiceServer ¶
type UnimplementedServoServiceServer struct { }
UnimplementedServoServiceServer must be embedded to have forward compatible implementations.
func (UnimplementedServoServiceServer) DoCommand ¶ added in v0.1.79
func (UnimplementedServoServiceServer) DoCommand(context.Context, *v1.DoCommandRequest) (*v1.DoCommandResponse, error)
func (UnimplementedServoServiceServer) GetGeometries ¶ added in v0.1.129
func (UnimplementedServoServiceServer) GetGeometries(context.Context, *v1.GetGeometriesRequest) (*v1.GetGeometriesResponse, error)
func (UnimplementedServoServiceServer) GetPosition ¶
func (UnimplementedServoServiceServer) GetPosition(context.Context, *GetPositionRequest) (*GetPositionResponse, error)
func (UnimplementedServoServiceServer) IsMoving ¶ added in v0.1.24
func (UnimplementedServoServiceServer) IsMoving(context.Context, *IsMovingRequest) (*IsMovingResponse, error)
func (UnimplementedServoServiceServer) Move ¶
func (UnimplementedServoServiceServer) Move(context.Context, *MoveRequest) (*MoveResponse, error)
func (UnimplementedServoServiceServer) Stop ¶
func (UnimplementedServoServiceServer) Stop(context.Context, *StopRequest) (*StopResponse, error)
type UnsafeServoServiceServer ¶
type UnsafeServoServiceServer interface {
// contains filtered or unexported methods
}
UnsafeServoServiceServer may be embedded to opt out of forward compatibility for this service. Use of this interface is not recommended, as added methods to ServoServiceServer will result in compilation errors.