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

Unified Diff: common/data/text/templateproto/loader.go

Issue 2575383002: Add server/cache support to gaeconfig. (Closed)
Patch Set: Created 4 years 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: common/data/text/templateproto/loader.go
diff --git a/common/data/text/templateproto/loader.go b/common/data/text/templateproto/loader.go
index 8ea68b7c40644b256d42409931071ad6ba1f3cb1..cd102bb3c75b23c92d3fa6de42b289f1afb7f989 100644
--- a/common/data/text/templateproto/loader.go
+++ b/common/data/text/templateproto/loader.go
@@ -7,23 +7,15 @@ package templateproto
import (
"fmt"
- "golang.org/x/net/context"
-
- "github.com/luci/luci-go/common/config"
"github.com/luci/luci-go/common/proto"
)
-// LoadFile loads a File from config service by configSet and path.
+// LoadFile loads a File from a string containing the template text protobuf.
//
// Expects config.Interface to be in the context already.
-func LoadFile(c context.Context, configSet, path string) (file *File, vers string, err error) {
- templateData, err := config.GetConfig(c, configSet, path, false)
- if err != nil {
- return
- }
+func LoadFile(data string) (file *File, err error) {
file = &File{}
- vers = templateData.ContentHash
- if err = proto.UnmarshalTextML(templateData.Content, file); err != nil {
+ if err = proto.UnmarshalTextML(data, file); err != nil {
return
}
err = file.Normalize()

Powered by Google App Engine
This is Rietveld 408576698