goreferrer: github.com/Shopify/goreferrer Index | Files

package goreferrer

import "github.com/Shopify/goreferrer"

Index

Package Files

default_rules.go referrer.go rich_url.go rules.go

func LoadJsonDomainRules Uses

func LoadJsonDomainRules(reader io.Reader) (map[string]DomainRule, error)

type DomainRule Uses

type DomainRule struct {
    Type       ReferrerType
    Label      string
    Domain     string
    Parameters []string
}

type GoogleSearchType Uses

type GoogleSearchType int
const (
    NotGoogleSearch GoogleSearchType = iota
    OrganicSearch
    Adwords
)

func (GoogleSearchType) String Uses

func (g GoogleSearchType) String() string

type Referrer Uses

type Referrer struct {
    Type       ReferrerType
    Label      string
    URL        string
    Subdomain  string
    Domain     string
    Tld        string
    Path       string
    Query      string
    GoogleType GoogleSearchType
}

func (*Referrer) Host Uses

func (r *Referrer) Host() string

func (*Referrer) RegisteredDomain Uses

func (r *Referrer) RegisteredDomain() string

type ReferrerType Uses

type ReferrerType int
const (
    Invalid ReferrerType = iota
    Indirect
    Direct
    Email
    Search
    Social
)

func (ReferrerType) String Uses

func (r ReferrerType) String() string

type RuleSet Uses

type RuleSet struct {
    DomainRules map[string]DomainRule
    UaRules     map[string]UaRule
}
var DefaultRules RuleSet

func NewRuleSet Uses

func NewRuleSet() RuleSet

func (RuleSet) Merge Uses

func (r RuleSet) Merge(other RuleSet)

func (RuleSet) Parse Uses

func (r RuleSet) Parse(URL string) Referrer

func (RuleSet) ParseWith Uses

func (r RuleSet) ParseWith(URL string, domains []string, agent string) Referrer

type UaRule Uses

type UaRule struct {
    Url    string
    Domain string
    Tld    string
}

func (UaRule) RegisteredDomain Uses

func (u UaRule) RegisteredDomain() string

Package goreferrer imports 6 packages (graph) and is imported by 10 packages. Updated 2018-12-24. Refresh now. Tools for package owners.