proto2struct

package
v0.1.0 Latest Latest
Warning

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

Go to latest
Published: Dec 15, 2023 License: Apache-2.0 Imports: 3 Imported by: 0

Documentation

Overview

Package proto2struct contains code to convert protocol buffers to Mangle structs.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ProtoEnumToConstant

func ProtoEnumToConstant(ed protoreflect.EnumDescriptor, val protoreflect.Value) (ast.Constant, error)

ProtoEnumToConstant uses reflection to convert a proto field value to a Mangle value.

func ProtoToStruct

func ProtoToStruct(msg protoreflect.Message) (ast.Constant, error)

ProtoToStruct uses reflection to convert a proto to a Mangle struct. The resulting struct only contains that are considered populated by the go protobuf runtime, i.e. proto fields set to default values will be missing.

func ProtoValueToConstant

func ProtoValueToConstant(fd protoreflect.FieldDescriptor, val protoreflect.Value) (ast.Constant, error)

ProtoValueToConstant uses reflection to convert a proto field value to a Mangle value.

Types

This section is empty.

Jump to

Keyboard shortcuts

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