util

package
v0.0.0-...-fe53453 Latest Latest
Warning

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

Go to latest
Published: Sep 7, 2020 License: MIT Imports: 15 Imported by: 0

Documentation

Index

Constants

View Source
const (

	//ProtocBin path for protoc binary under protoapi home
	ProtocBin = "bin/protoc"
	//ProtoapiCommonInclude protoapi common proto file directory
	ProtoapiCommonInclude = "include/protoapi/"
)

Variables

This section is empty.

Functions

func CleanIncludePath

func CleanIncludePath()

CleanIncludePath cleanup include path if needed

func ClearDir

func ClearDir(dir string) error

ClearDir remove all the files/dirs under a directory

func Die

func Die(err error)

Die prints error and exit

func Dir

func Dir(useLocal bool, name string) http.FileSystem

Dir returns a http.Filesystem for the embedded assets on a given prefix dir. If useLocal is true, the filesystem's contents are instead used.

func ExtractIncludes

func ExtractIncludes(path string) error

ExtractIncludes extract common protoconf includes

func FS

func FS(useLocal bool) http.FileSystem

FS returns a http.Filesystem for the embedded assets. If useLocal is true, the filesystem's contents are instead used.

func FSByte

func FSByte(useLocal bool, name string) ([]byte, error)

FSByte returns the named file from the embedded assets. If useLocal is true, the filesystem's contents are instead used.

func FSMustByte

func FSMustByte(useLocal bool, name string) []byte

FSMustByte is the same as FSByte, but panics if name is not present.

func FSMustString

func FSMustString(useLocal bool, name string) string

FSMustString is the string version of FSMustByte.

func FSString

func FSString(useLocal bool, name string) (string, error)

FSString is the string version of FSByte.

func GetDefaultProtoc

func GetDefaultProtoc(incPath string) (protoc string, newProtocIncPath string)

GetDefaultProtoc retrieve protoc executable path and protoc Include path

func GetIncludePath

func GetIncludePath(userPath string, filePath string) string

GetIncludePath returns the actual include path

func GetProtoapiHome

func GetProtoapiHome() string

GetProtoapiHome return protoconf home dir

func IsStrInSlice

func IsStrInSlice(str string, slice []string) bool

Types

This section is empty.

Jump to

Keyboard shortcuts

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