Documentation ¶
Overview ¶
Package v1 is a reverse proxy.
It translates gRPC into RESTful JSON APIs.
Index ¶
- Variables
- func RegisterEncoderServiceHandler(ctx context.Context, mux *runtime.ServeMux, conn *grpc.ClientConn) error
- func RegisterEncoderServiceHandlerClient(ctx context.Context, mux *runtime.ServeMux, client EncoderServiceClient) error
- func RegisterEncoderServiceHandlerFromEndpoint(ctx context.Context, mux *runtime.ServeMux, endpoint string, ...) (err error)
- func RegisterEncoderServiceHandlerServer(ctx context.Context, mux *runtime.ServeMux, server EncoderServiceServer) error
- func RegisterEncoderServiceServer(s grpc.ServiceRegistrar, srv EncoderServiceServer)
- type EncoderServiceClient
- type EncoderServiceServer
- type GetPositionRequest
- func (*GetPositionRequest) Descriptor() ([]byte, []int)deprecated
- func (x *GetPositionRequest) GetExtra() *structpb.Struct
- func (x *GetPositionRequest) GetName() string
- func (x *GetPositionRequest) GetPositionType() PositionType
- 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) GetPositionType() PositionType
- func (x *GetPositionResponse) GetValue() float32
- func (*GetPositionResponse) ProtoMessage()
- func (x *GetPositionResponse) ProtoReflect() protoreflect.Message
- func (x *GetPositionResponse) Reset()
- func (x *GetPositionResponse) String() string
- type GetPropertiesRequest
- func (*GetPropertiesRequest) Descriptor() ([]byte, []int)deprecated
- func (x *GetPropertiesRequest) GetExtra() *structpb.Struct
- func (x *GetPropertiesRequest) GetName() string
- func (*GetPropertiesRequest) ProtoMessage()
- func (x *GetPropertiesRequest) ProtoReflect() protoreflect.Message
- func (x *GetPropertiesRequest) Reset()
- func (x *GetPropertiesRequest) String() string
- type GetPropertiesResponse
- func (*GetPropertiesResponse) Descriptor() ([]byte, []int)deprecated
- func (x *GetPropertiesResponse) GetAngleDegreesSupported() bool
- func (x *GetPropertiesResponse) GetTicksCountSupported() bool
- func (*GetPropertiesResponse) ProtoMessage()
- func (x *GetPropertiesResponse) ProtoReflect() protoreflect.Message
- func (x *GetPropertiesResponse) Reset()
- func (x *GetPropertiesResponse) String() string
- type PositionType
- func (PositionType) Descriptor() protoreflect.EnumDescriptor
- func (x PositionType) Enum() *PositionType
- func (PositionType) EnumDescriptor() ([]byte, []int)deprecated
- func (x PositionType) Number() protoreflect.EnumNumber
- func (x PositionType) String() string
- func (PositionType) Type() protoreflect.EnumType
- type ResetPositionRequest
- func (*ResetPositionRequest) Descriptor() ([]byte, []int)deprecated
- func (x *ResetPositionRequest) GetExtra() *structpb.Struct
- func (x *ResetPositionRequest) GetName() string
- func (*ResetPositionRequest) ProtoMessage()
- func (x *ResetPositionRequest) ProtoReflect() protoreflect.Message
- func (x *ResetPositionRequest) Reset()
- func (x *ResetPositionRequest) String() string
- type ResetPositionResponse
- type UnimplementedEncoderServiceServer
- func (UnimplementedEncoderServiceServer) DoCommand(context.Context, *v1.DoCommandRequest) (*v1.DoCommandResponse, error)
- func (UnimplementedEncoderServiceServer) GetGeometries(context.Context, *v1.GetGeometriesRequest) (*v1.GetGeometriesResponse, error)
- func (UnimplementedEncoderServiceServer) GetPosition(context.Context, *GetPositionRequest) (*GetPositionResponse, error)
- func (UnimplementedEncoderServiceServer) GetProperties(context.Context, *GetPropertiesRequest) (*GetPropertiesResponse, error)
- func (UnimplementedEncoderServiceServer) ResetPosition(context.Context, *ResetPositionRequest) (*ResetPositionResponse, error)
- type UnsafeEncoderServiceServer
Constants ¶
This section is empty.
Variables ¶
var ( PositionType_name = map[int32]string{ 0: "POSITION_TYPE_UNSPECIFIED", 1: "POSITION_TYPE_TICKS_COUNT", 2: "POSITION_TYPE_ANGLE_DEGREES", } PositionType_value = map[string]int32{ "POSITION_TYPE_UNSPECIFIED": 0, "POSITION_TYPE_TICKS_COUNT": 1, "POSITION_TYPE_ANGLE_DEGREES": 2, } )
Enum value maps for PositionType.
var EncoderService_ServiceDesc = grpc.ServiceDesc{ ServiceName: "viam.component.encoder.v1.EncoderService", HandlerType: (*EncoderServiceServer)(nil), Methods: []grpc.MethodDesc{ { MethodName: "GetPosition", Handler: _EncoderService_GetPosition_Handler, }, { MethodName: "ResetPosition", Handler: _EncoderService_ResetPosition_Handler, }, { MethodName: "GetProperties", Handler: _EncoderService_GetProperties_Handler, }, { MethodName: "DoCommand", Handler: _EncoderService_DoCommand_Handler, }, { MethodName: "GetGeometries", Handler: _EncoderService_GetGeometries_Handler, }, }, Streams: []grpc.StreamDesc{}, Metadata: "component/encoder/v1/encoder.proto", }
EncoderService_ServiceDesc is the grpc.ServiceDesc for EncoderService service. It's only intended for direct use with grpc.RegisterService, and not to be introspected or modified (even as a copy)
var File_component_encoder_v1_encoder_proto protoreflect.FileDescriptor
Functions ¶
func RegisterEncoderServiceHandler ¶
func RegisterEncoderServiceHandler(ctx context.Context, mux *runtime.ServeMux, conn *grpc.ClientConn) error
RegisterEncoderServiceHandler registers the http handlers for service EncoderService to "mux". The handlers forward requests to the grpc endpoint over "conn".
func RegisterEncoderServiceHandlerClient ¶
func RegisterEncoderServiceHandlerClient(ctx context.Context, mux *runtime.ServeMux, client EncoderServiceClient) error
RegisterEncoderServiceHandlerClient registers the http handlers for service EncoderService to "mux". The handlers forward requests to the grpc endpoint over the given implementation of "EncoderServiceClient". Note: the gRPC framework executes interceptors within the gRPC handler. If the passed in "EncoderServiceClient" doesn't go through the normal gRPC flow (creating a gRPC client etc.) then it will be up to the passed in "EncoderServiceClient" to call the correct interceptors.
func RegisterEncoderServiceHandlerFromEndpoint ¶
func RegisterEncoderServiceHandlerFromEndpoint(ctx context.Context, mux *runtime.ServeMux, endpoint string, opts []grpc.DialOption) (err error)
RegisterEncoderServiceHandlerFromEndpoint is same as RegisterEncoderServiceHandler but automatically dials to "endpoint" and closes the connection when "ctx" gets done.
func RegisterEncoderServiceHandlerServer ¶
func RegisterEncoderServiceHandlerServer(ctx context.Context, mux *runtime.ServeMux, server EncoderServiceServer) error
RegisterEncoderServiceHandlerServer registers the http handlers for service EncoderService to "mux". UnaryRPC :call EncoderServiceServer 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 RegisterEncoderServiceHandlerFromEndpoint instead.
func RegisterEncoderServiceServer ¶
func RegisterEncoderServiceServer(s grpc.ServiceRegistrar, srv EncoderServiceServer)
Types ¶
type EncoderServiceClient ¶
type EncoderServiceClient interface { // Returns position of the encoder which can either be ticks since last // zeroing for an incremental encoder or degrees for an absolute encoder. GetPosition(ctx context.Context, in *GetPositionRequest, opts ...grpc.CallOption) (*GetPositionResponse, error) ResetPosition(ctx context.Context, in *ResetPositionRequest, opts ...grpc.CallOption) (*ResetPositionResponse, error) // Returns a list of all the methods that are // supported by a given robot. GetProperties(ctx context.Context, in *GetPropertiesRequest, opts ...grpc.CallOption) (*GetPropertiesResponse, error) 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) }
EncoderServiceClient is the client API for EncoderService 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 NewEncoderServiceClient ¶
func NewEncoderServiceClient(cc grpc.ClientConnInterface) EncoderServiceClient
type EncoderServiceServer ¶
type EncoderServiceServer interface { // Returns position of the encoder which can either be ticks since last // zeroing for an incremental encoder or degrees for an absolute encoder. GetPosition(context.Context, *GetPositionRequest) (*GetPositionResponse, error) ResetPosition(context.Context, *ResetPositionRequest) (*ResetPositionResponse, error) // Returns a list of all the methods that are // supported by a given robot. GetProperties(context.Context, *GetPropertiesRequest) (*GetPropertiesResponse, error) 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 }
EncoderServiceServer is the server API for EncoderService service. All implementations must embed UnimplementedEncoderServiceServer for forward compatibility
type GetPositionRequest ¶
type GetPositionRequest struct { // Name of encoder Name string `protobuf:"bytes,1,opt,name=name,proto3" json:"name,omitempty"` // If supplied, the response will return the specified // position type. If the driver does not implement // the requested type, this call will return an error. // If position type is not specified, the response // will return a default according to the driver. PositionType *PositionType `` /* 148-byte string literal not displayed */ // 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 ¶
func (x *GetPositionRequest) GetExtra() *structpb.Struct
func (*GetPositionRequest) GetName ¶
func (x *GetPositionRequest) GetName() string
func (*GetPositionRequest) GetPositionType ¶
func (x *GetPositionRequest) GetPositionType() PositionType
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 { Value float32 `protobuf:"fixed32,1,opt,name=value,proto3" json:"value,omitempty"` PositionType PositionType `` /* 142-byte string literal not displayed */ // contains filtered or unexported fields }
func (*GetPositionResponse) Descriptor
deprecated
func (*GetPositionResponse) Descriptor() ([]byte, []int)
Deprecated: Use GetPositionResponse.ProtoReflect.Descriptor instead.
func (*GetPositionResponse) GetPositionType ¶
func (x *GetPositionResponse) GetPositionType() PositionType
func (*GetPositionResponse) GetValue ¶
func (x *GetPositionResponse) GetValue() float32
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 GetPropertiesRequest ¶
type GetPropertiesRequest struct { // Name of the encoder 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 (*GetPropertiesRequest) Descriptor
deprecated
func (*GetPropertiesRequest) Descriptor() ([]byte, []int)
Deprecated: Use GetPropertiesRequest.ProtoReflect.Descriptor instead.
func (*GetPropertiesRequest) GetExtra ¶
func (x *GetPropertiesRequest) GetExtra() *structpb.Struct
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 { TicksCountSupported bool `protobuf:"varint,1,opt,name=ticks_count_supported,json=ticksCountSupported,proto3" json:"ticks_count_supported,omitempty"` AngleDegreesSupported bool `` /* 127-byte string literal not displayed */ // contains filtered or unexported fields }
func (*GetPropertiesResponse) Descriptor
deprecated
func (*GetPropertiesResponse) Descriptor() ([]byte, []int)
Deprecated: Use GetPropertiesResponse.ProtoReflect.Descriptor instead.
func (*GetPropertiesResponse) GetAngleDegreesSupported ¶
func (x *GetPropertiesResponse) GetAngleDegreesSupported() bool
func (*GetPropertiesResponse) GetTicksCountSupported ¶
func (x *GetPropertiesResponse) GetTicksCountSupported() 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 PositionType ¶
type PositionType int32
const ( PositionType_POSITION_TYPE_UNSPECIFIED PositionType = 0 // Return type for relative encoders that report // how far they've gone from a start position PositionType_POSITION_TYPE_TICKS_COUNT PositionType = 1 // Return type for absolute encoders that report // their position in degrees along the radial axis PositionType_POSITION_TYPE_ANGLE_DEGREES PositionType = 2 )
func (PositionType) Descriptor ¶
func (PositionType) Descriptor() protoreflect.EnumDescriptor
func (PositionType) Enum ¶
func (x PositionType) Enum() *PositionType
func (PositionType) EnumDescriptor
deprecated
func (PositionType) EnumDescriptor() ([]byte, []int)
Deprecated: Use PositionType.Descriptor instead.
func (PositionType) Number ¶
func (x PositionType) Number() protoreflect.EnumNumber
func (PositionType) String ¶
func (x PositionType) String() string
func (PositionType) Type ¶
func (PositionType) Type() protoreflect.EnumType
type ResetPositionRequest ¶
type ResetPositionRequest struct { // Name of an encoder 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 (*ResetPositionRequest) Descriptor
deprecated
func (*ResetPositionRequest) Descriptor() ([]byte, []int)
Deprecated: Use ResetPositionRequest.ProtoReflect.Descriptor instead.
func (*ResetPositionRequest) GetExtra ¶
func (x *ResetPositionRequest) GetExtra() *structpb.Struct
func (*ResetPositionRequest) GetName ¶
func (x *ResetPositionRequest) GetName() string
func (*ResetPositionRequest) ProtoMessage ¶
func (*ResetPositionRequest) ProtoMessage()
func (*ResetPositionRequest) ProtoReflect ¶
func (x *ResetPositionRequest) ProtoReflect() protoreflect.Message
func (*ResetPositionRequest) Reset ¶
func (x *ResetPositionRequest) Reset()
func (*ResetPositionRequest) String ¶
func (x *ResetPositionRequest) String() string
type ResetPositionResponse ¶
type ResetPositionResponse struct {
// contains filtered or unexported fields
}
func (*ResetPositionResponse) Descriptor
deprecated
func (*ResetPositionResponse) Descriptor() ([]byte, []int)
Deprecated: Use ResetPositionResponse.ProtoReflect.Descriptor instead.
func (*ResetPositionResponse) ProtoMessage ¶
func (*ResetPositionResponse) ProtoMessage()
func (*ResetPositionResponse) ProtoReflect ¶
func (x *ResetPositionResponse) ProtoReflect() protoreflect.Message
func (*ResetPositionResponse) Reset ¶
func (x *ResetPositionResponse) Reset()
func (*ResetPositionResponse) String ¶
func (x *ResetPositionResponse) String() string
type UnimplementedEncoderServiceServer ¶
type UnimplementedEncoderServiceServer struct { }
UnimplementedEncoderServiceServer must be embedded to have forward compatible implementations.
func (UnimplementedEncoderServiceServer) DoCommand ¶
func (UnimplementedEncoderServiceServer) DoCommand(context.Context, *v1.DoCommandRequest) (*v1.DoCommandResponse, error)
func (UnimplementedEncoderServiceServer) GetGeometries ¶ added in v0.1.129
func (UnimplementedEncoderServiceServer) GetGeometries(context.Context, *v1.GetGeometriesRequest) (*v1.GetGeometriesResponse, error)
func (UnimplementedEncoderServiceServer) GetPosition ¶
func (UnimplementedEncoderServiceServer) GetPosition(context.Context, *GetPositionRequest) (*GetPositionResponse, error)
func (UnimplementedEncoderServiceServer) GetProperties ¶
func (UnimplementedEncoderServiceServer) GetProperties(context.Context, *GetPropertiesRequest) (*GetPropertiesResponse, error)
func (UnimplementedEncoderServiceServer) ResetPosition ¶
func (UnimplementedEncoderServiceServer) ResetPosition(context.Context, *ResetPositionRequest) (*ResetPositionResponse, error)
type UnsafeEncoderServiceServer ¶
type UnsafeEncoderServiceServer interface {
// contains filtered or unexported methods
}
UnsafeEncoderServiceServer may be embedded to opt out of forward compatibility for this service. Use of this interface is not recommended, as added methods to EncoderServiceServer will result in compilation errors.