generator

package
v0.0.0-...-c770b07 Latest Latest
Warning

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

Go to latest
Published: Aug 4, 2019 License: Apache-2.0 Imports: 21 Imported by: 0

Documentation

Overview

descriptor_renderer generates a FileDescriptorSet from a gnostic output file.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func RunProtoGenerator

func RunProtoGenerator()

This is the main function for the code generation plugin.

Types

type GrpcChecker

type GrpcChecker struct {
	// contains filtered or unexported fields
}

func NewGrpcChecker

func NewGrpcChecker(document *openapiv3.Document) *GrpcChecker

Creates a new checker.

func (*GrpcChecker) Run

func (c *GrpcChecker) Run() []*plugins.Message

Runs the checker. It is a top-down approach.

type LineWriter

type LineWriter struct {
	bytes.Buffer
}

func NewLineWriter

func NewLineWriter() *LineWriter

func (*LineWriter) WriteLine

func (w *LineWriter) WriteLine(line string)

type Renderer

type Renderer struct {
	// The model holds the necessary information from the OpenAPI description.
	Model *surface.Model
	// The FileDescriptorSet that will be printed with protoreflect
	FdSet          *dpb.FileDescriptorSet
	SymbolicFdSets []*dpb.FileDescriptorSet
	Package        string // package name
}

Renderer generates a .proto file based on the information inside Model.

func NewRenderer

func NewRenderer(model *surface.Model) (renderer *Renderer)

NewRenderer creates a renderer.

func (*Renderer) Render

func (renderer *Renderer) Render(response *plugins.Response, fileName string) (err error)

Generate runs the renderer to generate the named files.

func (*Renderer) RenderDescriptor

func (renderer *Renderer) RenderDescriptor() (*plugins.File, error)

func (*Renderer) RenderProto

func (renderer *Renderer) RenderProto(fdSet *dpb.FileDescriptorSet, fileName string) (*plugins.File, error)

Jump to

Keyboard shortcuts

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