Documentation ¶
Index ¶
- func GetFieldExplicitDefaultValue(field *protoplugin.Field) (expr []interface{}, typingInferrable bool)
- func GetFieldIntrinsicDefaultValue(field *protoplugin.Field) (expr []interface{}, typingInferrable bool)
- func GetFieldTyping(field *protoplugin.Field) (expr []interface{}, optional bool)
- func GetUnwrappedFieldType(field *protoplugin.Field) (scalarType descriptorpb.FieldDescriptorProto_Type, ok bool)
- func MatchWktAny(message *protoplugin.Message) (bool, *wktAny)
- func MatchWktDuration(message *protoplugin.Message) (bool, *wktDuration)
- func MatchWktFieldMask(message *protoplugin.Message) (bool, *wktFieldMask)
- func MatchWktListValue(message *protoplugin.Message) (bool, *wktListValue)
- func MatchWktStruct(message *protoplugin.Message) (bool, *wktStruct)
- func MatchWktTimestamp(message *protoplugin.Message) (bool, *wktTimestamp)
- func MatchWktValue(message *protoplugin.Message) (bool, *wktValue)
- func MatchWktWrapper(message *protoplugin.Message) (bool, *wktWrapper)
- func ScalarTypeScriptType(scalarType descriptorpb.FieldDescriptorProto_Type) string
- func UnescapeBytesDefaultValue(str string) ([]byte, error)
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 ¶
UnescapeBytesDefaultValue parses a text-encoded default value (proto2) of a BYTES field.
Types ¶
This section is empty.