Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func CanPreserve ¶
CanPreserve checks if input is only alphanumeric, dash or underscore characters
func ProfileCase ¶
ProfileCase scans through each rune in the given input and checks for a number of interesting hints about the string case of the input
breaker has things aren't alphanumeric, dash or underscore lower has at least one lower case character upper has at least one upper case character kebab has at least one dash character underscore has at least one underscore character
Types ¶
type Case ¶
type Case uint8
Case is a simple type for indicating a detected string case
func DetectCase ¶
DetectCase uses ProfileCase and some extra efforts to reliably discern the obvious string case of the given input
type CaseDetector ¶
type CaseDetector interface { // Detect wraps DetectCase and caches the results Detect(input string) (c Case) // Reset will clear the existing cache of cases detected Reset() }
CaseDetector is a caching system in order to optimize usage of the expensive DetectCase function
func NewCaseDetector ¶
func NewCaseDetector() (d CaseDetector)
NewCaseDetector constructs a new CaseDetector instance
Click to show internal directories.
Click to hide internal directories.