Documentation ¶
Overview ¶
Package groups deals with group names and their initialisms.
Index ¶
- Variables
- func Contains(x string, sorted []string) bool
- func Count(name string) (int, error)
- func Cronjob(force bool) error
- func Exact(name string) (int, error)
- func Fix() error
- func Format(name string) string
- func Initialism(name string) (string, error)
- func List() ([]string, int, error)
- func MatchStdOut() error
- func Slug(s string) string
- func SwapAll(group, str, swap string) string
- func SwapNumeral(group string, i int) string
- func SwapOne(group, str, swap string) string
- func SwapOrdinal(group string, i int) string
- func SwapPrefix(group, prefix, swap string) string
- func SwapSuffix(group, suffix, swap string) string
- func TrimSP(name string) (string, string, string)
- func Update(newName, group string) (count int64, err error)
- func Variations(name string) ([]string, error)
- func Wheres() []string
- type Request
Constants ¶
This section is empty.
Variables ¶
Functions ¶
func Contains ¶ added in v1.10.0
Contains returns true whenever sorted contains x. The slice value must be stored in increasing order.
func Count ¶ added in v1.10.2
Count returns the number of file entries associated with a named group.
func Exact ¶ added in v1.10.0
Exact returns the number of file entries that match an exact named group. The casing is ignored, but comma separated multi-groups are not matched to their parents. The name "tristar" will match "Tristar" but will not match records using "Tristar, Red Sector Inc".
func Initialism ¶
Initialism returns a named group initialism or acronym.
func MatchStdOut ¶ added in v1.10.0
func MatchStdOut() error
MatchStdOut scans over the groups and attempts to match possible misnamed duplicates. The results are printed to stdout in realtime.
func SwapAll ¶ added in v1.10.0
SwapAll finds all occurrences of str within a group name and replaces it with swap.
func SwapNumeral ¶ added in v1.10.0
SwapNumeral finds any occurrences of i within a group name and swaps it for a cardinal number.
func SwapOne ¶ added in v1.10.0
SwapOne finds the first occurrence of str within a group name and replaces it with swap.
func SwapOrdinal ¶ added in v1.10.0
SwapOrdinal finds any occurrences of i within a group name and swaps it for a ordinal number.
func SwapPrefix ¶ added in v1.10.0
SwapPrefix replaces the prefix value at the start of a group name and replaces it with swap. An empty string is returned if the prefix does not exist in the name.
func SwapSuffix ¶ added in v1.10.0
SwapSuffix replaces the suffix value at the end of a group name and replaces it with swap. An empty string is returned if the suffix does not exist in the name.
func TrimSP ¶ added in v1.10.0
TrimSP removes all spaces from a named group, BBS or FTP site. The first string returns the spaceless name. The second string returns a spaceless name appended with the plural "s". The third string is spaceless name appended with the plural "z".
func Update ¶ added in v1.10.0
Update replaces all instances of the group name with the new group name.
func Variations ¶
Variations creates format variations for a named group.