Documentation
¶
Index ¶
Constants ¶
const ( APIVersion = "v201809" DsnSep = "|" DsnOptSep = ":" )
Data source name.
Variables ¶
var ( ErrQuery = NewQueryError("missing") ErrQueryBinding = NewQueryError("binding not match") ErrNoDsn = NewConnectionError("missing data source") ErrNoNetwork = NewConnectionError("not found") ErrBadNetwork = NewConnectionError("service unavailable") ErrBadToken = NewConnectionError("invalid access token") ErrAdwordsID = NewConnectionError("adwords id") ErrDevToken = NewConnectionError("developer token") )
Error messages.
Functions ¶
func NewAPIError ¶ added in v0.1.10
NewAPIError parses a XML document that represents a download report error. It returns the given message as error.
func NewConnectionError ¶
NewConnectionError returns an error of type Connection with the given text.
func NewQueryError ¶
NewQueryError returns an error of type Internal with the given text.
Types ¶
type APIError ¶ added in v0.1.10
type APIError struct { Type string `xml:"ApiError>type"` Trigger string `xml:"ApiError>trigger"` Field string `xml:"ApiError>fieldPath"` }
APIError represents a Google Report Download Error. It voluntary ignores trigger field.
In case of error, Google Adwords API provides more information in a XML response:
<reportDownloadError> <ApiError> <type>ReportDefinitionError.CUSTOMER_SERVING_TYPE_REPORT_MISMATCH</type> <trigger></trigger> <fieldPath>selector</fieldPath> </ApiError> </reportDownloadError>
type Auth ¶
Auth contains all information to deal with an access token via OAuth Google. It implements Stringer interface
func NewAuthByClient ¶
NewAuthByClient returns an Auth struct only based on the client keys.
func NewAuthByToken ¶
NewAuthByToken returns an Auth struct only based on the access token.
type AuthKey ¶
type AuthKey struct { ClientID, ClientSecret, RefreshToken string }
AuthKey represents the keys used to retrieve an access token.
type Conn ¶
type Conn struct {
// contains filtered or unexported fields
}
Conn represents a connection to a database and implements driver.Conn.
type ConnectionError ¶
type ConnectionError struct {
// contains filtered or unexported fields
}
ConnectionError represents an connection error.
func (*ConnectionError) Error ¶
func (e *ConnectionError) Error() string
Error outputs a connection error message.
type Driver ¶
type Driver struct{}
Driver implements all methods to pretend as a sql database driver.
type Dsn ¶
type Dsn struct {
AdwordsID, APIVersion,
DeveloperToken, AccessToken,
ClientID, ClientSecret,
RefreshToken string
SkipColumnHeader,
SupportsZeroImpressions,
UseRawEnumValues bool
}
Dsn represents a data source name.
type Opts ¶
type Opts struct { Version string SkipReportHeader, SkipColumnHeader, SkipReportSummary, IncludeZeroImpressions, UseRawEnumValues bool }
Opts lists the available Adwords API properties.
type QueryError ¶
type QueryError struct {
// contains filtered or unexported fields
}
QueryError represents a query error.
type Stmt ¶
Stmt is a prepared statement.
func (*Stmt) Hash ¶
Hash returns a hash that represents the statement. Of course, the binding must have already been done to make sense.