protoutils

package
v0.0.6 Latest Latest
Warning

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

Go to latest
Published: Aug 15, 2022 License: AGPL-3.0 Imports: 9 Imported by: 1

Documentation

Overview

protoutils are a collection of util methods for using proto in rdk

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ConvertOrientationToProto added in v0.0.6

func ConvertOrientationToProto(o spatialmath.Orientation) *commonpb.Orientation

ConvertOrientationToProto

func ConvertProtoToOrientation added in v0.0.6

func ConvertProtoToOrientation(o *commonpb.Orientation) spatialmath.Orientation

ConvertProtoToOrientation

func ConvertVectorProtoToR3 added in v0.0.6

func ConvertVectorProtoToR3(v *commonpb.Vector3) r3.Vector

ConvertVectorProtoToR3

func ConvertVectorR3ToProto added in v0.0.6

func ConvertVectorR3ToProto(v r3.Vector) *commonpb.Vector3

ConvertVectorR3ToProto

func InterfaceToMap

func InterfaceToMap(data interface{}) (map[string]interface{}, error)

InterfaceToMap attempts to coerce an interface into a form acceptable by structpb.NewStruct. Expects a struct or a map-like object.

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.

func StructToStructPb

func StructToStructPb(i interface{}) (*structpb.Struct, error)

StructToStructPb converts an arbitrary Go struct to a *structpb.Struct. Only exported fields are included in the returned proto.

Types

This section is empty.

Jump to

Keyboard shortcuts

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