示例#1
0
func rawService(ctx context.Context) *raw.Service {
	return internal.Service(ctx, "pubsub", func(hc *http.Client) interface{} {
		svc, _ := raw.New(hc)
		svc.BasePath = baseAddr()
		return svc
	}).(*raw.Service)
}
示例#2
0
文件: legacy.go 项目: Ropes/pubbing
func rawService(ctx context.Context) *raw.Service {
	baseAddr := func() string {
		// Environment variables for gcloud emulator:
		// https://cloud.google.com/sdk/gcloud/reference/beta/emulators/pubsub/
		if host := os.Getenv("PUBSUB_EMULATOR_HOST"); host != "" {
			return "http://" + host + "/"
		}
		return prodAddr
	}
	return internal.Service(ctx, "pubsub", func(hc *http.Client) interface{} {
		svc, _ := raw.New(hc)
		svc.BasePath = baseAddr()
		return svc
	}).(*raw.Service)
}
示例#3
0
func rawService(ctx context.Context) *raw.Service {
	return internal.Service(ctx, "container", func(hc *http.Client) interface{} {
		svc, _ := raw.New(hc)
		return svc
	}).(*raw.Service)
}