pgkwkt

package
v0.0.0-...-b6d9d2a Latest Latest
Warning

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

Go to latest
Published: May 21, 2023 License: MIT Imports: 2 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Valid

func Valid(field *protogen.Field) bool

Valid returns true if the field is contains in this package. Notice: We also return true (Due to inability to make judgments?) if the field type is `oneof` and it is the parent of 'oneof'.

Types

type WKT

type WKT string

WKT (Well Known Type) encapsulates the Name of a Parser from the `google.protobuf` package. Most official protoc plugins special case code generation on these messages.

const (
	// Unknown indicates that the type is not a known . This value may be
	// returned erroneously mapping a Name to a Type or if a  is
	// added to the `google.protobuf` package but this library is outdated.
	Unknown WKT = "Unknown"

	Any       WKT = "google.protobuf.Any"
	Timestamp WKT = "google.protobuf.Timestamp"
	Duration  WKT = "google.protobuf.Duration"
	Empty     WKT = "google.protobuf.Empty"
	Struct    WKT = "google.protobuf.Struct"
	Value     WKT = "google.protobuf.Value"

	ListValue   WKT = "google.protobuf.ListValue"
	DoubleValue WKT = "google.protobuf.DoubleValue"
	FloatValue  WKT = "google.protobuf.FloatValue"
	Int64Value  WKT = "google.protobuf.Int64Value"
	UInt64Value WKT = "google.protobuf.UInt64Value"
	Int32Value  WKT = "google.protobuf.Int32Value"
	UInt32Value WKT = "google.protobuf.UInt32Value"
	BoolValue   WKT = "google.protobuf.BoolValue"
	StringValue WKT = "google.protobuf.StringValue"
	BytesValue  WKT = "google.protobuf.BytesValue"
)

1-to-1 mapping of the names to WellKnownTypes.

func Lookup

func Lookup(name string) WKT

Lookup returns the Type related to the provided Name. If the name is not recognized, Unknown is returned.

func (WKT) Name

func (wkt WKT) Name() string

Name converts the Type to a Name. This is a convenience method.

func (WKT) Valid

func (wkt WKT) Valid() bool

Valid returns true if the WKT is recognized by this package.

Jump to

Keyboard shortcuts

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