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

Side by Side Diff: common/gcloud/pubsub/topic.go

Issue 1537883002: Initial distributor implementation (Closed) Base URL: https://chromium.googlesource.com/external/github.com/luci/luci-go@master
Patch Set: fix imports and make dummy.go a real file Created 4 years, 6 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 | « common/api/dm/service/v1/walk_graph_normalize.go ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2015 The LUCI Authors. All rights reserved. 1 // Copyright 2015 The LUCI Authors. All rights reserved.
2 // Use of this source code is governed under the Apache License, Version 2.0 2 // Use of this source code is governed under the Apache License, Version 2.0
3 // that can be found in the LICENSE file. 3 // that can be found in the LICENSE file.
4 4
5 package pubsub 5 package pubsub
6 6
7 import ( 7 import (
8 "flag" 8 "flag"
9 ) 9 )
10 10
11 // Topic is a fully-qualified Pub/Sub project/topic name. 11 // Topic is a fully-qualified Pub/Sub project/topic name.
12 type Topic string 12 type Topic string
13 13
14 var _ flag.Value = (*Topic)(nil) 14 var _ flag.Value = (*Topic)(nil)
15 15
16 // NewTopic generates a new Subscritpion for a given project and topic name. 16 // NewTopic generates a new Topic for a given project and topic name.
17 func NewTopic(project, name string) Topic { 17 func NewTopic(project, name string) Topic {
18 return Topic(newResource(project, "topics", name)) 18 return Topic(newResource(project, "topics", name))
19 } 19 }
20 20
21 func (t *Topic) String() string { 21 func (t *Topic) String() string {
22 return string(*t) 22 return string(*t)
23 } 23 }
24 24
25 // Set implements flag.Value. 25 // Set implements flag.Value.
26 func (t *Topic) Set(value string) error { 26 func (t *Topic) Set(value string) error {
(...skipping 15 matching lines...) Expand all
42 func (t Topic) Split() (p, n string) { 42 func (t Topic) Split() (p, n string) {
43 p, n, _ = t.SplitErr() 43 p, n, _ = t.SplitErr()
44 return 44 return
45 } 45 }
46 46
47 // SplitErr returns the Topic's project and name components. 47 // SplitErr returns the Topic's project and name components.
48 func (t Topic) SplitErr() (p, n string, err error) { 48 func (t Topic) SplitErr() (p, n string, err error) {
49 p, n, err = resourceProjectName(string(t)) 49 p, n, err = resourceProjectName(string(t))
50 return 50 return
51 } 51 }
OLDNEW
« no previous file with comments | « common/api/dm/service/v1/walk_graph_normalize.go ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698