| // Copyright 2015 The LUCI Authors. |
| // |
| // Licensed under the Apache License, Version 2.0 (the "License"); |
| // you may not use this file except in compliance with the License. |
| // You may obtain a copy of the License at |
| // |
| // http://www.apache.org/licenses/LICENSE-2.0 |
| // |
| // Unless required by applicable law or agreed to in writing, software |
| // distributed under the License is distributed on an "AS IS" BASIS, |
| // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. |
| // See the License for the specific language governing permissions and |
| // limitations under the License. |
| |
| // AUTOGENERATED. DO NOT EDIT. |
| |
| // Package stdlib is generated by go.chromium.org/luci/tools/cmd/assets. |
| // |
| // It contains all [*.css *.html *.js *.star *.tmpl] files found in the package as byte arrays. |
| package stdlib |
| |
| // GetAsset returns an asset by its name. Returns nil if no such asset exists. |
| func GetAsset(name string) []byte { |
| return []byte(files[name]) |
| } |
| |
| // GetAssetString is version of GetAsset that returns string instead of byte |
| // slice. Returns empty string if no such asset exists. |
| func GetAssetString(name string) string { |
| return files[name] |
| } |
| |
| // GetAssetSHA256 returns the asset checksum. Returns nil if no such asset |
| // exists. |
| func GetAssetSHA256(name string) []byte { |
| data := fileSha256s[name] |
| if data == nil { |
| return nil |
| } |
| return append([]byte(nil), data...) |
| } |
| |
| // Assets returns a map of all assets. |
| func Assets() map[string]string { |
| cpy := make(map[string]string, len(files)) |
| for k, v := range files { |
| cpy[k] = v |
| } |
| return cpy |
| } |
| |
| var files = map[string]string{} |
| |
| var fileSha256s = map[string][]byte{} |