utils

package
v0.0.0-...-2611440 Latest Latest
Warning

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

Go to latest
Published: Aug 7, 2021 License: MIT, MIT Imports: 10 Imported by: 0

Documentation

Index

Constants

View Source
const (
	Cameling string = `[\p{L}\p{N}]+`
)

Variables

This section is empty.

Functions

func GetCmdServiceImportPath

func GetCmdServiceImportPath(name string) (string, error)

GetCmdServiceImportPath returns the import path of the cmd service (used by cmd/main.go).

func GetEndpointImportPath

func GetEndpointImportPath(name string) (string, error)

GetEndpointImportPath returns the import path of the service endpoints.

func GetGRPCTransportImportPath

func GetGRPCTransportImportPath(name string) (string, error)

GetGRPCTransportImportPath returns the import path of the service grpc transport.

func GetGoPath

func GetGoPath() string

GetGoPath returns the gopath.

func GetHTTPTransportImportPath

func GetHTTPTransportImportPath(name string) (string, error)

GetHTTPTransportImportPath returns the import path of the service http transport.

func GetImportPath

func GetImportPath(rootDir string, svcPath string) (string, error)

func GetModNameFromModFile

func GetModNameFromModFile(name string) (string, error)

func GetPbImportPath

func GetPbImportPath(name, pathByFlag string) (string, error)

GetPbImportPath returns the import path of the generated service grpc pb.

func GetValidParameterCode

func GetValidParameterCode(paramName, impPath, paramType string) jen.Code

func GoImportsSource

func GoImportsSource(path string, s string) (string, error)

GoImportsSource is used to format and optimize imports the given source.

func IsExist

func IsExist(path string) bool

func IsUpperCase

func IsUpperCase(str string) bool

IsUpperCase check if the string is uppercase. Empty string is valid.

func StringSliceContains

func StringSliceContains(list []string, checkItem string) bool

StringSliceContains 检查字符串slice中是否含有

func ToCamelCase

func ToCamelCase(str string) string

ToCamelCase converts from underscore separated form to camel case form.

func ToLowerFirstCamelCase

func ToLowerFirstCamelCase(s string) string

ToLowerFirstCamelCase returns the given string in camelcase formatted string but with the first letter being lowercase.

func ToLowerSnakeCase

func ToLowerSnakeCase(s string) string

ToLowerSnakeCase the given string in snake-case format.

func ToSnakeCase

func ToSnakeCase(s string) string

ToSnakeCase converts from camel case form to underscore separated form.

func ToUpperFirst

func ToUpperFirst(s string) string

ToUpperFirst returns the given string with the first letter being uppercase.

Types

This section is empty.

Jump to

Keyboard shortcuts

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