Documentation ¶
Overview ¶
Package v1 is a reverse proxy.
It translates gRPC into RESTful JSON APIs.
Index ¶
- Variables
- func RegisterBaseServiceHandler(ctx context.Context, mux *runtime.ServeMux, conn *grpc.ClientConn) error
- func RegisterBaseServiceHandlerClient(ctx context.Context, mux *runtime.ServeMux, client BaseServiceClient) error
- func RegisterBaseServiceHandlerFromEndpoint(ctx context.Context, mux *runtime.ServeMux, endpoint string, ...) (err error)
- func RegisterBaseServiceHandlerServer(ctx context.Context, mux *runtime.ServeMux, server BaseServiceServer) error
- func RegisterBaseServiceServer(s grpc.ServiceRegistrar, srv BaseServiceServer)
- type BaseServiceClient
- type BaseServiceServer
- type MoveStraightRequest
- func (*MoveStraightRequest) Descriptor() ([]byte, []int)deprecated
- func (x *MoveStraightRequest) GetDistanceMm() int64
- func (x *MoveStraightRequest) GetExtra() *structpb.Struct
- func (x *MoveStraightRequest) GetMmPerSec() float64
- func (x *MoveStraightRequest) GetName() string
- func (*MoveStraightRequest) ProtoMessage()
- func (x *MoveStraightRequest) ProtoReflect() protoreflect.Message
- func (x *MoveStraightRequest) Reset()
- func (x *MoveStraightRequest) String() string
- type MoveStraightResponse
- type SetPowerRequest
- func (*SetPowerRequest) Descriptor() ([]byte, []int)deprecated
- func (x *SetPowerRequest) GetAngular() *v1.Vector3
- func (x *SetPowerRequest) GetExtra() *structpb.Struct
- func (x *SetPowerRequest) GetLinear() *v1.Vector3
- func (x *SetPowerRequest) GetName() string
- func (*SetPowerRequest) ProtoMessage()
- func (x *SetPowerRequest) ProtoReflect() protoreflect.Message
- func (x *SetPowerRequest) Reset()
- func (x *SetPowerRequest) String() string
- type SetPowerResponse
- type SetVelocityRequest
- func (*SetVelocityRequest) Descriptor() ([]byte, []int)deprecated
- func (x *SetVelocityRequest) GetAngular() *v1.Vector3
- func (x *SetVelocityRequest) GetExtra() *structpb.Struct
- func (x *SetVelocityRequest) GetLinear() *v1.Vector3
- func (x *SetVelocityRequest) GetName() string
- func (*SetVelocityRequest) ProtoMessage()
- func (x *SetVelocityRequest) ProtoReflect() protoreflect.Message
- func (x *SetVelocityRequest) Reset()
- func (x *SetVelocityRequest) String() string
- type SetVelocityResponse
- type SpinRequest
- func (*SpinRequest) Descriptor() ([]byte, []int)deprecated
- func (x *SpinRequest) GetAngleDeg() float64
- func (x *SpinRequest) GetDegsPerSec() float64
- func (x *SpinRequest) GetExtra() *structpb.Struct
- func (x *SpinRequest) GetName() string
- func (*SpinRequest) ProtoMessage()
- func (x *SpinRequest) ProtoReflect() protoreflect.Message
- func (x *SpinRequest) Reset()
- func (x *SpinRequest) String() string
- type SpinResponse
- 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 UnimplementedBaseServiceServer
- func (UnimplementedBaseServiceServer) MoveStraight(context.Context, *MoveStraightRequest) (*MoveStraightResponse, error)
- func (UnimplementedBaseServiceServer) SetPower(context.Context, *SetPowerRequest) (*SetPowerResponse, error)
- func (UnimplementedBaseServiceServer) SetVelocity(context.Context, *SetVelocityRequest) (*SetVelocityResponse, error)
- func (UnimplementedBaseServiceServer) Spin(context.Context, *SpinRequest) (*SpinResponse, error)
- func (UnimplementedBaseServiceServer) Stop(context.Context, *StopRequest) (*StopResponse, error)
- type UnsafeBaseServiceServer
Constants ¶
This section is empty.
Variables ¶
var BaseService_ServiceDesc = grpc.ServiceDesc{ ServiceName: "proto.api.component.base.v1.BaseService", HandlerType: (*BaseServiceServer)(nil), Methods: []grpc.MethodDesc{ { MethodName: "MoveStraight", Handler: _BaseService_MoveStraight_Handler, }, { MethodName: "Spin", Handler: _BaseService_Spin_Handler, }, { MethodName: "SetPower", Handler: _BaseService_SetPower_Handler, }, { MethodName: "SetVelocity", Handler: _BaseService_SetVelocity_Handler, }, { MethodName: "Stop", Handler: _BaseService_Stop_Handler, }, }, Streams: []grpc.StreamDesc{}, Metadata: "proto/api/component/base/v1/base.proto", }
BaseService_ServiceDesc is the grpc.ServiceDesc for BaseService service. It's only intended for direct use with grpc.RegisterService, and not to be introspected or modified (even as a copy)
var File_proto_api_component_base_v1_base_proto protoreflect.FileDescriptor
Functions ¶
func RegisterBaseServiceHandler ¶
func RegisterBaseServiceHandler(ctx context.Context, mux *runtime.ServeMux, conn *grpc.ClientConn) error
RegisterBaseServiceHandler registers the http handlers for service BaseService to "mux". The handlers forward requests to the grpc endpoint over "conn".
func RegisterBaseServiceHandlerClient ¶
func RegisterBaseServiceHandlerClient(ctx context.Context, mux *runtime.ServeMux, client BaseServiceClient) error
RegisterBaseServiceHandlerClient registers the http handlers for service BaseService to "mux". The handlers forward requests to the grpc endpoint over the given implementation of "BaseServiceClient". Note: the gRPC framework executes interceptors within the gRPC handler. If the passed in "BaseServiceClient" doesn't go through the normal gRPC flow (creating a gRPC client etc.) then it will be up to the passed in "BaseServiceClient" to call the correct interceptors.
func RegisterBaseServiceHandlerFromEndpoint ¶
func RegisterBaseServiceHandlerFromEndpoint(ctx context.Context, mux *runtime.ServeMux, endpoint string, opts []grpc.DialOption) (err error)
RegisterBaseServiceHandlerFromEndpoint is same as RegisterBaseServiceHandler but automatically dials to "endpoint" and closes the connection when "ctx" gets done.
func RegisterBaseServiceHandlerServer ¶
func RegisterBaseServiceHandlerServer(ctx context.Context, mux *runtime.ServeMux, server BaseServiceServer) error
RegisterBaseServiceHandlerServer registers the http handlers for service BaseService to "mux". UnaryRPC :call BaseServiceServer 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 RegisterBaseServiceHandlerFromEndpoint instead.
func RegisterBaseServiceServer ¶
func RegisterBaseServiceServer(s grpc.ServiceRegistrar, srv BaseServiceServer)
Types ¶
type BaseServiceClient ¶
type BaseServiceClient interface { // MoveStraight moves a robot's base in a straight line by a given distance, expressed in millimeters // and a given speed, expressed in millimeters per second // This method blocks until completed or cancelled MoveStraight(ctx context.Context, in *MoveStraightRequest, opts ...grpc.CallOption) (*MoveStraightResponse, error) // Spin spins a robot's base by an given angle, expressed in degrees, and a given // angular speed, expressed in degrees per second // This method blocks until completed or cancelled Spin(ctx context.Context, in *SpinRequest, opts ...grpc.CallOption) (*SpinResponse, error) // SetPower sets the linear and angular power of a base // -1 -> 1 in terms of power for each direction SetPower(ctx context.Context, in *SetPowerRequest, opts ...grpc.CallOption) (*SetPowerResponse, error) // SetVelocity sets the linear and angular velocity of a base SetVelocity(ctx context.Context, in *SetVelocityRequest, opts ...grpc.CallOption) (*SetVelocityResponse, error) // Stop stops a robot's base Stop(ctx context.Context, in *StopRequest, opts ...grpc.CallOption) (*StopResponse, error) }
BaseServiceClient is the client API for BaseService 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 NewBaseServiceClient ¶
func NewBaseServiceClient(cc grpc.ClientConnInterface) BaseServiceClient
type BaseServiceServer ¶
type BaseServiceServer interface { // MoveStraight moves a robot's base in a straight line by a given distance, expressed in millimeters // and a given speed, expressed in millimeters per second // This method blocks until completed or cancelled MoveStraight(context.Context, *MoveStraightRequest) (*MoveStraightResponse, error) // Spin spins a robot's base by an given angle, expressed in degrees, and a given // angular speed, expressed in degrees per second // This method blocks until completed or cancelled Spin(context.Context, *SpinRequest) (*SpinResponse, error) // SetPower sets the linear and angular power of a base // -1 -> 1 in terms of power for each direction SetPower(context.Context, *SetPowerRequest) (*SetPowerResponse, error) // SetVelocity sets the linear and angular velocity of a base SetVelocity(context.Context, *SetVelocityRequest) (*SetVelocityResponse, error) // Stop stops a robot's base Stop(context.Context, *StopRequest) (*StopResponse, error) // contains filtered or unexported methods }
BaseServiceServer is the server API for BaseService service. All implementations must embed UnimplementedBaseServiceServer for forward compatibility
type MoveStraightRequest ¶
type MoveStraightRequest struct { // Name of a base Name string `protobuf:"bytes,1,opt,name=name,proto3" json:"name,omitempty"` // Desired travel distance in millimeters DistanceMm int64 `protobuf:"varint,2,opt,name=distance_mm,json=distanceMm,proto3" json:"distance_mm,omitempty"` // Desired travel velocity in millimeters/second MmPerSec float64 `protobuf:"fixed64,3,opt,name=mm_per_sec,json=mmPerSec,proto3" json:"mm_per_sec,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 (*MoveStraightRequest) Descriptor
deprecated
func (*MoveStraightRequest) Descriptor() ([]byte, []int)
Deprecated: Use MoveStraightRequest.ProtoReflect.Descriptor instead.
func (*MoveStraightRequest) GetDistanceMm ¶
func (x *MoveStraightRequest) GetDistanceMm() int64
func (*MoveStraightRequest) GetExtra ¶
func (x *MoveStraightRequest) GetExtra() *structpb.Struct
func (*MoveStraightRequest) GetMmPerSec ¶
func (x *MoveStraightRequest) GetMmPerSec() float64
func (*MoveStraightRequest) GetName ¶
func (x *MoveStraightRequest) GetName() string
func (*MoveStraightRequest) ProtoMessage ¶
func (*MoveStraightRequest) ProtoMessage()
func (*MoveStraightRequest) ProtoReflect ¶
func (x *MoveStraightRequest) ProtoReflect() protoreflect.Message
func (*MoveStraightRequest) Reset ¶
func (x *MoveStraightRequest) Reset()
func (*MoveStraightRequest) String ¶
func (x *MoveStraightRequest) String() string
type MoveStraightResponse ¶
type MoveStraightResponse struct {
// contains filtered or unexported fields
}
func (*MoveStraightResponse) Descriptor
deprecated
func (*MoveStraightResponse) Descriptor() ([]byte, []int)
Deprecated: Use MoveStraightResponse.ProtoReflect.Descriptor instead.
func (*MoveStraightResponse) ProtoMessage ¶
func (*MoveStraightResponse) ProtoMessage()
func (*MoveStraightResponse) ProtoReflect ¶
func (x *MoveStraightResponse) ProtoReflect() protoreflect.Message
func (*MoveStraightResponse) Reset ¶
func (x *MoveStraightResponse) Reset()
func (*MoveStraightResponse) String ¶
func (x *MoveStraightResponse) String() string
type SetPowerRequest ¶
type SetPowerRequest struct { // Name of a base Name string `protobuf:"bytes,1,opt,name=name,proto3" json:"name,omitempty"` // Desired linear power percentage as -1 -> 1 Linear *v1.Vector3 `protobuf:"bytes,2,opt,name=linear,proto3" json:"linear,omitempty"` // Desired angular power percentage % as -1 -> 1 Angular *v1.Vector3 `protobuf:"bytes,3,opt,name=angular,proto3" json:"angular,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 (*SetPowerRequest) Descriptor
deprecated
func (*SetPowerRequest) Descriptor() ([]byte, []int)
Deprecated: Use SetPowerRequest.ProtoReflect.Descriptor instead.
func (*SetPowerRequest) GetAngular ¶
func (x *SetPowerRequest) GetAngular() *v1.Vector3
func (*SetPowerRequest) GetExtra ¶
func (x *SetPowerRequest) GetExtra() *structpb.Struct
func (*SetPowerRequest) GetLinear ¶
func (x *SetPowerRequest) GetLinear() *v1.Vector3
func (*SetPowerRequest) GetName ¶
func (x *SetPowerRequest) GetName() string
func (*SetPowerRequest) ProtoMessage ¶
func (*SetPowerRequest) ProtoMessage()
func (*SetPowerRequest) ProtoReflect ¶
func (x *SetPowerRequest) ProtoReflect() protoreflect.Message
func (*SetPowerRequest) Reset ¶
func (x *SetPowerRequest) Reset()
func (*SetPowerRequest) String ¶
func (x *SetPowerRequest) String() string
type SetPowerResponse ¶
type SetPowerResponse struct {
// contains filtered or unexported fields
}
func (*SetPowerResponse) Descriptor
deprecated
func (*SetPowerResponse) Descriptor() ([]byte, []int)
Deprecated: Use SetPowerResponse.ProtoReflect.Descriptor instead.
func (*SetPowerResponse) ProtoMessage ¶
func (*SetPowerResponse) ProtoMessage()
func (*SetPowerResponse) ProtoReflect ¶
func (x *SetPowerResponse) ProtoReflect() protoreflect.Message
func (*SetPowerResponse) Reset ¶
func (x *SetPowerResponse) Reset()
func (*SetPowerResponse) String ¶
func (x *SetPowerResponse) String() string
type SetVelocityRequest ¶
type SetVelocityRequest struct { // Name of a base Name string `protobuf:"bytes,1,opt,name=name,proto3" json:"name,omitempty"` // Desired linear velocity in mm per second Linear *v1.Vector3 `protobuf:"bytes,2,opt,name=linear,proto3" json:"linear,omitempty"` // Desired angular velocity in degrees per second Angular *v1.Vector3 `protobuf:"bytes,3,opt,name=angular,proto3" json:"angular,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 (*SetVelocityRequest) Descriptor
deprecated
func (*SetVelocityRequest) Descriptor() ([]byte, []int)
Deprecated: Use SetVelocityRequest.ProtoReflect.Descriptor instead.
func (*SetVelocityRequest) GetAngular ¶
func (x *SetVelocityRequest) GetAngular() *v1.Vector3
func (*SetVelocityRequest) GetExtra ¶
func (x *SetVelocityRequest) GetExtra() *structpb.Struct
func (*SetVelocityRequest) GetLinear ¶
func (x *SetVelocityRequest) GetLinear() *v1.Vector3
func (*SetVelocityRequest) GetName ¶
func (x *SetVelocityRequest) GetName() string
func (*SetVelocityRequest) ProtoMessage ¶
func (*SetVelocityRequest) ProtoMessage()
func (*SetVelocityRequest) ProtoReflect ¶
func (x *SetVelocityRequest) ProtoReflect() protoreflect.Message
func (*SetVelocityRequest) Reset ¶
func (x *SetVelocityRequest) Reset()
func (*SetVelocityRequest) String ¶
func (x *SetVelocityRequest) String() string
type SetVelocityResponse ¶
type SetVelocityResponse struct {
// contains filtered or unexported fields
}
func (*SetVelocityResponse) Descriptor
deprecated
func (*SetVelocityResponse) Descriptor() ([]byte, []int)
Deprecated: Use SetVelocityResponse.ProtoReflect.Descriptor instead.
func (*SetVelocityResponse) ProtoMessage ¶
func (*SetVelocityResponse) ProtoMessage()
func (*SetVelocityResponse) ProtoReflect ¶
func (x *SetVelocityResponse) ProtoReflect() protoreflect.Message
func (*SetVelocityResponse) Reset ¶
func (x *SetVelocityResponse) Reset()
func (*SetVelocityResponse) String ¶
func (x *SetVelocityResponse) String() string
type SpinRequest ¶
type SpinRequest struct { // Name of a base Name string `protobuf:"bytes,1,opt,name=name,proto3" json:"name,omitempty"` // Desired angle AngleDeg float64 `protobuf:"fixed64,2,opt,name=angle_deg,json=angleDeg,proto3" json:"angle_deg,omitempty"` // Desired angular velocity DegsPerSec float64 `protobuf:"fixed64,3,opt,name=degs_per_sec,json=degsPerSec,proto3" json:"degs_per_sec,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 (*SpinRequest) Descriptor
deprecated
func (*SpinRequest) Descriptor() ([]byte, []int)
Deprecated: Use SpinRequest.ProtoReflect.Descriptor instead.
func (*SpinRequest) GetAngleDeg ¶
func (x *SpinRequest) GetAngleDeg() float64
func (*SpinRequest) GetDegsPerSec ¶
func (x *SpinRequest) GetDegsPerSec() float64
func (*SpinRequest) GetExtra ¶
func (x *SpinRequest) GetExtra() *structpb.Struct
func (*SpinRequest) GetName ¶
func (x *SpinRequest) GetName() string
func (*SpinRequest) ProtoMessage ¶
func (*SpinRequest) ProtoMessage()
func (*SpinRequest) ProtoReflect ¶
func (x *SpinRequest) ProtoReflect() protoreflect.Message
func (*SpinRequest) Reset ¶
func (x *SpinRequest) Reset()
func (*SpinRequest) String ¶
func (x *SpinRequest) String() string
type SpinResponse ¶
type SpinResponse struct {
// contains filtered or unexported fields
}
func (*SpinResponse) Descriptor
deprecated
func (*SpinResponse) Descriptor() ([]byte, []int)
Deprecated: Use SpinResponse.ProtoReflect.Descriptor instead.
func (*SpinResponse) ProtoMessage ¶
func (*SpinResponse) ProtoMessage()
func (*SpinResponse) ProtoReflect ¶
func (x *SpinResponse) ProtoReflect() protoreflect.Message
func (*SpinResponse) Reset ¶
func (x *SpinResponse) Reset()
func (*SpinResponse) String ¶
func (x *SpinResponse) String() string
type StopRequest ¶
type StopRequest struct { // Name of a base 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 ¶
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 UnimplementedBaseServiceServer ¶
type UnimplementedBaseServiceServer struct { }
UnimplementedBaseServiceServer must be embedded to have forward compatible implementations.
func (UnimplementedBaseServiceServer) MoveStraight ¶
func (UnimplementedBaseServiceServer) MoveStraight(context.Context, *MoveStraightRequest) (*MoveStraightResponse, error)
func (UnimplementedBaseServiceServer) SetPower ¶
func (UnimplementedBaseServiceServer) SetPower(context.Context, *SetPowerRequest) (*SetPowerResponse, error)
func (UnimplementedBaseServiceServer) SetVelocity ¶
func (UnimplementedBaseServiceServer) SetVelocity(context.Context, *SetVelocityRequest) (*SetVelocityResponse, error)
func (UnimplementedBaseServiceServer) Spin ¶
func (UnimplementedBaseServiceServer) Spin(context.Context, *SpinRequest) (*SpinResponse, error)
func (UnimplementedBaseServiceServer) Stop ¶
func (UnimplementedBaseServiceServer) Stop(context.Context, *StopRequest) (*StopResponse, error)
type UnsafeBaseServiceServer ¶
type UnsafeBaseServiceServer interface {
// contains filtered or unexported methods
}
UnsafeBaseServiceServer may be embedded to opt out of forward compatibility for this service. Use of this interface is not recommended, as added methods to BaseServiceServer will result in compilation errors.