Documentation
¶
Overview ¶
Package naming contains some utilities for generating names.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func AfterDot ¶ added in v0.52.0
AfterDot returns the part of the string after the first dot.
If there is no dot in the string or dot is the first character, the whole string is returned.
func Capitalize ¶
Capitalize converts first character to upper.
If the string is invalid UTF-8 or empty, it is returned as is.
Types ¶
type Ruleset ¶ added in v1.23.0
type Ruleset struct {
// contains filtered or unexported fields
}
Ruleset maps lowered word parts to their canonical initialism form (e.g. "id" -> "ID"). Matching is case-insensitive.
Use DefaultRuleset to get a copy of ogen's built-in initialisms, or NewRuleset to build a custom set from scratch.
func DefaultRuleset ¶ added in v1.23.0
func DefaultRuleset() *Ruleset
DefaultRuleset returns a fresh Ruleset containing ogen's built-in initialisms. The returned Ruleset is safe to mutate via Ruleset.Add.
func NewRuleset ¶ added in v1.23.0
NewRuleset builds a Ruleset from the given canonical initialisms. Each initialism is matched case-insensitively against word parts.
func (*Ruleset) Add ¶ added in v1.23.0
Add registers an initialism in the ruleset, overriding any existing rule that matches case-insensitively. Empty strings are ignored.