diff options
author | Nathan Dench <ndenc2@gmail.com> | 2019-05-24 15:16:44 +1000 |
---|---|---|
committer | Nathan Dench <ndenc2@gmail.com> | 2019-05-24 15:16:44 +1000 |
commit | 107c1cdb09c575aa2f61d97f48d8587eb6bada4c (patch) | |
tree | ca7d008643efc555c388baeaf1d986e0b6b3e28c /vendor/google.golang.org/appengine/internal/app_id.go | |
parent | 844b5a68d8af4791755b8f0ad293cc99f5959183 (diff) | |
download | terraform-provider-statuscake-107c1cdb09c575aa2f61d97f48d8587eb6bada4c.tar.gz terraform-provider-statuscake-107c1cdb09c575aa2f61d97f48d8587eb6bada4c.tar.zst terraform-provider-statuscake-107c1cdb09c575aa2f61d97f48d8587eb6bada4c.zip |
Upgrade to 0.12
Diffstat (limited to 'vendor/google.golang.org/appengine/internal/app_id.go')
-rw-r--r-- | vendor/google.golang.org/appengine/internal/app_id.go | 28 |
1 files changed, 28 insertions, 0 deletions
diff --git a/vendor/google.golang.org/appengine/internal/app_id.go b/vendor/google.golang.org/appengine/internal/app_id.go new file mode 100644 index 0000000..11df8c0 --- /dev/null +++ b/vendor/google.golang.org/appengine/internal/app_id.go | |||
@@ -0,0 +1,28 @@ | |||
1 | // Copyright 2011 Google Inc. All rights reserved. | ||
2 | // Use of this source code is governed by the Apache 2.0 | ||
3 | // license that can be found in the LICENSE file. | ||
4 | |||
5 | package internal | ||
6 | |||
7 | import ( | ||
8 | "strings" | ||
9 | ) | ||
10 | |||
11 | func parseFullAppID(appid string) (partition, domain, displayID string) { | ||
12 | if i := strings.Index(appid, "~"); i != -1 { | ||
13 | partition, appid = appid[:i], appid[i+1:] | ||
14 | } | ||
15 | if i := strings.Index(appid, ":"); i != -1 { | ||
16 | domain, appid = appid[:i], appid[i+1:] | ||
17 | } | ||
18 | return partition, domain, appid | ||
19 | } | ||
20 | |||
21 | // appID returns "appid" or "domain.com:appid". | ||
22 | func appID(fullAppID string) string { | ||
23 | _, dom, dis := parseFullAppID(fullAppID) | ||
24 | if dom != "" { | ||
25 | return dom + ":" + dis | ||
26 | } | ||
27 | return dis | ||
28 | } | ||