Documentation
¶
Index ¶
- Constants
- func GetCmdServiceImportPath(name string) (string, error)
- func GetEndpointImportPath(name string) (string, error)
- func GetGRPCTransportImportPath(name string) (string, error)
- func GetGoPath() string
- func GetHTTPTransportImportPath(name string) (string, error)
- func GetImportPath(rootDir string, svcPath string) (string, error)
- func GetModNameFromModFile(name string) (string, error)
- func GetPbImportPath(name, pathByFlag string) (string, error)
- func GetValidParameterCode(paramName, impPath, paramType string) jen.Code
- func GoImportsSource(path string, s string) ([]byte, error)
- func IsExist(path string) bool
- func IsUpperCase(str string) bool
- func StringSliceContains(list []string, checkItem string) bool
- func ToCamelCase(str string) string
- func ToLowerFirstCamelCase(s string) string
- func ToLowerSnakeCase(s string) string
- func ToSnakeCase(s string) string
- func ToUpperFirst(s string) string
- func TraverseDirFiles(fs embed.FS, subdir string) ([]string, []string, error)
Constants ¶
const (
Cameling string = `[\p{L}\p{N}]+`
)
Variables ¶
This section is empty.
Functions ¶
func GetCmdServiceImportPath ¶
GetCmdServiceImportPath returns the import path of the cmd service (used by cmd/main.go).
func GetEndpointImportPath ¶
GetEndpointImportPath returns the import path of the service endpoints.
func GetGRPCTransportImportPath ¶
GetGRPCTransportImportPath returns the import path of the service grpc transport.
func GetHTTPTransportImportPath ¶
GetHTTPTransportImportPath returns the import path of the service http transport.
func GetModNameFromModFile ¶
func GetPbImportPath ¶
GetPbImportPath returns the import path of the generated service grpc pb.
func GetValidParameterCode ¶
func GoImportsSource ¶
GoImportsSource is used to format and optimize imports the given source.
func IsUpperCase ¶
IsUpperCase check if the string is uppercase. Empty string is valid.
func StringSliceContains ¶
StringSliceContains 检查字符串slice中是否含有
func ToCamelCase ¶
ToCamelCase converts from underscore separated form to camel case form.
func ToLowerFirstCamelCase ¶
ToLowerFirstCamelCase returns the given string in camelcase formatted string but with the first letter being lowercase.
func ToLowerSnakeCase ¶
ToLowerSnakeCase the given string in snake-case format.
func ToSnakeCase ¶
ToSnakeCase converts from camel case form to underscore separated form.
func ToUpperFirst ¶
ToUpperFirst returns the given string with the first letter being uppercase.
Types ¶
This section is empty.