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

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

Issue 2575383002: Add server/cache support to gaeconfig. (Closed)
Patch Set: Un-collapse. Created 3 years, 11 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
« no previous file with comments | « common/config/impl/erroring/erroring.go ('k') | common/data/text/templateproto/loader_test.go » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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()
« no previous file with comments | « common/config/impl/erroring/erroring.go ('k') | common/data/text/templateproto/loader_test.go » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698