data

package
v0.70.0 Latest Latest
Warning

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

Go to latest
Published: Oct 19, 2020 License: Apache-2.0 Imports: 15 Imported by: 0

Documentation

Overview

NOTE: This package is in alpha. It is not stable, and is likely to change.

Use of Context

The ctx passed to NewClient is used for authentication requests and for creating the underlying connection, but is not used for subsequent calls. Individual methods on the client use the ctx given to them.

To close the open connection, use the Close() method.

For information about setting deadlines, reusing contexts, and more please visit pkg.go.dev/cloud.google.com/go.

Index

Examples

Constants

This section is empty.

Variables

This section is empty.

Functions

func DefaultAuthScopes

func DefaultAuthScopes() []string

DefaultAuthScopes reports the default set of authentication scopes to use with this package.

Types

type AlphaAnalyticsDataCallOptions

type AlphaAnalyticsDataCallOptions struct {
	RunReport            []gax.CallOption
	RunPivotReport       []gax.CallOption
	BatchRunReports      []gax.CallOption
	BatchRunPivotReports []gax.CallOption
	GetUniversalMetadata []gax.CallOption
}

AlphaAnalyticsDataCallOptions contains the retry settings for each method of AlphaAnalyticsDataClient.

type AlphaAnalyticsDataClient

type AlphaAnalyticsDataClient struct {

	// The call options for this service.
	CallOptions *AlphaAnalyticsDataCallOptions
	// contains filtered or unexported fields
}

AlphaAnalyticsDataClient is a client for interacting with .

Methods, except Close, may be called concurrently. However, fields must not be modified concurrently with method calls.

func NewAlphaAnalyticsDataClient

func NewAlphaAnalyticsDataClient(ctx context.Context, opts ...option.ClientOption) (*AlphaAnalyticsDataClient, error)

NewAlphaAnalyticsDataClient creates a new alpha analytics data client.

Google Analytics reporting data service.

Example
package main

import (
	"context"

	data "cloud.google.com/go/analytics/data/apiv1alpha"
)

func main() {
	ctx := context.Background()
	c, err := data.NewAlphaAnalyticsDataClient(ctx)
	if err != nil {
		// TODO: Handle error.
	}
	// TODO: Use client.
	_ = c
}
Output:

func (*AlphaAnalyticsDataClient) BatchRunPivotReports

BatchRunPivotReports returns multiple pivot reports in a batch. All reports must be for the same Entity.

Example
package main

import (
	"context"

	data "cloud.google.com/go/analytics/data/apiv1alpha"
	datapb "google.golang.org/genproto/googleapis/analytics/data/v1alpha"
)

func main() {
	// import datapb "google.golang.org/genproto/googleapis/analytics/data/v1alpha"

	ctx := context.Background()
	c, err := data.NewAlphaAnalyticsDataClient(ctx)
	if err != nil {
		// TODO: Handle error.
	}

	req := &datapb.BatchRunPivotReportsRequest{
		// TODO: Fill request struct fields.
	}
	resp, err := c.BatchRunPivotReports(ctx, req)
	if err != nil {
		// TODO: Handle error.
	}
	// TODO: Use resp.
	_ = resp
}
Output:

func (*AlphaAnalyticsDataClient) BatchRunReports

BatchRunReports returns multiple reports in a batch. All reports must be for the same Entity.

Example
package main

import (
	"context"

	data "cloud.google.com/go/analytics/data/apiv1alpha"
	datapb "google.golang.org/genproto/googleapis/analytics/data/v1alpha"
)

func main() {
	// import datapb "google.golang.org/genproto/googleapis/analytics/data/v1alpha"

	ctx := context.Background()
	c, err := data.NewAlphaAnalyticsDataClient(ctx)
	if err != nil {
		// TODO: Handle error.
	}

	req := &datapb.BatchRunReportsRequest{
		// TODO: Fill request struct fields.
	}
	resp, err := c.BatchRunReports(ctx, req)
	if err != nil {
		// TODO: Handle error.
	}
	// TODO: Use resp.
	_ = resp
}
Output:

func (*AlphaAnalyticsDataClient) Close

func (c *AlphaAnalyticsDataClient) Close() error

Close closes the connection to the API service. The user should invoke this when the client is no longer required.

func (*AlphaAnalyticsDataClient) Connection

func (c *AlphaAnalyticsDataClient) Connection() *grpc.ClientConn

Connection returns a connection to the API service.

Deprecated.

func (*AlphaAnalyticsDataClient) GetUniversalMetadata added in v0.69.0

GetUniversalMetadata returns metadata for dimensions and metrics available in reporting methods. Used to explore the dimensions and metrics. Dimensions and metrics will be mostly added over time, but renames and deletions may occur.

This method returns Universal Metadata. Universal Metadata are dimensions and metrics applicable to any property such as country and totalUsers.

Example
package main

import (
	"context"

	data "cloud.google.com/go/analytics/data/apiv1alpha"
	datapb "google.golang.org/genproto/googleapis/analytics/data/v1alpha"
)

func main() {
	// import datapb "google.golang.org/genproto/googleapis/analytics/data/v1alpha"

	ctx := context.Background()
	c, err := data.NewAlphaAnalyticsDataClient(ctx)
	if err != nil {
		// TODO: Handle error.
	}

	req := &datapb.GetUniversalMetadataRequest{
		// TODO: Fill request struct fields.
	}
	resp, err := c.GetUniversalMetadata(ctx, req)
	if err != nil {
		// TODO: Handle error.
	}
	// TODO: Use resp.
	_ = resp
}
Output:

func (*AlphaAnalyticsDataClient) RunPivotReport

RunPivotReport returns a customized pivot report of your Google Analytics event data. Pivot reports are more advanced and expressive formats than regular reports. In a pivot report, dimensions are only visible if they are included in a pivot. Multiple pivots can be specified to further dissect your data.

Example
package main

import (
	"context"

	data "cloud.google.com/go/analytics/data/apiv1alpha"
	datapb "google.golang.org/genproto/googleapis/analytics/data/v1alpha"
)

func main() {
	// import datapb "google.golang.org/genproto/googleapis/analytics/data/v1alpha"

	ctx := context.Background()
	c, err := data.NewAlphaAnalyticsDataClient(ctx)
	if err != nil {
		// TODO: Handle error.
	}

	req := &datapb.RunPivotReportRequest{
		// TODO: Fill request struct fields.
	}
	resp, err := c.RunPivotReport(ctx, req)
	if err != nil {
		// TODO: Handle error.
	}
	// TODO: Use resp.
	_ = resp
}
Output:

func (*AlphaAnalyticsDataClient) RunReport

RunReport returns a customized report of your Google Analytics event data. Reports contain statistics derived from data collected by the Google Analytics tracking code. The data returned from the API is as a table with columns for the requested dimensions and metrics. Metrics are individual measurements of user activity on your property, such as active users or event count. Dimensions break down metrics across some common criteria, such as country or event name.

Example
package main

import (
	"context"

	data "cloud.google.com/go/analytics/data/apiv1alpha"
	datapb "google.golang.org/genproto/googleapis/analytics/data/v1alpha"
)

func main() {
	// import datapb "google.golang.org/genproto/googleapis/analytics/data/v1alpha"

	ctx := context.Background()
	c, err := data.NewAlphaAnalyticsDataClient(ctx)
	if err != nil {
		// TODO: Handle error.
	}

	req := &datapb.RunReportRequest{
		// TODO: Fill request struct fields.
	}
	resp, err := c.RunReport(ctx, req)
	if err != nil {
		// TODO: Handle error.
	}
	// TODO: Use resp.
	_ = resp
}
Output:

Jump to

Keyboard shortcuts

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