OLD | NEW |
| (Empty) |
1 // Copyright 2016 The LUCI Authors. All rights reserved. | |
2 // Use of this source code is governed under the Apache License, Version 2.0 | |
3 // that can be found in the LICENSE file. | |
4 | |
5 package info | |
6 | |
7 import ( | |
8 "strings" | |
9 | |
10 "golang.org/x/net/context" | |
11 ) | |
12 | |
13 type infoImpl struct { | |
14 RawInterface | |
15 } | |
16 | |
17 var _ Interface = infoImpl{} | |
18 | |
19 func (i infoImpl) MustNamespace(namespace string) context.Context { | |
20 ret, err := i.Namespace(namespace) | |
21 if err != nil { | |
22 panic(err) | |
23 } | |
24 return ret | |
25 } | |
26 | |
27 func (i infoImpl) TrimmedAppID() string { | |
28 toks := strings.Split(i.AppID(), ":") | |
29 return toks[len(toks)-1] | |
30 } | |
OLD | NEW |