Skip to content

Latest commit

 

History

History
21 lines (20 loc) · 832 Bytes

README.md

File metadata and controls

21 lines (20 loc) · 832 Bytes

GoDoc

Ragel state machine based User Agent detection for golang

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