Documentation
¶
Index ¶
- func CleanPrefix(ident string) string
- func CleanTypeNameUpper(typeName string) string
- func DispositionFileName(contentDisposition string) string
- func EmptyString(value string) bool
- func JoinPackageName(ident string) string
- func LeadingSlash(value string) string
- func NoImport(ident string) string
- func NoPackage(ident string) string
- func NoPointer(ident string) string
- func NoSlice(ident string) string
- func NotEmptyString(value string) bool
- func PathTokens(path string) []string
- func ToLowerCamel(value string) string
- func ToUpperCamel(value string) string
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func CleanPrefix ¶
CleanPrefix strips the "command-line-arguments." prefix that the Go 'packages' package prepends to type identifier for types defined in the source file we're parsing.
func CleanTypeNameUpper ¶
CleanTypeNameUpper normalizes a raw type's name to be a single token name in upper camel case.
func DispositionFileName ¶ added in v1.1.0
DispositionFileName extracts the "filename" from an HTTP Content-Disposition header value.
func EmptyString ¶
EmptyString is a predicate that returns true when the input value is "".
func JoinPackageName ¶
JoinPackageName converts a package-qualified type such as "fmt.Stringer" into a single "safe" identifier such as "fmtStringer". This is useful when converting types to languages with different naming semantics.
func LeadingSlash ¶
LeadingSlash adds... a leading slash to the given string.
func NoImport ¶
NoImport strips off the prefix before "/" in your type identifier (e.g. "github.com/foo/bar/Baz" -> "Baz")
func NoPackage ¶
NoPackage strips of any package prefixes from an identifier (e.g. "context.Context" -> "Context")
func NoPointer ¶
NoPointer strips off any "*" prefix your type identifier might have (e.g. "*Foo" -> "Foo")
func NoSlice ¶
NoSlice takes a string like "[]Foo" or "[456]Foo", strips off the slice/array braces, leaving you with "Foo".
func NotEmptyString ¶
NotEmptyString is a predicate that returns true when the input value is anything but "".
func PathTokens ¶
PathTokens accepts a path string like "foo/bar/baz" and returns a slice of the individual path segment tokens such as ["foo", "bar", "baz"]. This will ignore leading/trailing slashes in your path so that you don't get leading/trailing "" tokens in your slice. This does not, however, clean up empty tokens caused by "//" somewhere in your path.
func ToLowerCamel ¶
ToLowerCamel converts the string to lower camel-cased.
func ToUpperCamel ¶
ToUpperCamel converts the string to upper camel-cased.
Types ¶
This section is empty.