package name
import "github.com/gobuffalo/flect/name"
Index ¶
- func Char(s string) string
- func File(s string, exts ...string) string
- func FilePathJoin(names ...string) string
- func Folder(s string, exts ...string) string
- func Group(s string) string
- func Key(s string) string
- func OsPath(s string) string
- func Package(s string) string
- func ParamID(s string) string
- func Proper(s string) string
- func Tableize(s string) string
- func VarCase(s string) string
- func VarCasePlural(s string) string
- func VarCaseSingle(s string) string
- type Ident
- func Interface(x interface{}) (Ident, error)
- func New(s string) Ident
- func (i Ident) Char() Ident
- func (i Ident) File(exts ...string) Ident
- func (i Ident) FilePathJoin(ni ...Ident) Ident
- func (i Ident) Folder(exts ...string) Ident
- func (i Ident) Group() Ident
- func (i Ident) Key() Ident
- func (i Ident) MarshalText() ([]byte, error)
- func (i Ident) OsPath() Ident
- func (i Ident) Package() Ident
- func (i Ident) ParamID() Ident
- func (i Ident) Proper() Ident
- func (n Ident) Resource() Ident
- func (i Ident) Tableize() Ident
- func (n Ident) URL() Ident
- func (i *Ident) UnmarshalText(data []byte) error
- func (i Ident) VarCase() Ident
- func (i Ident) VarCasePlural() Ident
- func (i Ident) VarCaseSingle() Ident
Functions ¶
func Char ¶
Char returns the first letter, lowered
"" = "x" "foo" = "f" "123d456" = "d"
func File ¶
File creates a suitable file name
admin/widget = admin/widget foo_bar = foo_bar U$ser = u_ser
func FilePathJoin ¶
func Folder ¶
Folder creates a suitable folder name
admin/widget = admin/widget foo_bar = foo_bar U$ser = u_ser
func Group ¶
Group pascalizes and pluralizes the string
person = People foo_bar = FooBars admin/widget = AdminWidgets
func Key ¶
func OsPath ¶
func Package ¶
Package will attempt to return a package version of the name
$GOPATH/src/foo/bar = foo/bar $GOPATH\src\foo\bar = foo/bar foo/bar = foo/bar
func ParamID ¶
ParamID returns the string as parameter with _id added
user = user_id UserID = user_id admin/widgets = admin_widgets_id
func Proper ¶
Proper pascalizes and singularizes the string
person = Person foo_bar = FooBar admin/widgets = AdminWidget
func Tableize ¶
Tableize returns an underscore, pluralized string
User = users Person = persons Admin/Widget = admin_widgets
func VarCase ¶
VarCase version of a name.
foo_bar = fooBar admin/widget = adminWidget Users = users
func VarCasePlural ¶
VarCasePlural version of a name.
foo_bar = fooBars admin/widget = adminWidgets User = users
func VarCaseSingle ¶
VarCaseSingle version of a name.
foo_bar = fooBar admin/widget = adminWidget User = users
Types ¶
type Ident ¶
Ident represents the string and it's parts
func Interface ¶
func New ¶
New creates a new Ident from the string
func (Ident) Char ¶
Char returns the first letter, lowered
"" = "x" "foo" = "f" "123d456" = "d"
func (Ident) File ¶
File creates a suitable file name
admin/widget = admin/widget foo_bar = foo_bar U$ser = u_ser
func (Ident) FilePathJoin ¶
func (Ident) Folder ¶
Folder creates a suitable folder name
admin/widget = admin/widget foo_bar = foo/bar U$ser = u/ser
func (Ident) Group ¶
Group pascalizes and pluralizes the string
person = People foo_bar = FooBars admin/widget = AdminWidgets
func (Ident) Key ¶
func (Ident) MarshalText ¶
func (Ident) OsPath ¶
func (Ident) Package ¶
Package will attempt to return a package version of the name
$GOPATH/src/foo/bar = foo/bar $GOPATH\src\foo\bar = foo/bar foo/bar = foo/bar
func (Ident) ParamID ¶
ParamID returns the string as parameter with _id added
user = user_id UserID = user_id admin/widgets = admin_widget_id
func (Ident) Proper ¶
Proper pascalizes and singularizes the string
person = Person foo_bar = FooBar admin/widgets = AdminWidget
func (Ident) Resource ¶
Resource version of a name
func (Ident) Tableize ¶
Tableize returns an underscore, pluralized string
User = users Person = persons Admin/Widget = admin_widgets
func (Ident) URL ¶
func (*Ident) UnmarshalText ¶
func (Ident) VarCase ¶
VarCase version of a name.
foo_bar = fooBar admin/widget = adminWidget Users = users
func (Ident) VarCasePlural ¶
VarCasePlural version of a name.
foo_bar = fooBars admin/widget = adminWidgets User = users
func (Ident) VarCaseSingle ¶
VarCaseSingle version of a name.
foo_bar = fooBar admin/widget = adminWidget User = users
Source Files ¶
char.go file.go folder.go ident.go interface.go join.go key.go name.go os_path.go package.go param_id.go resource.go tablize.go url.go var_case.go
- Version
- v0.2.2
- Published
- Aug 28, 2020
- Platform
- darwin/amd64
- Imports
- 10 packages
- Last checked
- 3 hours ago –
Tools for package owners.