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

Unified Diff: appengine/logdog/coordinator/backend/util.go

Issue 1863973002: LogDog: Update to archival V2. (Closed) Base URL: https://github.com/luci/luci-go@grpcutil-errors
Patch Set: Code review comments, use Pub/Sub, archival staging, quality of life. Created 4 years, 8 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 side-by-side diff with in-line comments
Download patch
Index: appengine/logdog/coordinator/backend/util.go
diff --git a/appengine/logdog/coordinator/backend/util.go b/appengine/logdog/coordinator/backend/util.go
index adac00752bf23d605c561060ee69e4008df251f7..6d0e33136b7ab1f04ea8248df8fd0c98ff7d28fd 100644
--- a/appengine/logdog/coordinator/backend/util.go
+++ b/appengine/logdog/coordinator/backend/util.go
@@ -7,10 +7,7 @@ package backend
import (
"fmt"
"net/http"
- "net/url"
- "github.com/golang/protobuf/proto"
- tq "github.com/luci/gae/service/taskqueue"
log "github.com/luci/luci-go/common/logging"
"golang.org/x/net/context"
)
@@ -48,39 +45,3 @@ func errorWrapper(c context.Context, w http.ResponseWriter, f func() error) {
w.WriteHeader(statusCode)
}
}
-
-func mkValues(params map[string]string) url.Values {
- values := make(url.Values, len(params))
- for k, v := range params {
- values[k] = []string{v}
- }
- return values
-}
-
-func createTask(path string, params map[string]string) *tq.Task {
- h := make(http.Header)
- h.Set("Content-Type", "application/x-www-form-urlencoded")
- return &tq.Task{
- Path: path,
- Header: h,
- Payload: []byte(mkValues(params).Encode()),
- Method: "POST",
- }
-}
-
-// createPullTask is a generic pull queue task creation method. It is used to
-// instantiate pull queue tasks.
-func createPullTask(msg proto.Message) (*tq.Task, error) {
- t := tq.Task{
- Method: "PULL",
- }
-
- if msg != nil {
- var err error
- t.Payload, err = proto.Marshal(msg)
- if err != nil {
- return nil, err
- }
- }
- return &t, nil
-}

Powered by Google App Engine
This is Rietveld 408576698