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

Side by Side Diff: appengine/cmd/dm/distributor/config.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 | « appengine/cmd/dm/deps/walk_graph_test.go ('k') | appengine/cmd/dm/distributor/distributor.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 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 distributor
6
7 import (
8 "net/url"
9
10 "golang.org/x/net/context"
11
12 "github.com/golang/protobuf/proto"
13 "github.com/luci/gae/service/taskqueue"
14 )
15
16 // Config represents the configuration for a single instance of a given
17 // distributor implementation at a given point in time (e.g. version).
18 type Config struct {
19 // DMBaseURL is the base url for the DM API. This may be used by the
20 // distributor implementation to pass to jobs so that they can call back into
21 // DM's api.
22 DMBaseURL *url.URL
23
24 // Name is the name of this distributor configuration. This is always th e
25 // fully-resolved name of the configuration (i.e. aliases are dereferenc ed).
26 Name string
27
28 // Version is the version of the distributor configuration retrieved fro m
29 // luci-config.
30 Version string
31
32 // Content is the actual parsed implementation-specific configuration.
33 Content proto.Message
34 }
35
36 // EnqueueTask allows a Distributor to enqueue a TaskQueue task that will be
37 // handled by the Distributor's HandleTaskQueueTask method.
38 func (cfg *Config) EnqueueTask(c context.Context, tsk *taskqueue.Task) error {
39 tsk.Path = handlerPath(cfg.Name)
40 return taskqueue.Get(c).Add(tsk, "")
41 }
OLDNEW
« no previous file with comments | « appengine/cmd/dm/deps/walk_graph_test.go ('k') | appengine/cmd/dm/distributor/distributor.go » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698