Documentation ¶
Overview ¶
Package protoutils are a collection of util methods for using proto in rdk
Index ¶
- func ConvertMapToProtoAny(input map[string]interface{}) (map[string]*anypb.Any, error)
- func ConvertOrientationToProto(o spatialmath.Orientation) *commonpb.Orientation
- func ConvertProtoToOrientation(o *commonpb.Orientation) spatialmath.Orientation
- func ConvertStringMapToAnyPBMap(params map[string]string) (map[string]*anypb.Any, error)
- func ConvertStringToAnyPB(str string) (*anypb.Any, error)
- func ConvertVectorProtoToR3(v *commonpb.Vector3) r3.Vector
- func ConvertVectorR3ToProto(v r3.Vector) *commonpb.Vector3
- func DoFromResourceClient(ctx context.Context, svc ClientDoCommander, name string, ...) (map[string]interface{}, error)
- func DoFromResourceServer(ctx context.Context, res resource.Resource, req *commonpb.DoCommandRequest) (*commonpb.DoCommandResponse, error)
- func MessageToProtoV1(msg interface{}) protov1.Message
- func ReadingGoToProto(readings map[string]interface{}) (map[string]*structpb.Value, error)
- func ReadingProtoToGo(readings map[string]*structpb.Value) (map[string]interface{}, error)
- func ResourceNameFromProto(name *commonpb.ResourceName) resource.Name
- func ResourceNameToProto(name resource.Name) *commonpb.ResourceName
- type ClientDoCommander
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func ConvertMapToProtoAny ¶ added in v0.52.0
ConvertMapToProtoAny converts a map of string keys and interface{} values to a map of string keys and *anypb.Any values, where each value in the input map is converted to a protobuf Any type.
func ConvertOrientationToProto ¶ added in v0.0.6
func ConvertOrientationToProto(o spatialmath.Orientation) *commonpb.Orientation
ConvertOrientationToProto TODO.
func ConvertProtoToOrientation ¶ added in v0.0.6
func ConvertProtoToOrientation(o *commonpb.Orientation) spatialmath.Orientation
ConvertProtoToOrientation TODO.
func ConvertStringMapToAnyPBMap ¶ added in v0.1.0
ConvertStringMapToAnyPBMap takes a string map and parses each value to an Any proto type.
func ConvertStringToAnyPB ¶ added in v0.1.0
ConvertStringToAnyPB takes a string and parses it to an Any pb type.
func ConvertVectorProtoToR3 ¶ added in v0.0.6
ConvertVectorProtoToR3 TODO.
func ConvertVectorR3ToProto ¶ added in v0.0.6
ConvertVectorR3ToProto TODO.
func DoFromResourceClient ¶ added in v0.2.20
func DoFromResourceClient(ctx context.Context, svc ClientDoCommander, name string, cmd map[string]interface{}, ) (map[string]interface{}, error)
DoFromResourceClient is a helper to allow DoCommand() calls from any client.
func DoFromResourceServer ¶ added in v0.2.20
func DoFromResourceServer( ctx context.Context, res resource.Resource, req *commonpb.DoCommandRequest, ) (*commonpb.DoCommandResponse, error)
DoFromResourceServer is a helper to allow DoCommand() calls from any server.
func MessageToProtoV1 ¶ added in v0.2.5
MessageToProtoV1 converts a message to a protov1.Message. It is assumed it is either a proto.Message or a protov1.Message.
func ReadingGoToProto ¶ added in v0.0.8
ReadingGoToProto converts go readings to proto readings.
func ReadingProtoToGo ¶ added in v0.0.8
ReadingProtoToGo converts proto readings to go readings.
func ResourceNameFromProto ¶
func ResourceNameFromProto(name *commonpb.ResourceName) resource.Name
ResourceNameFromProto converts a proto ResourceName to its rdk counterpart.
func ResourceNameToProto ¶
func ResourceNameToProto(name resource.Name) *commonpb.ResourceName
ResourceNameToProto converts a resource.Name to its proto counterpart.
Types ¶
type ClientDoCommander ¶ added in v0.2.20
type ClientDoCommander interface { // DoCommand sends/receives arbitrary commands DoCommand(ctx context.Context, in *commonpb.DoCommandRequest, opts ...grpc.CallOption) (*commonpb.DoCommandResponse, error) }
ClientDoCommander is a gRPC client that allows the execution of DoCommand.