| // Copyright 2019 The Fuchsia Authors. All rights reserved. |
| // Use of this source code is governed by a BSD-style license that can be |
| // found in the LICENSE file. |
| |
| package loaders |
| |
| import ( |
| _ "fuchsia.googlesource.com/infra/infra/fxicfg/starlark/protos/recipes" |
| luci "go.chromium.org/luci/starlark/interpreter" |
| ) |
| |
| var protos = map[string]string{ |
| "recipes/example.proto": "recipes/example.proto", |
| } |
| |
| // ProtoLoader returns a luci.Loader that loads protocol buffer modules. |
| // |
| // lucicfg has its own internal-only ProtoLoader constructor. We don't want to have to |
| // send commits that project every time our recipe APIs change. |
| func ProtoLoader() luci.Loader { |
| mapping := make(map[string]string, len(protos)) |
| for path, proto := range protos { |
| mapping[path] = proto |
| } |
| return luci.ProtoLoader(mapping) |
| } |