Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(298)

Side by Side Diff: appengine/logdog/coordinator/project.go

Issue 1910633006: LogDog: Support per-namespace expired archival. (Closed) Base URL: https://github.com/luci/luci-go@logdog-coordinator-svcdec
Patch Set: Update another test. Created 4 years, 7 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
(Empty)
1 // Copyright 2015 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file.
4
5 package coordinator
6
7 import (
8 "strings"
9
10 "github.com/luci/luci-go/common/config"
11 )
12
13 const projectNamespacePrefix = "luci."
14
15 // ProjectNamespace returns the AppEngine namespace for a given luci-config
16 // project name.
17 func ProjectNamespace(project config.ProjectName) string {
18 return projectNamespacePrefix + string(project)
19 }
20
21 // ProjectFromNamespace returns the current project installed in the supplied
22 // Context's namespace.
23 //
24 // If the namespace does not have a project namespace prefix, this function
25 // will return an empty string.
26 func ProjectFromNamespace(ns string) config.ProjectName {
27 if !strings.HasPrefix(ns, projectNamespacePrefix) {
28 return ""
29 }
30 return config.ProjectName(ns[len(projectNamespacePrefix):])
31 }
OLDNEW
« no previous file with comments | « appengine/logdog/coordinator/mutations/createArchiveTask.go ('k') | appengine/logdog/coordinator/service.go » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698