util

package
v1.9.0 Latest Latest
Warning

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

Go to latest
Published: Nov 25, 2024 License: GPL-3.0 Imports: 12 Imported by: 4

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ComponentName

func ComponentName(api *spec.ApiSpec) string

ComponentName returns component name for typescript

func ConvertTagToComment

func ConvertTagToComment(tagString string) ([]string, error)

ConvertTagToComment converts validator tag to comments.

func ConvertValidateTagToSwagger

func ConvertValidateTagToSwagger(tagData string) ([]string, error)

ConvertValidateTagToSwagger converts the validator tag to swagger comments.

func Copy

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

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

func ExtractValidateString

func ExtractValidateString(data string) string

ExtractValidateString extracts the validator's string.

func HasCustomValidation

func HasCustomValidation(data string) bool

HasCustomValidation returns true if the comment has validations.

func IsLowerCase

func IsLowerCase(r rune) bool

IsLowerCase returns true if the rune in a-z

func IsUpperCase

func IsUpperCase(r rune) bool

IsUpperCase returns true if the rune in A-Z

func MaybeCreateFile

func MaybeCreateFile(dir, subdir, file string) (fp *os.File, created bool, err error)

MaybeCreateFile creates file if not exists

func RemoveComment

func RemoveComment(line string) string

RemoveComment filters comment content

func ToCamelCase

func ToCamelCase(s string) string

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

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 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