Documentation ¶
Index ¶
- Constants
- func NewFlagError(text string) error
- func Usage()
- type Context
- func (c *Context) APIVersion() string
- func (c *Context) AccountID() string
- func (c *Context) CacheDir() string
- func (c *Context) DatabaseDir() string
- func (c *Context) Dsn() string
- func (c *Context) ExecuteStmt() string
- func (c *Context) HistoryFile() string
- func (c *Context) Init() error
- func (c *Context) IsInteractive() bool
- func (c *Context) SupportsZeroImpressions() bool
- func (c *Context) UseBatchMode() bool
- func (c *Context) UseVerboseMode() bool
- func (c *Context) WithAutoRehash() bool
- func (c *Context) WithCache() bool
- type Credentials
- type Flag
- type FlagError
- type Options
- type Settings
Constants ¶
const ( UsageAccountID = "Google Adwords account ID" UsageAccessToken = "Google OAuth access token" UsageDeveloperToken = "Google OAuth developer token" UsageAPIVersion = "Google Adwords API version" UsageQuery = "Execute AWQL statement" )
Usage messages.
Variables ¶
This section is empty.
Functions ¶
func NewFlagError ¶
NewFlagError returns an error of the parse error.
Types ¶
type Context ¶
type Context struct {
// contains filtered or unexported fields
}
Context represents the program properties.
func New ¶
New returns an instance of Credentials. The string dir contains the path of the current workspace.
func (*Context) APIVersion ¶
APIVersion returns the API version.
func (*Context) DatabaseDir ¶
DatabaseDir returns the path to the database.
func (*Context) ExecuteStmt ¶
ExecuteStmt returns the statement to execute.
func (*Context) HistoryFile ¶
HistoryFile returns the path to the history file.
func (*Context) IsInteractive ¶
IsInteractive returns true if query as passed as flag.
func (*Context) SupportsZeroImpressions ¶
SupportsZeroImpressions returns true if the support of zero impressions is enable.
func (*Context) UseBatchMode ¶
UseBatchMode returns true if raw mode is required. It will print results using colon as the column separator, with each row on a new line.
func (*Context) UseVerboseMode ¶
UseVerboseMode returns true if more output about what the program does is required.
func (*Context) WithAutoRehash ¶
WithAutoRehash returns true if automatic rehashing is enable.
type Credentials ¶
type Credentials struct { AccessToken, DeveloperToken, ClientID, ClientSecret, RefreshToken string }
Credentials represents all information required to authenticate to Google API.
func AskCredentials ¶
func AskCredentials() *Credentials
AskCredentials retrieves authenticate properties from console.
func NewCredentials ¶
func NewCredentials() *Credentials
NewCredentials returns an instance of Credentials.
func NewTmpCredentials ¶
func NewTmpCredentials(access, developer string) *Credentials
NewTmpCredentials returns an instance of Credentials with limited time.
func (*Credentials) Get ¶
func (o *Credentials) Get(path string) error
Get returns it in Yaml format in the file to this path.
func (*Credentials) Save ¶
func (o *Credentials) Save(path string) error
Save writes it in Yaml format in the file to this path.
type Flag ¶
type Flag struct { AccountID, AccessToken, APIVersion, DeveloperToken, Query *string Batch, ZeroImpressions, NoRehash, Verbose, Caching *bool }
Flag represents all options passed by the program.
type FlagError ¶
type FlagError struct {
// contains filtered or unexported fields
}
FlagError represents an error for the command-line tool.