Documentation ¶
Index ¶
Constants ¶
View Source
const ( // CharsetBin is used for marking binary charset. CharsetBin = "binary" // CollationBin is the default collation for CharsetBin. CollationBin = "binary" // CharsetUTF8 is the default charset for string types. CharsetUTF8 = "utf8" // CollationUTF8 is the default collation for CharsetUTF8. CollationUTF8 = "utf8_bin" // CharsetUTF8MB4 represents 4 bytes utf8, which works the same way as utf8 in Go. CharsetUTF8MB4 = "utf8mb4" // CollationUTF8MB4 is the default collation for CharsetUTF8MB4. CollationUTF8MB4 = "utf8mb4_bin" )
Variables ¶
This section is empty.
Functions ¶
func GetCharsetInfo ¶
GetCharsetInfo returns charset and collation for cs as name.
func GetDefaultCollation ¶
GetDefaultCollation returns the default collation for charset.
func Lookup ¶
Lookup returns the encoding with the specified label, and its canonical name. It returns nil and the empty string if label is not one of the standard encodings for HTML. Matching is case-insensitive and ignores leading and trailing whitespace.
func ValidCharsetAndCollation ¶
ValidCharsetAndCollation checks the charset and the collation validity and returns a boolean.
Types ¶
type Charset ¶
type Charset struct { Name string DefaultCollation *Collation Collations map[string]*Collation Desc string Maxlen int }
Charset is a charset. Now we only support MySQL.
type Collation ¶
Collation is a collation. Now we only support MySQL.
func GetCollations ¶
func GetCollations() []*Collation
GetCollations returns a list for all collations.
Click to show internal directories.
Click to hide internal directories.