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

Side by Side Diff: service/info/support/namespace.go

Issue 2302743002: Interface update, per-method Contexts. (Closed)
Patch Set: Lightning talk licenses. Created 4 years, 3 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
« no previous file with comments | « service/info/interface.go ('k') | service/info/wrapper.go » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
(Empty)
1 // Copyright 2015 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 support provides Info-related support functionality. It is designed
6 // to be used by implementing packages.
7 package support
8
9 import (
10 "fmt"
11 "regexp"
12 )
13
14 // validNamespace matches valid namespace names.
15 var validNamespace = regexp.MustCompile(`^[0-9A-Za-z._-]{0,100}$`)
16
17 // ValidNamespace will return an error if the supplied string is not a valid
18 // namespace.
19 func ValidNamespace(ns string) error {
20 if validNamespace.MatchString(ns) {
21 return nil
22 }
23 return fmt.Errorf("appengine: namespace %q does not match /%s/", ns, val idNamespace)
24 }
OLDNEW
« no previous file with comments | « service/info/interface.go ('k') | service/info/wrapper.go » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698