tracker

package
v0.0.0-...-d1abe37 Latest Latest
Warning

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

Go to latest
Published: Oct 15, 2019 License: MIT Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Tracker

type Tracker struct {
	Payload WCSPayload // payload structure kv pair

	Id        string    // id of what we're tracking.
	Subject   string    // ideally a way of associating page hits to a unique visit
	Timestamp time.Time // time stamp (of tracker creation)
	Version   int       // tracker version
}

func Deserialize

func Deserialize(data string) *Tracker

Deserialize takes an encoded string and returns a tracker.

func NewTracker

func NewTracker(p *WCSPayload, id string, subject string) *Tracker

Allocate and return a new Tracker. Requires a payload, id and subject.

func (*Tracker) AddPayload

func (t *Tracker) AddPayload(p *WCSPayload)

Add accepts a WCSPayload from a map[string]string kv pair and initializes the tracker's payload.

func (*Tracker) AddProperty

func (t *Tracker) AddProperty(key string, value string)

AddProperty adds a property from the payload, if the property for the tracker exists. ex: t.AddProperty("Subject", "www.example.biz")

func (*Tracker) Print

func (t *Tracker) Print()

Print prints diagnostic information about the tracker and payload.

func (*Tracker) Serialize

func (t *Tracker) Serialize() string

Serialize the tracker and return a string.

type UAReferenceTracker

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

UAReferenceTracker is a reference struct that is not used. This is not how we want to do things, and is only provided as a brief reference subset. For a similar set of values in katric, we may want to make use of gorilla scheme to save pairs to structs.

type WCSPayload

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

WCSPayload provides the most flexibility to arbitrarily inject key/value pairs which ultimately go into a nosql store (a wide column store) for analytics.

func NewPayload

func NewPayload(urldict map[string][]string) *WCSPayload

Allocate and return a new WCSPayload, accepts a map[string][]string from net/url ParseQuery.

func (*WCSPayload) Add

func (p *WCSPayload) Add(key string, value string)

Add accepts a key value pair and adds them to the store. If either key or value is empty, discard the pair. If the key is not valid, discard.

func (*WCSPayload) AddDict

func (p *WCSPayload) AddDict(wcs map[string]string)

AddDict accepts a map of key value pairs and adds them to the store

func (*WCSPayload) AddURLDict

func (p *WCSPayload) AddURLDict(m map[string][]string)

AddURLDict takes a map[string][]string, (from net/url ParseQuery, for example) and adds the key value pair

func (*WCSPayload) Get

func (p *WCSPayload) Get(key string) string

Get accepts a key and returns a value from the store.

Jump to

Keyboard shortcuts

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