Files
Atay-Makhzan/modules/migration/schemas_bindata.go
T

37 lines
692 B
Go
Raw Normal View History

2022-01-26 09:45:51 +00:00
// Copyright 2022 The Gitea Authors. All rights reserved.
// SPDX-License-Identifier: MIT
2022-01-26 09:45:51 +00:00
//go:build bindata
//go:generate go run ../../build/generate-bindata.go ../../modules/migration/schemas bindata.dat
2022-01-26 09:45:51 +00:00
package migration
import (
"io/fs"
"path"
"sync"
_ "embed"
"code.gitea.io/gitea/modules/assetfs"
2026-04-01 05:26:52 +02:00
"github.com/santhosh-tekuri/jsonschema/v6"
)
//go:embed bindata.dat
var bindata []byte
var BuiltinAssets = sync.OnceValue(func() fs.FS {
return assetfs.NewEmbeddedFS(bindata)
})
2026-04-01 05:26:52 +02:00
func openSchema(filename string) (any, error) {
f, err := BuiltinAssets().Open(path.Base(filename))
if err != nil {
return nil, err
}
defer f.Close()
return jsonschema.UnmarshalJSON(f)
}