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.
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:]
15 if i := strings.Index(appid, ":"); i != -1 {
16 domain, appid = appid[:i], appid[i+1:]
18 return partition, domain, appid
21 // appID returns "appid" or "domain.com:appid".
22 func appID(fullAppID string) string {
23 _, dom, dis := parseFullAppID(fullAppID)
25 return dom + ":" + dis