Documentation ¶
Index ¶
- Variables
- type Configuration
- type OpenAPIv3Generator
- func (g *OpenAPIv3Generator) AddPathsToDocumentV3(file *protogen.File, service *protogen.Service)
- func (g *OpenAPIv3Generator) BuildDocumentV3() *v3.Document
- func (g *OpenAPIv3Generator) BuildPaths(file *protogen.File, service *protogen.Service, method *protogen.Method) ([]string, *v3.Paths, []string)
- func (g *OpenAPIv3Generator) FindAndFormatFieldName(name string, inMessage *protogen.Message) string
- func (g *OpenAPIv3Generator) FindBodyParameters(bodyField string, inputMessage *protogen.Message) (*v3.RequestBodyOrReference, error)
- func (g *OpenAPIv3Generator) FindNamedPathParameters(path string, inputMessage *protogen.Message) (string, *PathParameters)
- func (g *OpenAPIv3Generator) FindSimplePathParameters(path string, inputMessage *protogen.Message) (string, []*PathParameters)
- func (g *OpenAPIv3Generator) FullMessageTypeName(message protoreflect.MessageDescriptor) string
- func (g *OpenAPIv3Generator) ParseHttpRule(rule *annotations.HttpRule) (string, string, string)
- func (g *OpenAPIv3Generator) Run(outputFile *protogen.GeneratedFile) error
- type OpenAPIv3Reflector
- type PathParameters
Constants ¶
This section is empty.
Variables ¶
View Source
var GlobalOpenAPIv3Generator = NewOpenAPIv3Generator(nil, Configuration{}, nil)
Functions ¶
This section is empty.
Types ¶
type Configuration ¶
type OpenAPIv3Generator ¶
type OpenAPIv3Generator struct {
// contains filtered or unexported fields
}
OpenAPIv3Generator holds internal state needed to generate an OpenAPIv3 document for a transcoded Protocol Buffer service.
func NewOpenAPIv3Generator ¶
func NewOpenAPIv3Generator(plugin *protogen.Plugin, conf Configuration, inputFiles []*protogen.File) *OpenAPIv3Generator
NewOpenAPIv3Generator creates a new generator for a protoc plugin invocation.
func (*OpenAPIv3Generator) AddPathsToDocumentV3 ¶
func (g *OpenAPIv3Generator) AddPathsToDocumentV3(file *protogen.File, service *protogen.Service)
func (*OpenAPIv3Generator) BuildDocumentV3 ¶
func (g *OpenAPIv3Generator) BuildDocumentV3() *v3.Document
func (*OpenAPIv3Generator) BuildPaths ¶
func (*OpenAPIv3Generator) FindAndFormatFieldName ¶
func (g *OpenAPIv3Generator) FindAndFormatFieldName(name string, inMessage *protogen.Message) string
func (*OpenAPIv3Generator) FindBodyParameters ¶
func (g *OpenAPIv3Generator) FindBodyParameters(bodyField string, inputMessage *protogen.Message) (*v3.RequestBodyOrReference, error)
func (*OpenAPIv3Generator) FindNamedPathParameters ¶
func (g *OpenAPIv3Generator) FindNamedPathParameters(path string, inputMessage *protogen.Message) (string, *PathParameters)
FindNamedPathParameters Find named path parameters like {name=shelves/*}
func (*OpenAPIv3Generator) FindSimplePathParameters ¶
func (g *OpenAPIv3Generator) FindSimplePathParameters(path string, inputMessage *protogen.Message) (string, []*PathParameters)
FindSimplePathParameters Find simple path parameters like {id}
func (*OpenAPIv3Generator) FullMessageTypeName ¶
func (g *OpenAPIv3Generator) FullMessageTypeName(message protoreflect.MessageDescriptor) string
func (*OpenAPIv3Generator) ParseHttpRule ¶
func (g *OpenAPIv3Generator) ParseHttpRule(rule *annotations.HttpRule) (string, string, string)
func (*OpenAPIv3Generator) Run ¶
func (g *OpenAPIv3Generator) Run(outputFile *protogen.GeneratedFile) error
Run runs the generator.
type OpenAPIv3Reflector ¶
type OpenAPIv3Reflector struct {
// contains filtered or unexported fields
}
func NewOpenAPIv3Reflector ¶
func NewOpenAPIv3Reflector(conf Configuration) *OpenAPIv3Reflector
NewOpenAPIv3Reflector creates a new reflector.
type PathParameters ¶
type PathParameters struct { ParameterOrReference *v3.ParameterOrReference ParameterOrReferences []*v3.ParameterOrReference // Name book.name Name string // Parameters shelf,book Parameters []string // Template shelves/%s/books/%s Template string // json or proto Naming string }
Click to show internal directories.
Click to hide internal directories.