useragent

package
v0.0.0-...-cd54735 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jul 19, 2024 License: MIT Imports: 4 Imported by: 12

Documentation

Overview

Package useragent implements parts of https://tools.ietf.org/html/rfc7231#section-5.5 and https://tools.ietf.org/html/rfc2616#section-14.43

Index

Constants

This section is empty.

Variables

View Source
var Error = errs.Class("useragent")

Error is the default error class.

Functions

func EncodeEntries

func EncodeEntries(entries []Entry) ([]byte, error)

EncodeEntries encodes all entries.

Types

type Entry

type Entry struct {
	Product string
	Version string
	Comment string
}

Entry represents a single item in useragent string.

func ParseEntries

func ParseEntries(data []byte) ([]Entry, error)

ParseEntries parses every entry in useragent string.

type Info

type Info struct {
	Product Product

	Full string
}

Info contains parsed user agent.

func Parse

func Parse(s string) (Info, error)

Parse parses user agent string to information.

type Product

type Product struct {
	Name    string
	Version string
}

Product is an user agent product.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL