[go: up one dir, main page]

Skip to content

DronRathore/go-ragel-ua

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

6 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

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

About

Go ragel based User Agent detection

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published