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 }
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
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 [(cue.opt).disable_openapi_validation = true]; repeated RecursiveType repeated_recursive_field = 2 [(cue.opt).disable_openapi_validation = true]; }
The unstructured fields of `MyCRDSpec` would be returned as: - ["MyCRDSpec", "options", "recursiveField"] - ["MyCRDSpec", "options", "repeatedRecursiveField"]
Click to show internal directories.
Click to hide internal directories.