Ejemplo n.º 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)
}
Ejemplo n.º 2
0
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)
}
Ejemplo n.º 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)
}