protoutils

package
v0.1.79 Latest Latest
Warning

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

Go to latest
Published: May 21, 2024 License: Apache-2.0 Imports: 6 Imported by: 29

Documentation

Overview

Package protoutils are a collection of util methods for using proto

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

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 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.

func StructToStructPbIgnoreOmitEmpty added in v0.1.46

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

StructToStructPbIgnoreOmitEmpty converts an arbitrary Go struct to a *structpb.Struct. Only exported fields are included in the returned proto and any omitempty tag is ignored.

Types

This section is empty.

Jump to

Keyboard shortcuts

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