protodetecttypes

package
v0.1.4 Latest Latest
Warning

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

Go to latest
Published: Jan 16, 2025 License: BSD-3-Clause Imports: 3 Imported by: 0

Documentation

Overview

Package protodetecttypes identifies static types (go/types, typically obtained at build time) generated by protoc-gen-go. The protodetectreflect package is the counterpart for dynamic types (reflect, obtained at runtime).

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type MessageAPI

type MessageAPI int

MessageAPI determines which API is used for the generated message type.

const (
	// Invalid indicates the specified type is not a proto message.
	Invalid MessageAPI = iota

	// OpenAPI indicates a message generated in the open struct API,
	// where the message representation is a Go struct with exported fields.
	OpenAPI

	// HybridAPI indicates a message generated in the hybrid API,
	// where the message has properties of both OpenAPI and OpaqueAPI.
	HybridAPI

	// OpaqueAPI indicates a message generated in the opaque API,
	// where the message can only be interacted with through accessor methods.
	OpaqueAPI
)

type Type

type Type struct{ T types.Type }

Type represents a go/types.Type obtained at build time.

func (Type) IsMessage

func (t Type) IsMessage() bool

IsMessage reports whether t is a generated message.

func (Type) MessageAPI

func (t Type) MessageAPI() MessageAPI

MessageAPI determines the API of the generated message.

Jump to

Keyboard shortcuts

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