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

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

Powered by Google App Engine
This is Rietveld 408576698