GoogleAPIGoClient可以自动生成Google的Go语言API。
示例代码:
package mainimport ( "container/list" "encoding/json" "fmt" "io/ioutil" "log" "math" "math/rand" "net/http" "os" "strconv" "strings" "time" bigquery "google.golang.org/api/bigquery/v2" storage "google.golang.org/api/storage/v1")const ( GB = 1 << 30 MaxBackoff = 30000 BaseBackoff = 250 BackoffGrowthFactor = 1.8 BackoffGrowthDamper = 0.25 JobStatusDone = "DONE" DatasetAlreadyExists = "Already Exists: Dataset" TableWriteEmptyDisposition = "WRITE_EMPTY")func init() { scope := fmt.Sprintf("%s %s %s", bigquery.BigqueryScope, storage.DevstorageRead_onlyScope, "https://www.googleapis.com/auth/userinfo.profile") registerDemo("bigquery", scope, bqMain)}
评论