generator

package
v0.0.0-...-3c574ab Latest Latest
Warning

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

Go to latest
Published: Nov 30, 2016 License: MIT Imports: 12 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Binding

type Binding struct {
	Method     *Method
	Index      int
	HTTPMethod HTTPMethod
	Path       *Path
	Body       string
	BodyType   *Message
}

type Enum

type Enum struct {
	*descriptor.EnumDescriptorProto
	FQMN string
}

func NewEnum

func NewEnum(enum *descriptor.EnumDescriptorProto) *Enum

type Field

type Field struct {
	*descriptor.FieldDescriptorProto
}

func NewField

func NewField(field *descriptor.FieldDescriptorProto) *Field

type File

type File struct {
	*descriptor.FileDescriptorProto

	GoPkg    *GoPackage
	Messages []*Message
	Enums    []*Enum
	Services []*Service
}

func NewFile

func NewFile(file *descriptor.FileDescriptorProto) *File

func (*File) GetOutputFileName

func (f *File) GetOutputFileName() string

func (*File) GetPackageName

func (f *File) GetPackageName() string

func (*File) LoadEnums

func (f *File) LoadEnums(enums []*descriptor.EnumDescriptorProto, outers []string)

func (*File) LoadMessages

func (f *File) LoadMessages(msgs []*descriptor.DescriptorProto, outers []string)

func (*File) LoadServices

func (f *File) LoadServices(g *Generator, services []*descriptor.ServiceDescriptorProto) error

type Generator

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

func New

func New() *Generator

func (*Generator) Generate

func (g *Generator) Generate() ([]*plugin.CodeGeneratorResponse_File, error)

func (*Generator) Load

func (*Generator) LookupEnum

func (g *Generator) LookupEnum(name string) *Enum

func (*Generator) LookupMessage

func (g *Generator) LookupMessage(name string) *Message

type GoPackage

type GoPackage struct {
	Path  string
	Name  string
	Alias string
}

func NewGoPackage

func NewGoPackage(pkg string) *GoPackage

func NewGoPackageList

func NewGoPackageList(list []string) []*GoPackage

func (GoPackage) String

func (p GoPackage) String() string

type HTTPMethod

type HTTPMethod int
const (
	GET HTTPMethod = iota
	POST
	PUT
	PATCH
	DELETE
)

func (HTTPMethod) String

func (i HTTPMethod) String() string

type Message

type Message struct {
	*descriptor.DescriptorProto

	FQMN   string
	File   *File
	Fields []*Field
}

func NewMessage

func NewMessage(msg *descriptor.DescriptorProto) *Message

func (*Message) LookupField

func (m *Message) LookupField(name string) *Field

type Method

type Method struct {
	*descriptor.MethodDescriptorProto

	RequestType  *Message
	ResponseType *Message
	Bindings     []*Binding
}

func NewMethod

func NewMethod(method *descriptor.MethodDescriptorProto) *Method

type NameGetter

type NameGetter interface {
	GetName() string
}

type Path

type Path struct {
	Path   string
	Params []string
}

func NewPath

func NewPath(str string) (*Path, error)

type Service

type Service struct {
	*descriptor.ServiceDescriptorProto

	Methods []*Method
}

func NewService

func NewService(svc *descriptor.ServiceDescriptorProto) *Service

Jump to

Keyboard shortcuts

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