generator

package
v0.0.0-...-707806d Latest Latest
Warning

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

Go to latest
Published: Jun 6, 2017 License: MIT Imports: 16 Imported by: 0

Documentation

Overview

Package generator generates Golang code from the input proto files then compiles the code into protobuf structures for use by the protoc executable.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Compile

func Compile(input io.Reader, output io.Writer, gen Generator) error

func NewTemplate

func NewTemplate(name string, content string) *template.Template

Types

type Argument

type Argument struct {
	Name        string
	Description string
	Type        descriptor.FieldDescriptorProto_Type
	// contains filtered or unexported fields
}

type Descriptor

type Descriptor struct {
	Imports  map[string]string
	Services []*Service
}

type File

type File struct {
	Name    string
	Content string
}

type Generator

type Generator func(*Descriptor) ([]*File, error)

type Method

type Method struct {
	Name        string
	Description string
	Input       string
	Output      string
	Arguments   []*Argument
}

type Service

type Service struct {
	Name        string
	Enabled     bool
	Description string
	Package     string
	Methods     []*Method
	Config      []Setting
}

type Setting

type Setting struct {
	Name        string
	Required    bool
	Description string
}

Jump to

Keyboard shortcuts

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