Documentation ¶
Index ¶
- Constants
- Variables
- func BackQuote(in string) string
- func Case(name string) any
- func CaseFuncs(name string) map[string]any
- func Cases(name string) any
- func Csv(in stringlist.Strings) string
- func FileWithExt(path, ext string) string
- func GoComment(s string) string
- func GoDoc(s string) string
- func GoToken(in string) string
- func In(needle any, haystack ...any) (bool, error)
- func Inc(x int) int
- func Invoke(file string, commandLine []string) error
- func IsGoType(token string) bool
- func IsNil(i any) bool
- func IsNotNil(i any) bool
- func NotEmpty(in string) bool
- func Numbers(start, end int) stringlist.Strings
- func Pad(s string, size int) string
- func PluralUnique(s string) string
- func ReplaceEach(s, newString string, olds ...string) string
- func Sum(vv ...int) int
- func ToSlice(vv ...any) any
- func Unchanged(s string) string
- type Error
Constants ¶
View Source
const ( CommentPrefix = "//" MaxWidth = 100 )
View Source
const PluralSuffix = "List"
View Source
const Timeout = time.Second * 15
Variables ¶
View Source
var ErrRuntime = Error("runtime")
View Source
var Funcs = map[string]any{ "camel": kace.Camel, "kebab": kace.Kebab, "kebabUpper": kace.KebabUpper, "pascal": kace.Pascal, "snake": kace.Snake, "snakeUpper": kace.SnakeUpper, "unchanged": Unchanged, "fields": strings.Fields, "indexAny": strings.IndexAny, "lastIndex": strings.LastIndex, "lastIndexAny": strings.LastIndexAny, "replaceAll": strings.ReplaceAll, "strIndex": strings.Index, "trimLeft": strings.TrimLeft, "trimRight": strings.TrimRight, "trimPrefix": strings.TrimPrefix, "trimSuffix": strings.TrimSuffix, "pluralName": inflection.Plural, "pluralUniqueName": PluralUnique, "singular": inflection.Singular, "pad": Pad, "notEmpty": NotEmpty, "version": cfg.Version, "toSlice": ToSlice, "numbers": Numbers, "sum": Sum, "inc": Inc, "replaceEach": ReplaceEach, "fileWithExt": FileWithExt, "isNil": IsNil, "isNotNil": IsNotNil, "in": In, "backQuote": BackQuote, "csv": Csv, "goToken": GoToken, "goDoc": GoDoc, "goComment": GoComment, "isGoType": IsGoType, "blue": color.Blue, "color": color.ByName, "colors": color.ByNames, "colorReset": color.Clear, "cyan": color.Cyan, "green": color.Green, "magenta": color.Magenta, "red": color.Red, "yellow": color.Yellow, }
Functions ¶
func Csv ¶
func Csv(in stringlist.Strings) string
func FileWithExt ¶
func GoComment ¶ added in v0.0.6
GoComment appends CommentPrefix to each newline and trims trailing empty lines
func GoToken ¶
GoToken converts the in string into a valid Go Token by converting "/" an ".". It also filters for reserved words.
func Numbers ¶
func Numbers(start, end int) stringlist.Strings
numbers returns a slice of strings of the numbers start to end (inclusive).
func PluralUnique ¶
PluralUnique guarantees a unique name for a Plural of the input.
func ReplaceEach ¶
Types ¶
Click to show internal directories.
Click to hide internal directories.