gencommon

package
v0.0.8 Latest Latest
Warning

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

Go to latest
Published: Jul 12, 2022 License: Apache-2.0 Imports: 8 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func GetFieldExplicitDefaultValue

func GetFieldExplicitDefaultValue(field *protoplugin.Field) (expr []interface{}, typingInferrable bool)

GetFieldExplicitDefaultValue returns an expression for the default value specified via `[ default = 123 ]`, and a bool that indicates whether the TypeScript type of the value can be trivially inferred from the value. If the field has no explicit default value, the expression is nil.

func GetFieldIntrinsicDefaultValue

func GetFieldIntrinsicDefaultValue(field *protoplugin.Field) (expr []interface{}, typingInferrable bool)

GetFieldIntrinsicDefaultValue returns an expression for the intrinsic default value for a field, and a bool that indicates whether the TypeScript type of the value can be trivially inferred from the value. If the field has no intrinsic default value, the expression is nil.

func GetFieldTyping

func GetFieldTyping(field *protoplugin.Field) (expr []interface{}, optional bool)

GetFieldTyping returns an expression for the TypeScript typing of a field, and whether the property should be optional.

func GetUnwrappedFieldType

func GetUnwrappedFieldType(field *protoplugin.Field) (scalarType descriptorpb.FieldDescriptorProto_Type, ok bool)

func MatchWktAny

func MatchWktAny(message *protoplugin.Message) (bool, *wktAny)

func MatchWktDuration

func MatchWktDuration(message *protoplugin.Message) (bool, *wktDuration)

func MatchWktFieldMask

func MatchWktFieldMask(message *protoplugin.Message) (bool, *wktFieldMask)

func MatchWktListValue

func MatchWktListValue(message *protoplugin.Message) (bool, *wktListValue)

func MatchWktStruct

func MatchWktStruct(message *protoplugin.Message) (bool, *wktStruct)

func MatchWktTimestamp

func MatchWktTimestamp(message *protoplugin.Message) (bool, *wktTimestamp)

func MatchWktValue

func MatchWktValue(message *protoplugin.Message) (bool, *wktValue)

func MatchWktWrapper

func MatchWktWrapper(message *protoplugin.Message) (bool, *wktWrapper)

func ScalarTypeScriptType

func ScalarTypeScriptType(scalarType descriptorpb.FieldDescriptorProto_Type) string

func UnescapeBytesDefaultValue

func UnescapeBytesDefaultValue(str string) ([]byte, error)

UnescapeBytesDefaultValue parses a text-encoded default value (proto2) of a BYTES field.

Types

This section is empty.

Jump to

Keyboard shortcuts

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