proto

package
v1.1.0 Latest Latest
Warning

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

Go to latest
Published: May 31, 2019 License: Apache-2.0 Imports: 12 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var CmdProto = &cobra.Command{
	Use:   "proto [file]",
	Short: "quick and easy compilation of proto files",
	Long: `
Usage:
	gos proto [file]

	[file] the proto file you wanna to compile, gos supports two additional wildcards: 
	"all" means compiling all proto files under the current folder (excluding subfolders);
	"all/all" means compiling all proto files in the current directory and all subdirectories
	
	- Compile a single file
	gos proto helloworld.proto

	- Compile all proto files under the current folder (excluding subfolders)
	gos proto all

	- Compile all proto files in the current directory and all subdirectories
	gos proto all/all
`,
	Args: cobra.ExactArgs(1),
}

CmdProto is the command line for cross compilation

View Source
var GoPathSrc = filepath.Join(os.Getenv("GOPATH"), "src")

GoPathSrc is the address of $GOPATH/src

Functions

func Generate

func Generate(proto string) error

Generate is used to execute the generate command for the specified proto file

func Run

func Run(cmd *cobra.Command, args []string)

Run command

func WalkCurrent

func WalkCurrent() error

WalkCurrent is used to traverse all proto files in the current folder and execute the generate command

func WalkIter

func WalkIter() error

WalkIter is used to traverse the current folder and its subfolders, find all proto files and execute the generate command

Types

This section is empty.

Jump to

Keyboard shortcuts

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