generator

package
v0.0.0-...-83adff0 Latest Latest
Warning

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

Go to latest
Published: Jul 6, 2020 License: GPL-3.0 Imports: 11 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func GenCSCode

func GenCSCode(csdir string, spec *types.ServiceSpec, options *GenCSCodeOptions) error

GenCSCode generator client, server code

func GenServiceProto

func GenServiceProto(out io.Writer, spec *types.ServiceSpec, options *ServiceProtoOptions) error

GenServiceProto generator proto service by service spec

func Protoc

func Protoc(protoFile, protocExec, gen string, paths []string) error

Protoc run protoc generator go source code

Types

type CSMethod

type CSMethod struct {
	Name         string
	Comments     []string
	ParamBlock   string
	ReturnBlock  string
	ParamPbBlock string
}

CSMethod ...

type CSValue

type CSValue struct {
	Name          string
	PbPackage     string
	RecvName      string
	RecvPackage   string
	Imports       map[string]struct{}
	ClientImports map[string]struct{}
	Methods       []CSMethod
	// contains filtered or unexported fields
}

CSValue ...

type GenCSCodeOptions

type GenCSCodeOptions struct {
	PbPackage   string
	RecvPackage string
	RecvName    string
}

GenCSCodeOptions options

type ProtoField

type ProtoField struct {
	FieldID   int
	FieldType string
	FieldName string
}

ProtoField ProtoField

type ProtoMessage

type ProtoMessage struct {
	Name   string
	Fields []ProtoField
}

ProtoMessage ProtoMessage

type ProtoMethod

type ProtoMethod struct {
	Comments []string
	Name     string
	Req      string
	Reply    string
}

ProtoMethod method info

type ProtoValue

type ProtoValue struct {
	Package   string
	Name      string
	GoPackage string
	Imports   map[string]bool
	Messages  map[string]ProtoMessage
	Methods   []ProtoMethod
	// contains filtered or unexported fields
}

ProtoValue proto template render value

type ServiceProtoOptions

type ServiceProtoOptions struct {
	GoPackage    string
	ProtoPackage string
	IgnoreType   bool
	ImportPaths  []string
}

ServiceProtoOptions ...

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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