Documentation
¶
Index ¶
Constants ¶
View Source
const ( StdEndpoint string = "https://www.googleapis.com/analytics/v3/data/ga" // standard endpoint Limit int = 5 // max requests / sec guard )
Base constants
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type CleanResponse ¶
type CleanResponse struct {
Columns []struct {
Name string `json:"name"`
CType string `json:"columnType"`
DType string `json:"dataType"`
} `json:"columnHeaders"`
Total map[string]string `json:"totalsForAllResults"`
Rows [][]string `json:"rows"`
}
Processed GA response
type Client ¶
Client is the primary Google Analytics API pull structure
func (*Client) BatchGet ¶
func (g *Client) BatchGet(requests []*Request) (responses []*CleanResponse, err error)
BatchGet runs all queries in parellel and returns the results (or times out)
type Request ¶
type Request struct {
Id string `json:"ids"`
StartDate string `json:"start-date"`
EndDate string `json:"end-date"`
Metrics string `json:"metrics"`
Dimensions string `json:"dimensions"`
Filters string `json:"filters"`
Segments string `json:"segment"`
Sort string `json:"sort"`
MaxResults int `json:"max-results"`
Attempts int
}
Request is the Google Analytics request structure
func (*Request) ToURLValues ¶
ToURLValues converts struct to url.Values struct
type Response ¶
Initial returned response
func (Response) Process ¶
func (rawResponse Response) Process() (data CleanResponse, ok bool)
type ResponseData ¶
Click to show internal directories.
Click to hide internal directories.