예제 #1
0
파일: legacy.go 프로젝트: tav/gcloud-golang
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)
}