Faster than go regular expressions
package ua
The package provides the below API
import (
userAgent "github.com/DronRathore/github-rage-ua/src/ua"
)
browser, version := userAgent.UaVersion(string)
var isBot bool = userAgent.IsBot(string)
isMobile, platform := userAgent.IsMobile(string)
Note: While compiling for production environment you can optimise the ragel output by running the build.sh with $GOENV=production
and it will output the fully optimised ragel state machine.
# compile optimised ragel first
GOENV=production ./src/github.com/DronRathore/go-ragel-ua/build.sh