Documentation ¶
Overview ¶
Package compressible provides MIME compressible checking for Go
Index ¶
Examples ¶
Constants ¶
View Source
const Version = "0.3.0"
Version is this package's version
Variables ¶
This section is empty.
Functions ¶
func Test ¶
Test checks whether the given contentType is compressible, using https://github.com/GitbookIO/mimedb as mime database.Recommand to autoload all extensions and their associated content type by `import _ "github.com/GitbookIO/mimedb/autoload"` first. All types that not in mimedb but have the scheme of "text/*", "*/*+json", "*/*+text" and "*/*+xml" are considered as compressible.
Example ¶
package main import ( "fmt" _ "github.com/GitbookIO/mimedb/autoload" "github.com/go-http-utils/compressible" ) func main() { fmt.Println(compressible.Test("text/html")) // -> true fmt.Println(compressible.Test("image/png")) // -> false }
Output:
Types ¶
This section is empty.
Click to show internal directories.
Click to hide internal directories.