mirror of
https://github.com/prometheus-operator/prometheus-operator.git
synced 2025-04-21 03:38:43 +00:00
Remove analytics
This commit is contained in:
parent
f4358a8b47
commit
7e5d375f6a
19 changed files with 1 additions and 2093 deletions
|
@ -135,8 +135,6 @@ kubectl delete --ignore-not-found customresourcedefinitions \
|
|||
alertmanager.monitoring.coreos.com
|
||||
```
|
||||
|
||||
**The Prometheus Operator collects anonymous usage statistics to help us learning how the software is being used and how we can improve it. To disable collection, run the Operator with the flag `-analytics=false`**
|
||||
|
||||
## Development
|
||||
|
||||
### Prerequisites
|
||||
|
|
|
@ -30,7 +30,6 @@ import (
|
|||
"golang.org/x/sync/errgroup"
|
||||
|
||||
"github.com/coreos/prometheus-operator/pkg/alertmanager"
|
||||
"github.com/coreos/prometheus-operator/pkg/analytics"
|
||||
"github.com/coreos/prometheus-operator/pkg/api"
|
||||
"github.com/coreos/prometheus-operator/pkg/k8sutil"
|
||||
"github.com/coreos/prometheus-operator/pkg/migrator"
|
||||
|
@ -39,8 +38,7 @@ import (
|
|||
)
|
||||
|
||||
var (
|
||||
cfg prometheuscontroller.Config
|
||||
analyticsEnabled bool
|
||||
cfg prometheuscontroller.Config
|
||||
)
|
||||
|
||||
func init() {
|
||||
|
@ -52,7 +50,6 @@ func init() {
|
|||
flagset.StringVar(&cfg.TLSConfig.CAFile, "ca-file", "", "- NOT RECOMMENDED FOR PRODUCTION - Path to TLS CA file.")
|
||||
flagset.StringVar(&cfg.KubeletObject, "kubelet-service", "", "Service/Endpoints object to write kubelets into in format \"namespace/name\"")
|
||||
flagset.BoolVar(&cfg.TLSInsecure, "tls-insecure", false, "- NOT RECOMMENDED FOR PRODUCTION - Don't verify API server's CA certificate.")
|
||||
flagset.BoolVar(&analyticsEnabled, "analytics", true, "Send analytical event (Cluster Created/Deleted etc.) to Google Analytics")
|
||||
flagset.StringVar(&cfg.PrometheusConfigReloader, "prometheus-config-reloader", "quay.io/coreos/prometheus-config-reloader:v0.0.2", "Config and rule reload image")
|
||||
flagset.StringVar(&cfg.ConfigReloaderImage, "config-reloader-image", "quay.io/coreos/configmap-reload:v0.0.1", "Reload Image")
|
||||
flagset.StringVar(&cfg.AlertmanagerDefaultBaseImage, "alertmanager-default-base-image", "quay.io/prometheus/alertmanager", "Alertmanager default base image")
|
||||
|
@ -68,10 +65,6 @@ func Main() int {
|
|||
r := prometheus.NewRegistry()
|
||||
r.MustRegister(prometheus.NewGoCollector())
|
||||
|
||||
if analyticsEnabled {
|
||||
analytics.Enable()
|
||||
}
|
||||
|
||||
po, err := prometheuscontroller.New(cfg, logger.With("component", "prometheusoperator"))
|
||||
if err != nil {
|
||||
fmt.Fprint(os.Stderr, "instantiating prometheus controller failed: ", err)
|
||||
|
|
|
@ -20,7 +20,6 @@ import (
|
|||
"strings"
|
||||
"time"
|
||||
|
||||
"github.com/coreos/prometheus-operator/pkg/analytics"
|
||||
"github.com/coreos/prometheus-operator/pkg/client/monitoring"
|
||||
monitoringv1 "github.com/coreos/prometheus-operator/pkg/client/monitoring/v1"
|
||||
"github.com/coreos/prometheus-operator/pkg/k8sutil"
|
||||
|
@ -305,7 +304,6 @@ func (c *Operator) handleAlertmanagerAdd(obj interface{}) {
|
|||
return
|
||||
}
|
||||
|
||||
analytics.AlertmanagerCreated()
|
||||
c.logger.Log("msg", "Alertmanager added", "key", key)
|
||||
c.enqueue(key)
|
||||
}
|
||||
|
@ -316,7 +314,6 @@ func (c *Operator) handleAlertmanagerDelete(obj interface{}) {
|
|||
return
|
||||
}
|
||||
|
||||
analytics.AlertmanagerDeleted()
|
||||
c.logger.Log("msg", "Alertmanager deleted", "key", key)
|
||||
c.enqueue(key)
|
||||
}
|
||||
|
|
|
@ -1,79 +0,0 @@
|
|||
// Copyright 2016 The prometheus-operator Authors
|
||||
//
|
||||
// Licensed under the Apache License, Version 2.0 (the "License");
|
||||
// you may not use this file except in compliance with the License.
|
||||
// You may obtain a copy of the License at
|
||||
//
|
||||
// http://www.apache.org/licenses/LICENSE-2.0
|
||||
//
|
||||
// Unless required by applicable law or agreed to in writing, software
|
||||
// distributed under the License is distributed on an "AS IS" BASIS,
|
||||
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
// See the License for the specific language governing permissions and
|
||||
// limitations under the License.
|
||||
|
||||
package analytics
|
||||
|
||||
import (
|
||||
"sync"
|
||||
|
||||
ga "github.com/jpillora/go-ogle-analytics"
|
||||
)
|
||||
|
||||
const (
|
||||
id = "UA-42684979-8"
|
||||
category = "prometheus-operator"
|
||||
)
|
||||
|
||||
var (
|
||||
mu sync.Mutex
|
||||
client *ga.Client
|
||||
)
|
||||
|
||||
func Enable() {
|
||||
mu.Lock()
|
||||
defer mu.Unlock()
|
||||
client = mustNewClient()
|
||||
}
|
||||
|
||||
func Disable() {
|
||||
mu.Lock()
|
||||
defer mu.Unlock()
|
||||
client = nil
|
||||
}
|
||||
|
||||
func send(e *ga.Event) {
|
||||
mu.Lock()
|
||||
c := client
|
||||
mu.Unlock()
|
||||
|
||||
if c == nil {
|
||||
return
|
||||
}
|
||||
// error is ignored intentionally. we try to send event to GA in a best effort approach.
|
||||
c.Send(e)
|
||||
}
|
||||
|
||||
func mustNewClient() *ga.Client {
|
||||
client, err := ga.NewClient(id)
|
||||
if err != nil {
|
||||
panic(err)
|
||||
}
|
||||
return client
|
||||
}
|
||||
|
||||
func PrometheusCreated() {
|
||||
send(ga.NewEvent(category, "prometheus_created"))
|
||||
}
|
||||
|
||||
func PrometheusDeleted() {
|
||||
send(ga.NewEvent(category, "prometheus_deleted"))
|
||||
}
|
||||
|
||||
func AlertmanagerCreated() {
|
||||
send(ga.NewEvent(category, "alertmanager_created"))
|
||||
}
|
||||
|
||||
func AlertmanagerDeleted() {
|
||||
send(ga.NewEvent(category, "alertmanager_deleted"))
|
||||
}
|
|
@ -21,7 +21,6 @@ import (
|
|||
"strings"
|
||||
"time"
|
||||
|
||||
"github.com/coreos/prometheus-operator/pkg/analytics"
|
||||
"github.com/coreos/prometheus-operator/pkg/client/monitoring"
|
||||
monitoringv1 "github.com/coreos/prometheus-operator/pkg/client/monitoring/v1"
|
||||
"github.com/coreos/prometheus-operator/pkg/k8sutil"
|
||||
|
@ -284,7 +283,6 @@ func (c *Operator) handleAddPrometheus(obj interface{}) {
|
|||
return
|
||||
}
|
||||
|
||||
analytics.PrometheusCreated()
|
||||
c.logger.Log("msg", "Prometheus added", "key", key)
|
||||
c.enqueue(key)
|
||||
}
|
||||
|
@ -295,7 +293,6 @@ func (c *Operator) handleDeletePrometheus(obj interface{}) {
|
|||
return
|
||||
}
|
||||
|
||||
analytics.PrometheusDeleted()
|
||||
c.logger.Log("msg", "Prometheus deleted", "key", key)
|
||||
c.enqueue(key)
|
||||
}
|
||||
|
|
22
vendor/github.com/jpillora/go-ogle-analytics/LICENSE
generated
vendored
22
vendor/github.com/jpillora/go-ogle-analytics/LICENSE
generated
vendored
|
@ -1,22 +0,0 @@
|
|||
MIT License
|
||||
|
||||
Copyright © 2015 dev@jpillora.com, Google Inc.
|
||||
|
||||
Permission is hereby granted, free of charge, to any person obtaining
|
||||
a copy of this software and associated documentation files (the
|
||||
'Software'), to deal in the Software without restriction, including
|
||||
without limitation the rights to use, copy, modify, merge, publish,
|
||||
distribute, sublicense, and/or sell copies of the Software, and to
|
||||
permit persons to whom the Software is furnished to do so, subject to
|
||||
the following conditions:
|
||||
|
||||
The above copyright notice and this permission notice shall be
|
||||
included in all copies or substantial portions of the Software.
|
||||
|
||||
THE SOFTWARE IS PROVIDED 'AS IS', WITHOUT WARRANTY OF ANY KIND,
|
||||
EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
|
||||
MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
|
||||
IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY
|
||||
CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
|
||||
TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
|
||||
SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
81
vendor/github.com/jpillora/go-ogle-analytics/README.md
generated
vendored
81
vendor/github.com/jpillora/go-ogle-analytics/README.md
generated
vendored
|
@ -1,81 +0,0 @@
|
|||
## Go-ogle Analytics
|
||||
|
||||
Track and monitor your Go programs for free with Google Analytics
|
||||
|
||||
The `ga` package is essentially a Go wrapper around the [Google Analytics - Measurement Protocol](https://developers.google.com/analytics/devguides/collection/protocol/v1/reference)
|
||||
|
||||
**Warning** This package is 95% generated from the [Parameter Reference](https://developers.google.com/analytics/devguides/collection/protocol/v1/parameters) so it may contain bugs - please report them. GA allows "10 million hits per month per property" and will reject requests after that.
|
||||
|
||||
### Install
|
||||
|
||||
```
|
||||
go get -v github.com/jpillora/go-ogle-analytics
|
||||
```
|
||||
|
||||
### API
|
||||
|
||||
Create a new `client` and `Send()` a 'pageview', 'screenview', 'event', 'transaction', 'item', 'social', 'exception' or 'timing' event.
|
||||
|
||||
#### http://godoc.org/github.com/jpillora/go-ogle-analytics
|
||||
|
||||
### Quick Usage
|
||||
|
||||
1. Log into GA and create a new property and note its Tracker ID
|
||||
|
||||
1. Create a `ga-test.go` file
|
||||
|
||||
``` go
|
||||
package main
|
||||
|
||||
import "github.com/jpillora/go-ogle-analytics"
|
||||
|
||||
func main() {
|
||||
client, err := ga.NewClient("UA-XXXXXXXX-Y")
|
||||
if err != nil {
|
||||
panic(err)
|
||||
}
|
||||
|
||||
err = client.Send(ga.NewEvent("Foo", "Bar").Label("Bazz"))
|
||||
if err != nil {
|
||||
panic(err)
|
||||
}
|
||||
|
||||
println("Event fired!")
|
||||
}
|
||||
```
|
||||
|
||||
1. In GA, go to Real-time > Events
|
||||
|
||||
1. Run `ga-test.go`
|
||||
|
||||
```
|
||||
$ go run ga-test.go
|
||||
Event fired!
|
||||
```
|
||||
|
||||
1. Watch as your event appears
|
||||
|
||||

|
||||
|
||||
#### MIT License
|
||||
|
||||
Copyright © 2015 <dev@jpillora.com>
|
||||
|
||||
Permission is hereby granted, free of charge, to any person obtaining
|
||||
a copy of this software and associated documentation files (the
|
||||
'Software'), to deal in the Software without restriction, including
|
||||
without limitation the rights to use, copy, modify, merge, publish,
|
||||
distribute, sublicense, and/or sell copies of the Software, and to
|
||||
permit persons to whom the Software is furnished to do so, subject to
|
||||
the following conditions:
|
||||
|
||||
The above copyright notice and this permission notice shall be
|
||||
included in all copies or substantial portions of the Software.
|
||||
|
||||
THE SOFTWARE IS PROVIDED 'AS IS', WITHOUT WARRANTY OF ANY KIND,
|
||||
EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
|
||||
MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
|
||||
IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY
|
||||
CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
|
||||
TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
|
||||
SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
76
vendor/github.com/jpillora/go-ogle-analytics/client.go
generated
vendored
76
vendor/github.com/jpillora/go-ogle-analytics/client.go
generated
vendored
|
@ -1,76 +0,0 @@
|
|||
//go:generate go run generate/protocol.go
|
||||
|
||||
package ga
|
||||
|
||||
import (
|
||||
"bytes"
|
||||
"fmt"
|
||||
"net/http"
|
||||
"net/url"
|
||||
"regexp"
|
||||
)
|
||||
|
||||
var trackingIDMatcher = regexp.MustCompile(`^UA-\d+-\d+$`)
|
||||
|
||||
func NewClient(trackingID string) (*Client, error) {
|
||||
if !trackingIDMatcher.MatchString(trackingID) {
|
||||
return nil, fmt.Errorf("Invalid Tracking ID: %s", trackingID)
|
||||
}
|
||||
return &Client{
|
||||
UseTLS: true,
|
||||
HttpClient: http.DefaultClient,
|
||||
protocolVersion: "1",
|
||||
protocolVersionSet: true,
|
||||
trackingID: trackingID,
|
||||
clientID: "go-ga",
|
||||
clientIDSet: true,
|
||||
}, nil
|
||||
}
|
||||
|
||||
type hitType interface {
|
||||
addFields(url.Values) error
|
||||
}
|
||||
|
||||
func (c *Client) Send(h hitType) error {
|
||||
|
||||
cpy := c.Copy()
|
||||
|
||||
v := url.Values{}
|
||||
|
||||
cpy.setType(h)
|
||||
|
||||
err := cpy.addFields(v)
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
|
||||
err = h.addFields(v)
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
|
||||
url := ""
|
||||
if cpy.UseTLS {
|
||||
url = "https://www.google-analytics.com/collect"
|
||||
} else {
|
||||
url = "http://ssl.google-analytics.com/collect"
|
||||
}
|
||||
|
||||
str := v.Encode()
|
||||
buf := bytes.NewBufferString(str)
|
||||
|
||||
resp, err := c.HttpClient.Post(url, "application/x-www-form-urlencoded", buf)
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
|
||||
defer resp.Body.Close()
|
||||
|
||||
if resp.StatusCode/100 != 2 {
|
||||
return fmt.Errorf("Rejected by Google with code %d", resp.StatusCode)
|
||||
}
|
||||
|
||||
// fmt.Printf("POST %s => %d\n", str, resp.StatusCode)
|
||||
|
||||
return nil
|
||||
}
|
19
vendor/github.com/jpillora/go-ogle-analytics/conv.go
generated
vendored
19
vendor/github.com/jpillora/go-ogle-analytics/conv.go
generated
vendored
|
@ -1,19 +0,0 @@
|
|||
package ga
|
||||
|
||||
import "fmt"
|
||||
|
||||
func bool2str(val bool) string {
|
||||
if val {
|
||||
return "1"
|
||||
} else {
|
||||
return "0"
|
||||
}
|
||||
}
|
||||
|
||||
func int2str(val int64) string {
|
||||
return fmt.Sprintf("%d", val)
|
||||
}
|
||||
|
||||
func float2str(val float64) string {
|
||||
return fmt.Sprintf("%.6f", val)
|
||||
}
|
1228
vendor/github.com/jpillora/go-ogle-analytics/type-client.go
generated
vendored
1228
vendor/github.com/jpillora/go-ogle-analytics/type-client.go
generated
vendored
File diff suppressed because it is too large
Load diff
58
vendor/github.com/jpillora/go-ogle-analytics/type-event.go
generated
vendored
58
vendor/github.com/jpillora/go-ogle-analytics/type-event.go
generated
vendored
|
@ -1,58 +0,0 @@
|
|||
package ga
|
||||
|
||||
import "net/url"
|
||||
|
||||
//WARNING: This file was generated. Do not edit.
|
||||
|
||||
//Event Hit Type
|
||||
type Event struct {
|
||||
category string
|
||||
action string
|
||||
label string
|
||||
labelSet bool
|
||||
value int64
|
||||
valueSet bool
|
||||
}
|
||||
|
||||
// NewEvent creates a new Event Hit Type.
|
||||
// Specifies the event category.
|
||||
// Specifies the event action.
|
||||
|
||||
func NewEvent(category string, action string) *Event {
|
||||
h := &Event{
|
||||
category: category,
|
||||
action: action,
|
||||
}
|
||||
return h
|
||||
}
|
||||
|
||||
func (h *Event) addFields(v url.Values) error {
|
||||
v.Add("ec", h.category)
|
||||
v.Add("ea", h.action)
|
||||
if h.labelSet {
|
||||
v.Add("el", h.label)
|
||||
}
|
||||
if h.valueSet {
|
||||
v.Add("ev", int2str(h.value))
|
||||
}
|
||||
return nil
|
||||
}
|
||||
|
||||
// Specifies the event label.
|
||||
func (h *Event) Label(label string) *Event {
|
||||
h.label = label
|
||||
h.labelSet = true
|
||||
return h
|
||||
}
|
||||
|
||||
// Specifies the event value. Values must be non-negative.
|
||||
func (h *Event) Value(value int64) *Event {
|
||||
h.value = value
|
||||
h.valueSet = true
|
||||
return h
|
||||
}
|
||||
|
||||
func (h *Event) Copy() *Event {
|
||||
c := *h
|
||||
return &c
|
||||
}
|
49
vendor/github.com/jpillora/go-ogle-analytics/type-exception.go
generated
vendored
49
vendor/github.com/jpillora/go-ogle-analytics/type-exception.go
generated
vendored
|
@ -1,49 +0,0 @@
|
|||
package ga
|
||||
|
||||
import "net/url"
|
||||
|
||||
//WARNING: This file was generated. Do not edit.
|
||||
|
||||
//Exception Hit Type
|
||||
type Exception struct {
|
||||
description string
|
||||
descriptionSet bool
|
||||
isExceptionFatal bool
|
||||
isExceptionFatalSet bool
|
||||
}
|
||||
|
||||
// NewException creates a new Exception Hit Type.
|
||||
|
||||
func NewException() *Exception {
|
||||
h := &Exception{}
|
||||
return h
|
||||
}
|
||||
|
||||
func (h *Exception) addFields(v url.Values) error {
|
||||
if h.descriptionSet {
|
||||
v.Add("exd", h.description)
|
||||
}
|
||||
if h.isExceptionFatalSet {
|
||||
v.Add("exf", bool2str(h.isExceptionFatal))
|
||||
}
|
||||
return nil
|
||||
}
|
||||
|
||||
// Specifies the description of an exception.
|
||||
func (h *Exception) Description(description string) *Exception {
|
||||
h.description = description
|
||||
h.descriptionSet = true
|
||||
return h
|
||||
}
|
||||
|
||||
// Specifies whether the exception was fatal.
|
||||
func (h *Exception) IsExceptionFatal(isExceptionFatal bool) *Exception {
|
||||
h.isExceptionFatal = isExceptionFatal
|
||||
h.isExceptionFatalSet = true
|
||||
return h
|
||||
}
|
||||
|
||||
func (h *Exception) Copy() *Exception {
|
||||
c := *h
|
||||
return &c
|
||||
}
|
98
vendor/github.com/jpillora/go-ogle-analytics/type-item.go
generated
vendored
98
vendor/github.com/jpillora/go-ogle-analytics/type-item.go
generated
vendored
|
@ -1,98 +0,0 @@
|
|||
package ga
|
||||
|
||||
import "net/url"
|
||||
|
||||
//WARNING: This file was generated. Do not edit.
|
||||
|
||||
//Item Hit Type
|
||||
type Item struct {
|
||||
iD string
|
||||
name string
|
||||
price float64
|
||||
priceSet bool
|
||||
quantity int64
|
||||
quantitySet bool
|
||||
code string
|
||||
codeSet bool
|
||||
category string
|
||||
categorySet bool
|
||||
currencyCode string
|
||||
currencyCodeSet bool
|
||||
}
|
||||
|
||||
// NewItem creates a new Item Hit Type.
|
||||
// A unique identifier for the transaction. This value should
|
||||
// be the same for both the Transaction hit and Items hits
|
||||
// associated to the particular transaction.
|
||||
// Specifies the item name.
|
||||
|
||||
func NewItem(iD string, name string) *Item {
|
||||
h := &Item{
|
||||
iD: iD,
|
||||
name: name,
|
||||
}
|
||||
return h
|
||||
}
|
||||
|
||||
func (h *Item) addFields(v url.Values) error {
|
||||
v.Add("ti", h.iD)
|
||||
v.Add("in", h.name)
|
||||
if h.priceSet {
|
||||
v.Add("ip", float2str(h.price))
|
||||
}
|
||||
if h.quantitySet {
|
||||
v.Add("iq", int2str(h.quantity))
|
||||
}
|
||||
if h.codeSet {
|
||||
v.Add("ic", h.code)
|
||||
}
|
||||
if h.categorySet {
|
||||
v.Add("iv", h.category)
|
||||
}
|
||||
if h.currencyCodeSet {
|
||||
v.Add("cu", h.currencyCode)
|
||||
}
|
||||
return nil
|
||||
}
|
||||
|
||||
// Specifies the price for a single item / unit.
|
||||
func (h *Item) Price(price float64) *Item {
|
||||
h.price = price
|
||||
h.priceSet = true
|
||||
return h
|
||||
}
|
||||
|
||||
// Specifies the number of items purchased.
|
||||
func (h *Item) Quantity(quantity int64) *Item {
|
||||
h.quantity = quantity
|
||||
h.quantitySet = true
|
||||
return h
|
||||
}
|
||||
|
||||
// Specifies the SKU or item code.
|
||||
func (h *Item) Code(code string) *Item {
|
||||
h.code = code
|
||||
h.codeSet = true
|
||||
return h
|
||||
}
|
||||
|
||||
// Specifies the category that the item belongs to.
|
||||
func (h *Item) Category(category string) *Item {
|
||||
h.category = category
|
||||
h.categorySet = true
|
||||
return h
|
||||
}
|
||||
|
||||
// When present indicates the local currency for all transaction
|
||||
// currency values. Value should be a valid ISO 4217 currency
|
||||
// code.
|
||||
func (h *Item) CurrencyCode(currencyCode string) *Item {
|
||||
h.currencyCode = currencyCode
|
||||
h.currencyCodeSet = true
|
||||
return h
|
||||
}
|
||||
|
||||
func (h *Item) Copy() *Item {
|
||||
c := *h
|
||||
return &c
|
||||
}
|
24
vendor/github.com/jpillora/go-ogle-analytics/type-pageview.go
generated
vendored
24
vendor/github.com/jpillora/go-ogle-analytics/type-pageview.go
generated
vendored
|
@ -1,24 +0,0 @@
|
|||
package ga
|
||||
|
||||
import "net/url"
|
||||
|
||||
//WARNING: This file was generated. Do not edit.
|
||||
|
||||
//Pageview Hit Type
|
||||
type Pageview struct {
|
||||
}
|
||||
|
||||
// NewPageview creates a new Pageview Hit Type.
|
||||
func NewPageview() *Pageview {
|
||||
h := &Pageview{}
|
||||
return h
|
||||
}
|
||||
|
||||
func (h *Pageview) addFields(v url.Values) error {
|
||||
return nil
|
||||
}
|
||||
|
||||
func (h *Pageview) Copy() *Pageview {
|
||||
c := *h
|
||||
return &c
|
||||
}
|
24
vendor/github.com/jpillora/go-ogle-analytics/type-screenview.go
generated
vendored
24
vendor/github.com/jpillora/go-ogle-analytics/type-screenview.go
generated
vendored
|
@ -1,24 +0,0 @@
|
|||
package ga
|
||||
|
||||
import "net/url"
|
||||
|
||||
//WARNING: This file was generated. Do not edit.
|
||||
|
||||
//Screenview Hit Type
|
||||
type Screenview struct {
|
||||
}
|
||||
|
||||
// NewScreenview creates a new Screenview Hit Type.
|
||||
func NewScreenview() *Screenview {
|
||||
h := &Screenview{}
|
||||
return h
|
||||
}
|
||||
|
||||
func (h *Screenview) addFields(v url.Values) error {
|
||||
return nil
|
||||
}
|
||||
|
||||
func (h *Screenview) Copy() *Screenview {
|
||||
c := *h
|
||||
return &c
|
||||
}
|
41
vendor/github.com/jpillora/go-ogle-analytics/type-social.go
generated
vendored
41
vendor/github.com/jpillora/go-ogle-analytics/type-social.go
generated
vendored
|
@ -1,41 +0,0 @@
|
|||
package ga
|
||||
|
||||
import "net/url"
|
||||
|
||||
//WARNING: This file was generated. Do not edit.
|
||||
|
||||
//Social Hit Type
|
||||
type Social struct {
|
||||
network string
|
||||
action string
|
||||
actionTarget string
|
||||
}
|
||||
|
||||
// NewSocial creates a new Social Hit Type.
|
||||
// Specifies the social network, for example Facebook or Google
|
||||
// Plus.
|
||||
// Specifies the social interaction action. For example on
|
||||
// Google Plus when a user clicks the +1 button, the social
|
||||
// action is 'plus'.
|
||||
// Specifies the target of a social interaction. This value
|
||||
// is typically a URL but can be any text.
|
||||
func NewSocial(network string, action string, actionTarget string) *Social {
|
||||
h := &Social{
|
||||
network: network,
|
||||
action: action,
|
||||
actionTarget: actionTarget,
|
||||
}
|
||||
return h
|
||||
}
|
||||
|
||||
func (h *Social) addFields(v url.Values) error {
|
||||
v.Add("sn", h.network)
|
||||
v.Add("sa", h.action)
|
||||
v.Add("st", h.actionTarget)
|
||||
return nil
|
||||
}
|
||||
|
||||
func (h *Social) Copy() *Social {
|
||||
c := *h
|
||||
return &c
|
||||
}
|
177
vendor/github.com/jpillora/go-ogle-analytics/type-timing.go
generated
vendored
177
vendor/github.com/jpillora/go-ogle-analytics/type-timing.go
generated
vendored
|
@ -1,177 +0,0 @@
|
|||
package ga
|
||||
|
||||
import "net/url"
|
||||
|
||||
//WARNING: This file was generated. Do not edit.
|
||||
|
||||
//Timing Hit Type
|
||||
type Timing struct {
|
||||
userTimingCategory string
|
||||
userTimingCategorySet bool
|
||||
userTimingVariableName string
|
||||
userTimingVariableNameSet bool
|
||||
userTimingTime int64
|
||||
userTimingTimeSet bool
|
||||
userTimingLabel string
|
||||
userTimingLabelSet bool
|
||||
pageLoadTime int64
|
||||
pageLoadTimeSet bool
|
||||
dNSTime int64
|
||||
dNSTimeSet bool
|
||||
pageDownloadTime int64
|
||||
pageDownloadTimeSet bool
|
||||
redirectResponseTime int64
|
||||
redirectResponseTimeSet bool
|
||||
tCPConnectTime int64
|
||||
tCPConnectTimeSet bool
|
||||
serverResponseTime int64
|
||||
serverResponseTimeSet bool
|
||||
dOMInteractiveTime int64
|
||||
dOMInteractiveTimeSet bool
|
||||
contentLoadTime int64
|
||||
contentLoadTimeSet bool
|
||||
}
|
||||
|
||||
// NewTiming creates a new Timing Hit Type.
|
||||
|
||||
func NewTiming() *Timing {
|
||||
h := &Timing{}
|
||||
return h
|
||||
}
|
||||
|
||||
func (h *Timing) addFields(v url.Values) error {
|
||||
if h.userTimingCategorySet {
|
||||
v.Add("utc", h.userTimingCategory)
|
||||
}
|
||||
if h.userTimingVariableNameSet {
|
||||
v.Add("utv", h.userTimingVariableName)
|
||||
}
|
||||
if h.userTimingTimeSet {
|
||||
v.Add("utt", int2str(h.userTimingTime))
|
||||
}
|
||||
if h.userTimingLabelSet {
|
||||
v.Add("utl", h.userTimingLabel)
|
||||
}
|
||||
if h.pageLoadTimeSet {
|
||||
v.Add("plt", int2str(h.pageLoadTime))
|
||||
}
|
||||
if h.dNSTimeSet {
|
||||
v.Add("dns", int2str(h.dNSTime))
|
||||
}
|
||||
if h.pageDownloadTimeSet {
|
||||
v.Add("pdt", int2str(h.pageDownloadTime))
|
||||
}
|
||||
if h.redirectResponseTimeSet {
|
||||
v.Add("rrt", int2str(h.redirectResponseTime))
|
||||
}
|
||||
if h.tCPConnectTimeSet {
|
||||
v.Add("tcp", int2str(h.tCPConnectTime))
|
||||
}
|
||||
if h.serverResponseTimeSet {
|
||||
v.Add("srt", int2str(h.serverResponseTime))
|
||||
}
|
||||
if h.dOMInteractiveTimeSet {
|
||||
v.Add("dit", int2str(h.dOMInteractiveTime))
|
||||
}
|
||||
if h.contentLoadTimeSet {
|
||||
v.Add("clt", int2str(h.contentLoadTime))
|
||||
}
|
||||
return nil
|
||||
}
|
||||
|
||||
// Specifies the user timing category.
|
||||
func (h *Timing) UserTimingCategory(userTimingCategory string) *Timing {
|
||||
h.userTimingCategory = userTimingCategory
|
||||
h.userTimingCategorySet = true
|
||||
return h
|
||||
}
|
||||
|
||||
// Specifies the user timing variable.
|
||||
func (h *Timing) UserTimingVariableName(userTimingVariableName string) *Timing {
|
||||
h.userTimingVariableName = userTimingVariableName
|
||||
h.userTimingVariableNameSet = true
|
||||
return h
|
||||
}
|
||||
|
||||
// Specifies the user timing value. The value is in milliseconds.
|
||||
func (h *Timing) UserTimingTime(userTimingTime int64) *Timing {
|
||||
h.userTimingTime = userTimingTime
|
||||
h.userTimingTimeSet = true
|
||||
return h
|
||||
}
|
||||
|
||||
// Specifies the user timing label.
|
||||
func (h *Timing) UserTimingLabel(userTimingLabel string) *Timing {
|
||||
h.userTimingLabel = userTimingLabel
|
||||
h.userTimingLabelSet = true
|
||||
return h
|
||||
}
|
||||
|
||||
// Specifies the time it took for a page to load. The value
|
||||
// is in milliseconds.
|
||||
func (h *Timing) PageLoadTime(pageLoadTime int64) *Timing {
|
||||
h.pageLoadTime = pageLoadTime
|
||||
h.pageLoadTimeSet = true
|
||||
return h
|
||||
}
|
||||
|
||||
// Specifies the time it took to do a DNS lookup.The value
|
||||
// is in milliseconds.
|
||||
func (h *Timing) DNSTime(dNSTime int64) *Timing {
|
||||
h.dNSTime = dNSTime
|
||||
h.dNSTimeSet = true
|
||||
return h
|
||||
}
|
||||
|
||||
// Specifies the time it took for the page to be downloaded.
|
||||
// The value is in milliseconds.
|
||||
func (h *Timing) PageDownloadTime(pageDownloadTime int64) *Timing {
|
||||
h.pageDownloadTime = pageDownloadTime
|
||||
h.pageDownloadTimeSet = true
|
||||
return h
|
||||
}
|
||||
|
||||
// Specifies the time it took for any redirects to happen.
|
||||
// The value is in milliseconds.
|
||||
func (h *Timing) RedirectResponseTime(redirectResponseTime int64) *Timing {
|
||||
h.redirectResponseTime = redirectResponseTime
|
||||
h.redirectResponseTimeSet = true
|
||||
return h
|
||||
}
|
||||
|
||||
// Specifies the time it took for a TCP connection to be made.
|
||||
// The value is in milliseconds.
|
||||
func (h *Timing) TCPConnectTime(tCPConnectTime int64) *Timing {
|
||||
h.tCPConnectTime = tCPConnectTime
|
||||
h.tCPConnectTimeSet = true
|
||||
return h
|
||||
}
|
||||
|
||||
// Specifies the time it took for the server to respond after
|
||||
// the connect time. The value is in milliseconds.
|
||||
func (h *Timing) ServerResponseTime(serverResponseTime int64) *Timing {
|
||||
h.serverResponseTime = serverResponseTime
|
||||
h.serverResponseTimeSet = true
|
||||
return h
|
||||
}
|
||||
|
||||
// Specifies the time it took for Document.readyState to be
|
||||
// 'interactive'. The value is in milliseconds.
|
||||
func (h *Timing) DOMInteractiveTime(dOMInteractiveTime int64) *Timing {
|
||||
h.dOMInteractiveTime = dOMInteractiveTime
|
||||
h.dOMInteractiveTimeSet = true
|
||||
return h
|
||||
}
|
||||
|
||||
// Specifies the time it took for the DOMContentLoaded Event
|
||||
// to fire. The value is in milliseconds.
|
||||
func (h *Timing) ContentLoadTime(contentLoadTime int64) *Timing {
|
||||
h.contentLoadTime = contentLoadTime
|
||||
h.contentLoadTimeSet = true
|
||||
return h
|
||||
}
|
||||
|
||||
func (h *Timing) Copy() *Timing {
|
||||
c := *h
|
||||
return &c
|
||||
}
|
95
vendor/github.com/jpillora/go-ogle-analytics/type-transaction.go
generated
vendored
95
vendor/github.com/jpillora/go-ogle-analytics/type-transaction.go
generated
vendored
|
@ -1,95 +0,0 @@
|
|||
package ga
|
||||
|
||||
import "net/url"
|
||||
|
||||
//WARNING: This file was generated. Do not edit.
|
||||
|
||||
//Transaction Hit Type
|
||||
type Transaction struct {
|
||||
iD string
|
||||
affiliation string
|
||||
affiliationSet bool
|
||||
revenue float64
|
||||
revenueSet bool
|
||||
shipping float64
|
||||
shippingSet bool
|
||||
tax float64
|
||||
taxSet bool
|
||||
currencyCode string
|
||||
currencyCodeSet bool
|
||||
}
|
||||
|
||||
// NewTransaction creates a new Transaction Hit Type.
|
||||
// A unique identifier for the transaction. This value should
|
||||
// be the same for both the Transaction hit and Items hits
|
||||
// associated to the particular transaction.
|
||||
|
||||
func NewTransaction(iD string) *Transaction {
|
||||
h := &Transaction{
|
||||
iD: iD,
|
||||
}
|
||||
return h
|
||||
}
|
||||
|
||||
func (h *Transaction) addFields(v url.Values) error {
|
||||
v.Add("ti", h.iD)
|
||||
if h.affiliationSet {
|
||||
v.Add("ta", h.affiliation)
|
||||
}
|
||||
if h.revenueSet {
|
||||
v.Add("tr", float2str(h.revenue))
|
||||
}
|
||||
if h.shippingSet {
|
||||
v.Add("ts", float2str(h.shipping))
|
||||
}
|
||||
if h.taxSet {
|
||||
v.Add("tt", float2str(h.tax))
|
||||
}
|
||||
if h.currencyCodeSet {
|
||||
v.Add("cu", h.currencyCode)
|
||||
}
|
||||
return nil
|
||||
}
|
||||
|
||||
// Specifies the affiliation or store name.
|
||||
func (h *Transaction) Affiliation(affiliation string) *Transaction {
|
||||
h.affiliation = affiliation
|
||||
h.affiliationSet = true
|
||||
return h
|
||||
}
|
||||
|
||||
// Specifies the total revenue associated with the transaction.
|
||||
// This value should include any shipping or tax costs.
|
||||
func (h *Transaction) Revenue(revenue float64) *Transaction {
|
||||
h.revenue = revenue
|
||||
h.revenueSet = true
|
||||
return h
|
||||
}
|
||||
|
||||
// Specifies the total shipping cost of the transaction.
|
||||
func (h *Transaction) Shipping(shipping float64) *Transaction {
|
||||
h.shipping = shipping
|
||||
h.shippingSet = true
|
||||
return h
|
||||
}
|
||||
|
||||
// Specifies the total tax of the transaction.
|
||||
func (h *Transaction) Tax(tax float64) *Transaction {
|
||||
h.tax = tax
|
||||
h.taxSet = true
|
||||
return h
|
||||
}
|
||||
|
||||
// When present indicates the local currency for all transaction
|
||||
// currency values. Value should be a valid ISO 4217 currency
|
||||
// code.
|
||||
func (h *Transaction) CurrencyCode(currencyCode string) *Transaction {
|
||||
h.currencyCode = currencyCode
|
||||
h.currencyCodeSet = true
|
||||
return h
|
||||
}
|
||||
|
||||
func (h *Transaction) Copy() *Transaction {
|
||||
c := *h
|
||||
return &c
|
||||
}
|
6
vendor/vendor.json
vendored
6
vendor/vendor.json
vendored
|
@ -283,12 +283,6 @@
|
|||
"revision": "abe34e4f5b4413c282a83011892cbeea5b32223b",
|
||||
"revisionTime": "2017-06-22T03:53:14Z"
|
||||
},
|
||||
{
|
||||
"checksumSHA1": "f+svTLsUm0KFNDl8cQqPy/M7qGg=",
|
||||
"path": "github.com/jpillora/go-ogle-analytics",
|
||||
"revision": "14b04e0594ef6a9fd943363b135656f0ec8c9d0e",
|
||||
"revisionTime": "2016-12-13T08:58:24Z"
|
||||
},
|
||||
{
|
||||
"checksumSHA1": "a8Ge6pE7oxux9ZMZVAlyEeGzCng=",
|
||||
"path": "github.com/juju/ratelimit",
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue