github.com/kristofferahl/go-centry@v1.5.0/internal/pkg/config/schema.go (about)

     1  // Code generated by go-bindata. DO NOT EDIT.
     2  // sources:
     3  // schemas/manifest.json (3.932kB)
     4  
     5  package config
     6  
     7  import (
     8  	"bytes"
     9  	"compress/gzip"
    10  	"crypto/sha256"
    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: %w", 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: %w", 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  	digest [sha256.Size]byte
    43  }
    44  
    45  type bindataFileInfo struct {
    46  	name    string
    47  	size    int64
    48  	mode    os.FileMode
    49  	modTime time.Time
    50  }
    51  
    52  func (fi bindataFileInfo) Name() string {
    53  	return fi.name
    54  }
    55  func (fi bindataFileInfo) Size() int64 {
    56  	return fi.size
    57  }
    58  func (fi bindataFileInfo) Mode() os.FileMode {
    59  	return fi.mode
    60  }
    61  func (fi bindataFileInfo) ModTime() time.Time {
    62  	return fi.modTime
    63  }
    64  func (fi bindataFileInfo) IsDir() bool {
    65  	return false
    66  }
    67  func (fi bindataFileInfo) Sys() interface{} {
    68  	return nil
    69  }
    70  
    71  var _schemasManifestJson = []byte("\x1f\x8b\x08\x00\x00\x00\x00\x00\x00\xff\xd4\x57\xcd\x8e\xd3\x30\x10\xbe\xf7\x29\x22\xc3\x71\x77\x23\x38\xf6\xca\x09\x09\x04\x77\x54\x21\x37\x99\x24\x5e\x9c\x71\x18\x3b\x61\x2b\xd4\x77\x47\x71\xb2\x6d\xe2\x9f\xb4\xa5\xe4\xc0\xa9\xd5\xfc\x7c\x9e\xf1\xcc\x7c\xe3\xfc\xde\x24\x09\x7b\xab\xb3\x0a\x6a\xce\xb6\x09\xab\x8c\x69\xb6\x69\xfa\xac\x15\x3e\x0e\xd2\x27\x45\x65\x3a\xfc\x7d\xc3\x1e\xac\xb9\xc8\x5f\x4d\xf5\x36\x4d\x4b\x61\xaa\x76\xff\x94\xa9\x3a\xfd\x41\x42\x1b\x55\x14\x40\xbc\x92\x69\xa9\x1e\x33\x40\x43\x87\xd1\x5d\xa7\x35\x47\x51\x80\x36\x4f\x3d\xfe\x00\x66\x0e\x0d\xf4\x68\x6a\xff\x0c\x99\x19\x64\x0d\xa9\x06\xc8\x08\xd0\x6c\x9b\xf4\x11\x26\x09\xd3\x19\x89\xc6\x9c\x05\x13\x57\x4e\xc4\x0f\xd6\xd3\x8a\x85\x81\x7a\x6a\x37\xb1\xd4\x86\x04\x96\x6c\x54\x1c\xed\xef\x71\x70\x64\x99\xaa\x6b\x8e\xf9\x9d\x27\x4c\xd2\x18\x35\x81\x64\x46\x0d\xf2\x1a\x1c\x99\x1f\xeb\xc3\x5c\x5b\x0b\xfc\x04\x58\x9a\x8a\x6d\x93\x77\x13\xd5\x71\x6a\xc7\x1a\x6e\x0d\x56\x40\xae\x40\x36\xeb\x20\xe7\x30\x94\x58\x28\x5c\xe7\x00\x8e\xa8\x0c\xef\xf1\xdd\x4a\xf8\xf5\x8b\xe7\x2f\xf2\x1c\x16\x02\xdc\x2b\x25\x81\xe3\x0c\x60\x13\x80\x62\x04\x3f\x5b\x41\xd0\x4f\xd2\x37\xaf\x29\xfc\x62\x9e\x04\xbb\x60\xf3\xaa\xc6\xcd\x6b\xe5\xde\x1d\x7d\x6e\x2a\x13\x60\x5b\x3b\xe9\x5a\x79\xd0\x3a\x19\xee\xd2\x97\x0a\x34\x50\x02\xf9\x0a\x0d\x72\x1e\xfe\x4c\x9e\x76\xef\xd9\x4c\xb3\x8b\xd6\x78\xbd\xb9\xd4\x95\x22\x73\x17\xb4\xab\xe3\x2f\x57\x1c\x0b\xd8\x7d\x5f\x2f\xa9\xd5\x07\xb7\xe3\xb2\xf5\x3a\x30\xda\xe1\xa3\xd2\xef\x73\xc7\xcb\xeb\xf6\x51\x1f\xed\xf9\x51\x1f\xbc\xc8\x6b\xb2\xbd\x90\x73\x20\xf3\xd1\x23\xdc\x35\xab\x1e\x69\xaf\x7c\xc5\x23\x37\x17\x42\x88\xd1\xe3\xa8\xb5\x35\x70\xc4\x3b\x0f\x23\x1e\xc3\x71\xa1\x99\x0b\xde\xca\xfb\x66\x34\x0a\x3e\x49\xea\x86\xf5\xf1\x1f\x2e\x31\x0b\xe4\x73\xea\x85\x25\x96\x29\x2c\x44\x19\xda\x61\xce\xac\xc6\x66\x34\x34\x9b\x4b\x85\x8b\x94\x6d\x9a\x61\x9c\xdc\xee\x04\xee\x80\xf4\x3f\x07\x95\xaa\x8c\x01\x06\xe8\x6e\x89\xea\x98\x84\x0e\xe4\x12\x7f\xc6\xb6\x76\x64\xcb\xdb\xbb\xdc\xb7\x21\xba\x60\x02\x0b\x15\x92\xff\xe2\x84\x21\x39\x10\x29\xff\x01\x60\x9f\x4a\x28\x32\x8f\x18\xe6\xa3\xef\x4c\x6e\x43\x50\x88\x97\xbf\x49\xf4\x4a\x7a\x09\x16\x0a\xb0\x13\xa4\xb0\x06\x34\x5f\xc9\x3f\xff\xce\x36\xa8\x44\x0e\x1f\xd1\x00\x21\x97\x1f\xfc\xcf\x9a\x64\x71\xd6\x63\x40\x5f\xbc\x27\xe6\x0d\x38\x20\x9b\xcf\x2a\xbf\x69\x36\x83\x7d\x74\xe2\x67\x77\xdb\xf7\x41\xf2\xcc\x88\x6e\xb6\x17\xce\xa5\x7f\x2d\xc3\x29\xaa\x30\x77\xcd\x78\x6a\xf0\xee\x3d\xad\x97\xef\x71\xfe\x66\x9c\x33\xd8\xa6\xf7\x3d\x6e\xfe\x04\x00\x00\xff\xff\x21\x72\xc4\x93\x5c\x0f\x00\x00")
    72  
    73  func schemasManifestJsonBytes() ([]byte, error) {
    74  	return bindataRead(
    75  		_schemasManifestJson,
    76  		"schemas/manifest.json",
    77  	)
    78  }
    79  
    80  func schemasManifestJson() (*asset, error) {
    81  	bytes, err := schemasManifestJsonBytes()
    82  	if err != nil {
    83  		return nil, err
    84  	}
    85  
    86  	info := bindataFileInfo{name: "schemas/manifest.json", size: 3932, mode: os.FileMode(0644), modTime: time.Unix(1683295929, 0)}
    87  	a := &asset{bytes: bytes, info: info, digest: [32]uint8{0xf6, 0xe6, 0xda, 0xea, 0x5c, 0x5d, 0x2a, 0x5, 0xd9, 0x1e, 0x65, 0x0, 0xcf, 0x41, 0xa3, 0xfc, 0x8, 0x24, 0x3c, 0x9e, 0x36, 0xa8, 0x17, 0xd, 0x18, 0x72, 0xa6, 0x5e, 0xd4, 0x30, 0xa8, 0x94}}
    88  	return a, nil
    89  }
    90  
    91  // Asset loads and returns the asset for the given name.
    92  // It returns an error if the asset could not be found or
    93  // could not be loaded.
    94  func Asset(name string) ([]byte, error) {
    95  	canonicalName := strings.Replace(name, "\\", "/", -1)
    96  	if f, ok := _bindata[canonicalName]; ok {
    97  		a, err := f()
    98  		if err != nil {
    99  			return nil, fmt.Errorf("Asset %s can't read by error: %v", name, err)
   100  		}
   101  		return a.bytes, nil
   102  	}
   103  	return nil, fmt.Errorf("Asset %s not found", name)
   104  }
   105  
   106  // AssetString returns the asset contents as a string (instead of a []byte).
   107  func AssetString(name string) (string, error) {
   108  	data, err := Asset(name)
   109  	return string(data), err
   110  }
   111  
   112  // MustAsset is like Asset but panics when Asset would return an error.
   113  // It simplifies safe initialization of global variables.
   114  func MustAsset(name string) []byte {
   115  	a, err := Asset(name)
   116  	if err != nil {
   117  		panic("asset: Asset(" + name + "): " + err.Error())
   118  	}
   119  
   120  	return a
   121  }
   122  
   123  // MustAssetString is like AssetString but panics when Asset would return an
   124  // error. It simplifies safe initialization of global variables.
   125  func MustAssetString(name string) string {
   126  	return string(MustAsset(name))
   127  }
   128  
   129  // AssetInfo loads and returns the asset info for the given name.
   130  // It returns an error if the asset could not be found or
   131  // could not be loaded.
   132  func AssetInfo(name string) (os.FileInfo, error) {
   133  	canonicalName := strings.Replace(name, "\\", "/", -1)
   134  	if f, ok := _bindata[canonicalName]; ok {
   135  		a, err := f()
   136  		if err != nil {
   137  			return nil, fmt.Errorf("AssetInfo %s can't read by error: %v", name, err)
   138  		}
   139  		return a.info, nil
   140  	}
   141  	return nil, fmt.Errorf("AssetInfo %s not found", name)
   142  }
   143  
   144  // AssetDigest returns the digest of the file with the given name. It returns an
   145  // error if the asset could not be found or the digest could not be loaded.
   146  func AssetDigest(name string) ([sha256.Size]byte, error) {
   147  	canonicalName := strings.Replace(name, "\\", "/", -1)
   148  	if f, ok := _bindata[canonicalName]; ok {
   149  		a, err := f()
   150  		if err != nil {
   151  			return [sha256.Size]byte{}, fmt.Errorf("AssetDigest %s can't read by error: %v", name, err)
   152  		}
   153  		return a.digest, nil
   154  	}
   155  	return [sha256.Size]byte{}, fmt.Errorf("AssetDigest %s not found", name)
   156  }
   157  
   158  // Digests returns a map of all known files and their checksums.
   159  func Digests() (map[string][sha256.Size]byte, error) {
   160  	mp := make(map[string][sha256.Size]byte, len(_bindata))
   161  	for name := range _bindata {
   162  		a, err := _bindata[name]()
   163  		if err != nil {
   164  			return nil, err
   165  		}
   166  		mp[name] = a.digest
   167  	}
   168  	return mp, nil
   169  }
   170  
   171  // AssetNames returns the names of the assets.
   172  func AssetNames() []string {
   173  	names := make([]string, 0, len(_bindata))
   174  	for name := range _bindata {
   175  		names = append(names, name)
   176  	}
   177  	return names
   178  }
   179  
   180  // _bindata is a table, holding each asset generator, mapped to its name.
   181  var _bindata = map[string]func() (*asset, error){
   182  	"schemas/manifest.json": schemasManifestJson,
   183  }
   184  
   185  // AssetDebug is true if the assets were built with the debug flag enabled.
   186  const AssetDebug = false
   187  
   188  // AssetDir returns the file names below a certain
   189  // directory embedded in the file by go-bindata.
   190  // For example if you run go-bindata on data/... and data contains the
   191  // following hierarchy:
   192  //
   193  //	data/
   194  //	  foo.txt
   195  //	  img/
   196  //	    a.png
   197  //	    b.png
   198  //
   199  // then AssetDir("data") would return []string{"foo.txt", "img"},
   200  // AssetDir("data/img") would return []string{"a.png", "b.png"},
   201  // AssetDir("foo.txt") and AssetDir("notexist") would return an error, and
   202  // AssetDir("") will return []string{"data"}.
   203  func AssetDir(name string) ([]string, error) {
   204  	node := _bintree
   205  	if len(name) != 0 {
   206  		canonicalName := strings.Replace(name, "\\", "/", -1)
   207  		pathList := strings.Split(canonicalName, "/")
   208  		for _, p := range pathList {
   209  			node = node.Children[p]
   210  			if node == nil {
   211  				return nil, fmt.Errorf("Asset %s not found", name)
   212  			}
   213  		}
   214  	}
   215  	if node.Func != nil {
   216  		return nil, fmt.Errorf("Asset %s not found", name)
   217  	}
   218  	rv := make([]string, 0, len(node.Children))
   219  	for childName := range node.Children {
   220  		rv = append(rv, childName)
   221  	}
   222  	return rv, nil
   223  }
   224  
   225  type bintree struct {
   226  	Func     func() (*asset, error)
   227  	Children map[string]*bintree
   228  }
   229  
   230  var _bintree = &bintree{nil, map[string]*bintree{
   231  	"schemas": {nil, map[string]*bintree{
   232  		"manifest.json": {schemasManifestJson, map[string]*bintree{}},
   233  	}},
   234  }}
   235  
   236  // RestoreAsset restores an asset under the given directory.
   237  func RestoreAsset(dir, name string) error {
   238  	data, err := Asset(name)
   239  	if err != nil {
   240  		return err
   241  	}
   242  	info, err := AssetInfo(name)
   243  	if err != nil {
   244  		return err
   245  	}
   246  	err = os.MkdirAll(_filePath(dir, filepath.Dir(name)), os.FileMode(0755))
   247  	if err != nil {
   248  		return err
   249  	}
   250  	err = os.WriteFile(_filePath(dir, name), data, info.Mode())
   251  	if err != nil {
   252  		return err
   253  	}
   254  	return os.Chtimes(_filePath(dir, name), info.ModTime(), info.ModTime())
   255  }
   256  
   257  // RestoreAssets restores an asset under the given directory recursively.
   258  func RestoreAssets(dir, name string) error {
   259  	children, err := AssetDir(name)
   260  	// File
   261  	if err != nil {
   262  		return RestoreAsset(dir, name)
   263  	}
   264  	// Dir
   265  	for _, child := range children {
   266  		err = RestoreAssets(dir, filepath.Join(name, child))
   267  		if err != nil {
   268  			return err
   269  		}
   270  	}
   271  	return nil
   272  }
   273  
   274  func _filePath(dir, name string) string {
   275  	canonicalName := strings.Replace(name, "\\", "/", -1)
   276  	return filepath.Join(append([]string{dir}, strings.Split(canonicalName, "/")...)...)
   277  }