feat: basic functionality implemented

- added Core CRD to manage DB migrations & configuration, PostgREST and
  GoTrue (auth)
- added APIGateway CRD to manage Envoy proxy
- added Dashboard CRD to manage (so far) pg-meta and (soon) studio
  deployments
- implemented basic Envoy control plane based on K8s watcher
This commit is contained in:
Peter 2025-01-04 17:07:49 +01:00
parent 2fae578618
commit 647f602c79
Signed by: prskr
GPG key ID: F56BED6903BC5E37
123 changed files with 12173 additions and 581 deletions
assets/migrations

View file

@ -2,6 +2,7 @@ package migrations
import (
"embed"
"fmt"
"io/fs"
"iter"
"path"
@ -25,8 +26,18 @@ func MigrationScripts() iter.Seq2[Script, error] {
return readScripts(path.Join(".", "migrations"))
}
func RoleCreationScript(roleName string) (Script, error) {
fileName := fmt.Sprintf("%s.sql", roleName)
content, err := migrationsFS.ReadFile(path.Join("roles", fileName))
if err != nil {
return Script{}, err
}
return Script{fileName, string(content)}, nil
}
func readScripts(dir string) iter.Seq2[Script, error] {
return iter.Seq2[Script, error](func(yield func(Script, error) bool) {
return func(yield func(Script, error) bool) {
files, err := migrationsFS.ReadDir(dir)
if err != nil {
yield(Script{}, err)
@ -58,5 +69,5 @@ func readScripts(dir string) iter.Seq2[Script, error] {
return
}
}
})
}
}