useragent

package
v0.188.3 Latest Latest
Warning

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

Go to latest
Published: Jan 15, 2024 License: Apache-2.0 Imports: 2 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type UserAgent

type UserAgent struct {
	// contains filtered or unexported fields
}

UserAgent represents a Grafarg user agent. Its format is "Grafarg/<version> (<os>; <arch>)" Example: "Grafarg/7.0.0-beta1 (darwin; amd64)", "Grafarg/10.0.0 (windows; x86)"

func Empty

func Empty() *UserAgent

Empty creates a new UserAgent with default values.

func New

func New(grafargVersion, os, arch string) (*UserAgent, error)

New creates a new UserAgent. The version must be a valid semver string, and the os and arch must be valid strings.

func Parse

func Parse(s string) (*UserAgent, error)

Parse creates a new UserAgent from a string.

func (*UserAgent) GrafargVersion

func (ua *UserAgent) GrafargVersion() string

func (*UserAgent) String

func (ua *UserAgent) String() string

Jump to

Keyboard shortcuts

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