protoc

package
v0.0.0-...-b937326 Latest Latest
Warning

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

Go to latest
Published: Oct 27, 2020 License: Apache-2.0 Imports: 14 Imported by: 0

Documentation

Index

Constants

View Source
const ProtocHelpTemplate = `` /* 833-byte string literal not displayed */

ProtocHelpTemplate ...

Variables

View Source
var Cmd = cli.Command{
	Name:            "protoc",
	Aliases:         []string{"p"},
	Usage:           "jupiter protoc tools",
	Action:          Run,
	SkipFlagParsing: false,
	UsageText:       ProtocHelpTemplate,
	Flags: []cli.Flag{
		&cli.BoolFlag{
			Name:        "grpc,g",
			Usage:       "whether to generate GRPC code",
			Destination: &option.withGRPC,
		},
		&cli.BoolFlag{
			Name:        "server,s",
			Usage:       "whether to generate grpc server code",
			Destination: &option.withServer,
		},
		&cli.StringFlag{
			Name:        "file,f",
			Usage:       "Path of proto file",
			Required:    true,
			Destination: &option.protoFilePath,
		},
		&cli.StringFlag{
			Name:        "out,o",
			Usage:       "Path of code generation",
			Required:    true,
			Destination: &option.outputDir,
		},
		&cli.StringFlag{
			Name:        "prefix,p",
			Usage:       "prefix(current project name)",
			Required:    false,
			Destination: &option.prefix,
		},
	},
}

Functions

func Lcfirst

func Lcfirst(str string) string

Lcfirst the string begins with a lowercase letter

func Run

func Run(cli *cli.Context) (err error)

Run ...

func Ucfirst

func Ucfirst(str string) string

Ucfirst capitalize the first letter of the string

Types

type GRPCServerGen

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

GRPCServerGen ...

func NewGRPCServerGen

func NewGRPCServerGen() *GRPCServerGen

NewGRPCServerGen construct a GRPCServerGen instance

type Option

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

Option ...

type RPCMeta

type RPCMeta struct {
	Service *proto.Service
	Message []*proto.Message
	RPC     []*proto.RPC
	Package *proto.Package
	Prefix  string //生成的GRPC server代码 import pb.go文件时的前缀
}

RPCMeta ...

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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