Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func CompatibleCollate ¶
CompatibleCollate checks whether the two collate are the same.
func IsCICollation ¶
IsCICollation returns if the collation is case-sensitive
Types ¶
type Collator ¶
type Collator interface {
// Compare returns an integer comparing the two strings. The result will be 0 if a == b, -1 if a < b, and +1 if a > b.
Compare(a, b string) int
// Key returns the collate key for str. If the collation is padding, make sure the PadLen >= len(rune[]str) in opt.
Key(str string) []byte
// Pattern get a collation-aware WildcardPattern.
Pattern() WildcardPattern
}
Collator provides functionality for comparing strings for a given collation order.
func GetCollator ¶
GetCollator get the collator according to collate, it will return the binary collator if the corresponding collator doesn't exist.
type WildcardPattern ¶
type WildcardPattern interface {
// Compile compiles the patternStr with specified escape character.
Compile(patternStr string, escape byte)
// DoMatch tries to match the str with compiled pattern, `Compile()` must be called before calling it.
DoMatch(str string) bool
}
WildcardPattern is the interface used for wildcard pattern match.
Click to show internal directories.
Click to hide internal directories.