Documentation ¶
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 (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
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
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 returns a suitable folder name. It removes any special characters from the given string `s` and returns a string consists of alpha-numeric characters.
admin/widget --> admin/widget adminUser --> admin_user foo_bar --> foo_bar Admin --> admin U$ser --> u_ser
func Group ¶
Group pascalizes and pluralizes the string
person = People foo_bar = FooBars admin/widget = AdminWidgets
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 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 (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 returns a suitable folder name. It removes any special characters from the given string `s` and returns a string consists of alpha-numeric characters.
admin/widget --> admin/widget adminUser --> admin_user foo_bar --> foo_bar Admin --> admin U$ser --> u_ser
func (Ident) Group ¶
Group pascalizes and pluralizes the string
person = People foo_bar = FooBars admin/widget = AdminWidgets
func (Ident) MarshalText ¶
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) Tableize ¶
Tableize returns an underscore, pluralized string
User = users Person = persons Admin/Widget = admin_widgets
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