Skip to content

feat: expose constants in a new agents lib #58

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Jan 19, 2025
Merged

Conversation

ayuhito
Copy link
Member

@ayuhito ayuhito commented Jan 19, 2025

Overview

This exposes all the user agent string consts in a new go-useragent/agents sub-directory which can be referenced by consumers.

The trie structure was also refactored to store matched tokens as uint8 instead of strings, which should help reduce idle memory consumption a little bit.

New

A couple new methods have introduced on the UserAgent type:

  • Browser() returns new Browser string alias (GetBrowser() has been deprecated)

  • OS() returns new OS string alias (GetOS() has been deprecated)

  • Device() returns a new Device string alias (GetDevice() has been deprecated)

  • BrowserVersion() returns browser version (GetVersion() has been deprecated as we prepare for OS versions)

  • BrowserVersionMajor() returns major browser version (GetMajorVersion() has been deprecated as we prepare for OS versions)

  • BrowserVersionMinor()

  • BrowserVersionPatch()

Verified

This commit was created on GitHub.com and signed with GitHub’s verified signature. The key has expired.
@ayuhito ayuhito added the enhancement New feature or request label Jan 19, 2025
@ayuhito ayuhito merged commit cfaaf41 into main Jan 19, 2025
1 check passed
@ayuhito ayuhito deleted the feat/expose-constants branch January 19, 2025 10:07
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

1 participant