proto

package
v0.48.0 Latest Latest
Warning

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

Go to latest
Published: Sep 10, 2024 License: Apache-2.0 Imports: 15 Imported by: 1

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func CompileProtos

func CompileProtos(goModule, moduleName, protoDir string, protocOptions collector.ProtocOptions, customGoArgs []string) ([]*collector.DescriptorWithPath, error)

make sure the pkg matches the go_package option in the proto TODO: validate this

Types

type FieldOptions added in v0.17.21

type FieldOptions struct {
	Field *descriptor.FieldDescriptorProto

	OpenAPIValidationDisabled bool

	JsonFieldNameOverride string
}

options for a field

type FileOptions added in v0.17.21

type FileOptions struct {
	File     *collector.DescriptorWithPath
	Messages []MessageOptions
}

a representation of set of parsed options for a given File's descriptor

type MessageOptions added in v0.17.21

type MessageOptions struct {
	Message        *descriptor.DescriptorProto
	Fields         []FieldOptions
	NestedMessages []MessageOptions
}

options for a message

type Options added in v0.17.21

type Options []FileOptions

a representation of set of parsed options for a given File's descriptor

func ParseOptions added in v0.17.21

func ParseOptions(fileDescriptors []*collector.DescriptorWithPath) (Options, error)

func (Options) GetUnstructuredFields added in v0.17.21

func (o Options) GetUnstructuredFields(protoPkg string, rootMessage string) ([][]string, error)
GetUnstructuredFields gets the full list of unstructured fields contained within a given message. This function returns each field as an array of path elements, which is the fully expanded index of the field as measured from the root message. For example, given a message with the given structure:

// root level message

message MyCRDSpec {
    Options options = 1;
}

message Options {
    UnstructuredType unstructured_option = 1;
}

message RecursiveType {
    RecursiveType recursive_field = 1 [(solo.io.cue.opt).disable_openapi_validation = true];
    repeated RecursiveType repeated_recursive_field = 2 [(solo.io.cue.opt).disable_openapi_validation = true];
}

The unstructured fields of `MyCRDSpec` would be returned as: - ["MyCRDSpec", "options", "recursiveField"] - ["MyCRDSpec", "options", "repeatedRecursiveField"]

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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