generator

package
v0.0.0-...-82351ea Latest Latest
Warning

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

Go to latest
Published: Nov 6, 2018 License: Apache-2.0 Imports: 11 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Generator

type Generator struct {
	Request  *plugin.CodeGeneratorRequest  // The input.
	Response *plugin.CodeGeneratorResponse // The output.

	Param map[string]string // Command-line parameters.
	// contains filtered or unexported fields
}

Generator is the type whose methods generate the output, stored in the associated response structure.

func New

func New() *Generator

New creates a new generator and allocates the request and response protobufs.

func (*Generator) CommandLineParameters

func (g *Generator) CommandLineParameters(parameter string)

CommandLineParameters breaks the comma-separated list of key=value pairs in the parameter (a member of the request protobuf) into a key/value map. It then sets file name mappings defined by those entries.

func (*Generator) GenerateAllFiles

func (g *Generator) GenerateAllFiles() error

GenerateAllFiles generates the output for all the files we're outputting.

func (*Generator) WriteInput

func (g *Generator) WriteInput(data []byte) error

type Message

type Message struct {
	Name     string
	JavaName string
	Package  string
}

type Method

type Method struct {
	InputType      string
	OutputType     string
	Name           string
	JavaName       string
	MethodType     MethodType
	GrpcMethodType string
	Id             int
	IdName         string
	FieldName      string
}

func (*Method) Call

func (m *Method) Call() string

func (*Method) CallParams

func (m *Method) CallParams() string

func (*Method) FullInputType

func (m *Method) FullInputType() string

func (*Method) FullOutputType

func (m *Method) FullOutputType() string

func (*Method) UnimplementedCall

func (m *Method) UnimplementedCall() string

type MethodType

type MethodType int32
const (
	Unary           MethodType = 0
	ServerStreaming MethodType = 1
	ClientStreaming MethodType = 2
	BidiStreaming   MethodType = 3
)

type Service

type Service struct {
	ProtoFile    string
	ProtoPackage string
	ProtoName    string

	JavaPackage    string
	Name           string
	OuterClassName string
	Methods        []Method
}

type ServiceGenerator

type ServiceGenerator struct {
	*bytes.Buffer
	// contains filtered or unexported fields
}

func (*ServiceGenerator) Generate

func (g *ServiceGenerator) Generate() error

Fill the response protocol buffer with the generated output for all the files we're supposed to generate.

func (*ServiceGenerator) GetFileName

func (g *ServiceGenerator) GetFileName() string

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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