utils

package
v0.0.0-...-17df793 Latest Latest
Warning

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

Go to latest
Published: Feb 8, 2024 License: Apache-2.0 Imports: 18 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var WhiteSpace = []rune{'\n', '\t', '\f', '\v', ' '}

Functions

func CloneIntoGitHome

func CloneIntoGitHome(url, branch string) (dir string, err error)

func ComponentName

func ComponentName(api *spec.ApiSpec) string

ComponentName returns component name for typescript

func ContainsAny

func ContainsAny(s string, runes ...rune) bool

func ContainsWhiteSpace

func ContainsWhiteSpace(s string) bool

func Copy

func Copy(src, dst string) (int64, error)

Copy calls io.Copy if the source file and destination file exists

func FormatCode

func FormatCode(code string) string

func IsEmptyStringOrWhiteSpace

func IsEmptyStringOrWhiteSpace(s string) bool

func IsLowerCase

func IsLowerCase(r rune) bool

IsLowerCase returns true if the rune in a-z

func IsTemplateVariable

func IsTemplateVariable(text string) bool

IsTemplateVariable 函数会返回 true,如果文本是一个模板变量 文本必须以点号开头,并且是一个有效的模板。

func IsUpperCase

func IsUpperCase(r rune) bool

IsUpperCase returns true if the rune in A-Z

func Rand

func Rand() string

Rand returns a random string.

func RandId

func RandId() string

RandId returns a random id string.

func Randn

func Randn(n int) string

Randn returns a random string with length n.

func RemoveComment

func RemoveComment(line string) string

RemoveComment filters comment content

func Seed

func Seed(seed int64)

Seed sets the seed to seed.

func TemplateVariable

func TemplateVariable(text string) string

TemplateVariable 函数返回模板的变量名。

func ToCamelCase

func ToCamelCase(s string) string

ToCamelCase returns a copy string by converting snake case into camel case

func ToLastLower

func ToLastLower(s string) string

ToLastLower 取出 account/s/s/org 的最后一段 org

func ToLower

func ToLower(s string) string

ToLower returns a copy string by converting it into lower

func ToLowerCase

func ToLowerCase(r rune) rune

ToLowerCase converts rune into lower case

func ToSnakeCase

func ToSnakeCase(s string) string

ToSnakeCase returns a copy string by converting camel case into snake case

func ToUpper

func ToUpper(s string) string

ToUpper returns a copy string by converting it into upper

func ToUpperCase

func ToUpperCase(r rune) rune

ToUpperCase converts rune into upper case

func TrimWhiteSpace

func TrimWhiteSpace(s string) string

func UnExport

func UnExport(text string) bool

UnExport converts the first letter into lower case

func UpperFirst

func UpperFirst(s string) string

UpperFirst converts s[0] into upper case

func WrapErr

func WrapErr(err error, message string) error

WrapErr wraps an error with message

func WriteIndent

func WriteIndent(writer io.Writer, indent int)

WriteIndent writes tab spaces

Types

This section is empty.

Jump to

Keyboard shortcuts

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