donottrack

package module
v1.0.0 Latest Latest
Warning

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

Go to latest
Published: Jun 8, 2018 License: GPL-3.0 Imports: 1 Imported by: 0

README

donottrack

A simple package which let you handle with Do Not Track settings of clients

Documentation

Overview

Package donottrack is a small helper package for reading the DoNotTrack flag out of the http.Request. More Information about the DoNotTrack Header can be found at https://en.wikipedia.org/wiki/Do_Not_Track

If a user sets the DoNotTrack option inside the browser you could not render elements, which would track the user. For example you could not show ads or you could not use external fonts.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func IsSet

func IsSet(r *http.Request) bool

IsSet returns true if a do not track option is set by the browser in every other case it returns false If you need more controll over the options you should use the Request() function.

Types

type Option

type Option int
const (
	// OptIn is used, when the user allows tracking
	OptIn Option = iota
	// OptOut is used, when no tracking for the user is allowed
	OptOut
	// NotSet if there is no DNT Element inside the header
	NotSet
)

func Request

func Request(r *http.Request) Option

Request takes a *http.Request and returns the DNT Option

Directories

Path Synopsis
examples

Jump to

Keyboard shortcuts

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