generator

package
v0.0.0-...-c8d070c Latest Latest
Warning

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

Go to latest
Published: Mar 27, 2024 License: Apache-2.0 Imports: 8 Imported by: 1

Documentation

Index

Constants

View Source
const ClientImplTpl = `` /* 2705-byte string literal not displayed */
View Source
const HandlerTpl = `` /* 807-byte string literal not displayed */
View Source
const ImportTpl = `` /* 333-byte string literal not displayed */
View Source
const InterfaceImplTpl = `` /* 2354-byte string literal not displayed */
View Source
const InterfaceTpl = `` /* 461-byte string literal not displayed */
View Source
const MethodInfoTpl = `` /* 451-byte string literal not displayed */
View Source
const PackageTpl = `package {{pkg .Package}}`
View Source
const PreambleTpl = `// Code generated by protoc-gen-triple. DO NOT EDIT.
//
// Source: {{.Source}}
`
View Source
const ServerImplTpl = `` /* 1988-byte string literal not displayed */
View Source
const ServiceInfoTpl = `` /* 2679-byte string literal not displayed */
View Source
const TotalTpl = `` /* 1411-byte string literal not displayed */
View Source
const TypeCheckTpl = `` /* 445-byte string literal not displayed */

Variables

View Source
var (
	Tpls                   []*template.Template
	TplPreamble            *template.Template
	TplPackage             *template.Template
	TplImport              *template.Template
	TplTotal               *template.Template
	TplTypeCheck           *template.Template
	TplClientInterface     *template.Template
	TplClientInterfaceImpl *template.Template
	TplClientImpl          *template.Template
	TplMethodInfo          *template.Template
	TplHandler             *template.Template
	TplServerImpl          *template.Template
	TplServerInfo          *template.Template
)

Functions

func GenTripleFile

func GenTripleFile(triple TripleGo) error

Types

type Generator

type Generator struct {
}

type Method

type Method struct {
	MethodName     string
	RequestType    string
	StreamsRequest bool
	ReturnType     string
	StreamsReturn  bool
}

type Service

type Service struct {
	ServiceName string
	Methods     []Method
}

type TripleGo

type TripleGo struct {
	Source       string
	Package      string
	Path         string
	FileName     string
	ProtoPackage string
	Services     []Service
	IsStream     bool
}

func ProcessProtoFile

func ProcessProtoFile(file *descriptor.FileDescriptorProto) (TripleGo, error)

Jump to

Keyboard shortcuts

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