github.com/zppinho/prow@v0.0.0-20240510014325-1738badeb017/pkg/spyglass/lenses/common/bindata.go (about)

     1  // Code generated by go-bindata.
     2  // sources:
     3  // static/spyglass-lens.html
     4  // DO NOT EDIT!
     5  
     6  package common
     7  
     8  import (
     9  	"bytes"
    10  	"compress/gzip"
    11  	"fmt"
    12  	"io"
    13  	"os"
    14  	"path/filepath"
    15  	"strings"
    16  	"time"
    17  )
    18  
    19  func bindataRead(data []byte, name string) ([]byte, error) {
    20  	gz, err := gzip.NewReader(bytes.NewBuffer(data))
    21  	if err != nil {
    22  		return nil, fmt.Errorf("Read %q: %v", name, err)
    23  	}
    24  
    25  	var buf bytes.Buffer
    26  	_, err = io.Copy(&buf, gz)
    27  	clErr := gz.Close()
    28  
    29  	if err != nil {
    30  		return nil, fmt.Errorf("Read %q: %v", name, err)
    31  	}
    32  	if clErr != nil {
    33  		return nil, err
    34  	}
    35  
    36  	return buf.Bytes(), nil
    37  }
    38  
    39  type asset struct {
    40  	bytes []byte
    41  	info  os.FileInfo
    42  }
    43  
    44  type bindataFileInfo struct {
    45  	name    string
    46  	size    int64
    47  	mode    os.FileMode
    48  	modTime time.Time
    49  }
    50  
    51  func (fi bindataFileInfo) Name() string {
    52  	return fi.name
    53  }
    54  func (fi bindataFileInfo) Size() int64 {
    55  	return fi.size
    56  }
    57  func (fi bindataFileInfo) Mode() os.FileMode {
    58  	return fi.mode
    59  }
    60  func (fi bindataFileInfo) ModTime() time.Time {
    61  	return fi.modTime
    62  }
    63  func (fi bindataFileInfo) IsDir() bool {
    64  	return false
    65  }
    66  func (fi bindataFileInfo) Sys() interface{} {
    67  	return nil
    68  }
    69  
    70  var _staticSpyglassLensHtml = []byte("\x1f\x8b\x08\x00\x00\x00\x00\x00\x00\xff\x8c\x92\x4f\x8b\xdb\x30\x10\xc5\xef\xf9\x14\xaa\xae\x6d\x24\x97\x16\x5a\x82\xed\x42\xfa\x87\x16\x52\x5a\xd2\xe4\xd0\x53\x90\xa5\x89\xad\x8d\x2c\x19\xcd\xec\xc1\x18\x7f\xf7\x45\xb6\x97\xdd\x25\x0b\xbb\x27\xc3\xf3\xfb\xbd\x79\x92\x26\x7f\xf3\xed\xcf\xd7\xc3\xff\xbf\xdf\x59\x43\xad\x2b\x57\x79\xfa\x30\xa7\x7c\x5d\x70\xf0\x3c\x09\xa0\x4c\xb9\x62\x2c\x6f\x81\x14\xd3\x8d\x8a\x08\x54\xf0\xe3\xe1\xc7\xfa\x33\x9f\x7e\x90\x25\x07\xe5\xbf\xae\xaf\x9d\x42\x64\x3b\xf0\xb8\x61\xc3\x20\x0e\x49\x1f\xc7\x5c\xce\x86\x64\xad\x14\x02\x6b\x22\x9c\x0b\x3e\x0c\x62\xab\x10\x8e\xfb\xdd\x38\x72\x46\x2a\xd6\x29\xf6\xd4\xa9\x08\x9e\xe6\x60\x67\xfd\x85\x45\x70\x05\x47\xea\x1d\x60\x03\x40\x7c\xc1\x1b\xa2\x0e\x37\x52\xea\x60\x40\xd4\x40\xad\x71\xc2\x06\xf9\x5e\x7c\x10\x99\x6c\x15\x41\xb4\xca\x09\xeb\x8d\xad\xc3\xba\xb3\xfe\x22\x5a\xeb\x85\x46\x7c\x14\xfd\x34\xe9\x1c\x3c\xa1\xa8\x43\xa8\x1d\xa8\xce\xa2\xd0\xa1\x95\x1a\xf1\xcb\x59\xb5\xd6\xf5\xc5\x3e\x54\x81\xc2\xe6\x63\x96\xbd\xfb\x94\x65\xfc\xaa\xd8\xab\x2b\x3f\x3b\xc8\xea\xe0\xef\x27\xfd\x5e\xea\xbf\xfd\xa5\x83\xc7\x97\x83\x25\x92\x22\xab\x25\x2e\x4f\x20\x1d\x78\x7c\x38\x2b\xea\x68\x3b\x62\x18\xf5\xb5\xf5\x94\xac\xa7\xea\xd6\x1b\x07\xd3\x0d\xdd\x20\x2f\x73\x39\x23\x89\x1e\x06\xf1\x13\x94\x19\xc7\x55\x2e\xe7\x55\xc8\xab\x60\x7a\xa6\x13\x5d\xf0\x84\xaf\x93\xc0\x17\xf3\x36\x98\x7e\x32\x27\xb1\x4c\xd0\xb4\x57\x77\x01\x00\x00\xff\xff\x57\x0c\x6e\x14\x68\x02\x00\x00")
    71  
    72  func staticSpyglassLensHtmlBytes() ([]byte, error) {
    73  	return bindataRead(
    74  		_staticSpyglassLensHtml,
    75  		"static/spyglass-lens.html",
    76  	)
    77  }
    78  
    79  func staticSpyglassLensHtml() (*asset, error) {
    80  	bytes, err := staticSpyglassLensHtmlBytes()
    81  	if err != nil {
    82  		return nil, err
    83  	}
    84  
    85  	info := bindataFileInfo{name: "static/spyglass-lens.html", size: 616, mode: os.FileMode(436), modTime: time.Unix(1582751428, 0)}
    86  	a := &asset{bytes: bytes, info: info}
    87  	return a, nil
    88  }
    89  
    90  // Asset loads and returns the asset for the given name.
    91  // It returns an error if the asset could not be found or
    92  // could not be loaded.
    93  func Asset(name string) ([]byte, error) {
    94  	cannonicalName := strings.Replace(name, "\\", "/", -1)
    95  	if f, ok := _bindata[cannonicalName]; ok {
    96  		a, err := f()
    97  		if err != nil {
    98  			return nil, fmt.Errorf("Asset %s can't read by error: %v", name, err)
    99  		}
   100  		return a.bytes, nil
   101  	}
   102  	return nil, fmt.Errorf("Asset %s not found", name)
   103  }
   104  
   105  // MustAsset is like Asset but panics when Asset would return an error.
   106  // It simplifies safe initialization of global variables.
   107  func MustAsset(name string) []byte {
   108  	a, err := Asset(name)
   109  	if err != nil {
   110  		panic("asset: Asset(" + name + "): " + err.Error())
   111  	}
   112  
   113  	return a
   114  }
   115  
   116  // AssetInfo loads and returns the asset info for the given name.
   117  // It returns an error if the asset could not be found or
   118  // could not be loaded.
   119  func AssetInfo(name string) (os.FileInfo, error) {
   120  	cannonicalName := strings.Replace(name, "\\", "/", -1)
   121  	if f, ok := _bindata[cannonicalName]; ok {
   122  		a, err := f()
   123  		if err != nil {
   124  			return nil, fmt.Errorf("AssetInfo %s can't read by error: %w", name, err)
   125  		}
   126  		return a.info, nil
   127  	}
   128  	return nil, fmt.Errorf("AssetInfo %s not found", name)
   129  }
   130  
   131  // AssetNames returns the names of the assets.
   132  func AssetNames() []string {
   133  	names := make([]string, 0, len(_bindata))
   134  	for name := range _bindata {
   135  		names = append(names, name)
   136  	}
   137  	return names
   138  }
   139  
   140  // _bindata is a table, holding each asset generator, mapped to its name.
   141  var _bindata = map[string]func() (*asset, error){
   142  	"static/spyglass-lens.html": staticSpyglassLensHtml,
   143  }
   144  
   145  // AssetDir returns the file names below a certain
   146  // directory embedded in the file by go-bindata.
   147  // For example if you run go-bindata on data/... and data contains the
   148  // following hierarchy:
   149  //
   150  //	data/
   151  //	  foo.txt
   152  //	  img/
   153  //	    a.png
   154  //	    b.png
   155  //
   156  // then AssetDir("data") would return []string{"foo.txt", "img"}
   157  // AssetDir("data/img") would return []string{"a.png", "b.png"}
   158  // AssetDir("foo.txt") and AssetDir("notexist") would return an error
   159  // AssetDir("") will return []string{"data"}.
   160  func AssetDir(name string) ([]string, error) {
   161  	node := _bintree
   162  	if len(name) != 0 {
   163  		cannonicalName := strings.Replace(name, "\\", "/", -1)
   164  		pathList := strings.Split(cannonicalName, "/")
   165  		for _, p := range pathList {
   166  			node = node.Children[p]
   167  			if node == nil {
   168  				return nil, fmt.Errorf("Asset %s not found", name)
   169  			}
   170  		}
   171  	}
   172  	if node.Func != nil {
   173  		return nil, fmt.Errorf("Asset %s not found", name)
   174  	}
   175  	rv := make([]string, 0, len(node.Children))
   176  	for childName := range node.Children {
   177  		rv = append(rv, childName)
   178  	}
   179  	return rv, nil
   180  }
   181  
   182  type bintree struct {
   183  	Func     func() (*asset, error)
   184  	Children map[string]*bintree
   185  }
   186  
   187  var _bintree = &bintree{nil, map[string]*bintree{
   188  	"static": {nil, map[string]*bintree{
   189  		"spyglass-lens.html": {staticSpyglassLensHtml, map[string]*bintree{}},
   190  	}},
   191  }}
   192  
   193  // RestoreAsset restores an asset under the given directory
   194  func RestoreAsset(dir, name string) error {
   195  	data, err := Asset(name)
   196  	if err != nil {
   197  		return err
   198  	}
   199  	info, err := AssetInfo(name)
   200  	if err != nil {
   201  		return err
   202  	}
   203  	err = os.MkdirAll(_filePath(dir, filepath.Dir(name)), os.FileMode(0755))
   204  	if err != nil {
   205  		return err
   206  	}
   207  	err = os.WriteFile(_filePath(dir, name), data, info.Mode())
   208  	if err != nil {
   209  		return err
   210  	}
   211  	err = os.Chtimes(_filePath(dir, name), info.ModTime(), info.ModTime())
   212  	if err != nil {
   213  		return err
   214  	}
   215  	return nil
   216  }
   217  
   218  // RestoreAssets restores an asset under the given directory recursively
   219  func RestoreAssets(dir, name string) error {
   220  	children, err := AssetDir(name)
   221  	// File
   222  	if err != nil {
   223  		return RestoreAsset(dir, name)
   224  	}
   225  	// Dir
   226  	for _, child := range children {
   227  		err = RestoreAssets(dir, filepath.Join(name, child))
   228  		if err != nil {
   229  			return err
   230  		}
   231  	}
   232  	return nil
   233  }
   234  
   235  func _filePath(dir, name string) string {
   236  	cannonicalName := strings.Replace(name, "\\", "/", -1)
   237  	return filepath.Join(append([]string{dir}, strings.Split(cannonicalName, "/")...)...)
   238  }