...

Source file src/google.golang.org/api/google-api-go-generator/replacements.go

Documentation: google.golang.org/api/google-api-go-generator

     1  // Copyright 2018 Google LLC
     2  // Use of this source code is governed by a BSD-style
     3  // license that can be found in the LICENSE file.
     4  
     5  package main
     6  
     7  // deprecatedPkgs is a map that contains packages that should be
     8  // deprecated in favor of another package.
     9  type deprecatedPkgs map[string]string
    10  
    11  func (d deprecatedPkgs) Get(name, version string) string {
    12  	v, ok := d[name]
    13  	if !ok {
    14  		// try lookup of a specific name-version
    15  		return d[name+":"+version]
    16  	}
    17  	return v
    18  }
    19  
    20  // replacementPackage is a map from an API package name to the
    21  // import path of the package that replaces it. If an API appears
    22  // in this map, its package doc comment will note that it is deprecated
    23  // and point to the replacement.
    24  // TODO(jba): consider automating this by looking at the structure of the gocloud repo.
    25  var replacementPackage deprecatedPkgs = map[string]string{
    26  	"bigquery":          "cloud.google.com/go/bigquery",
    27  	"cloudkms":          "cloud.google.com/go/kms/apiv1",
    28  	"cloudtasks":        "cloud.google.com/go/cloudtasks/apiv2beta2",
    29  	"dataproc":          "cloud.google.com/go/dataproc/apiv1",
    30  	"datastore":         "cloud.google.com/go/datastore",
    31  	"dialogflow":        "cloud.google.com/go/dialogflow/apiv2",
    32  	"dlp":               "cloud.google.com/go/dlp/apiv2",
    33  	"firestore":         "cloud.google.com/go/firestore",
    34  	"language":          "cloud.google.com/go/language/apiv1",
    35  	"logging":           "cloud.google.com/go/logging",
    36  	"monitoring:v3":     "cloud.google.com/go/monitoring/apiv3",
    37  	"oslogin":           "cloud.google.com/go/oslogin/apiv1",
    38  	"pubsub":            "cloud.google.com/go/pubsub",
    39  	"redis":             "cloud.google.com/go/redis/apiv1",
    40  	"spanner":           "cloud.google.com/go/spanner",
    41  	"speech":            "cloud.google.com/go/speech/apiv1",
    42  	"texttospeech":      "cloud.google.com/go/texttospeech/apiv1",
    43  	"translate":         "cloud.google.com/go/translate",
    44  	"videointelligence": "cloud.google.com/go/videointelligence/apiv1",
    45  	"vision":            "cloud.google.com/go/vision/apiv1",
    46  	"storage":           "cloud.google.com/go/storage",
    47  }
    48  

View as plain text