1
0
forked from apps/featurer

Initial commit.

This commit is contained in:
2024-10-12 13:04:09 +05:00
commit 57937a5845
30 changed files with 816 additions and 0 deletions

6
server/cmd/Taskfile.yml Normal file
View File

@@ -0,0 +1,6 @@
---
version: "3"
includes:
cms: ./cms
featurer: ./featurer

View File

@@ -0,0 +1,21 @@
---
version: "3"
tasks:
build:
desc: "Builds Featurer's CMS binary."
cmds:
- task: cleanup
- go build -ldflags="{{ .LDFLAGS }}" -tags netgo -o _build/featurer-cms{{exeExt}} ./server/cmd/cms/main.go
sources:
- ./**/*.go
- ./Taskfile.yml
- ./go.mod
generates:
- ./_build/featurer-cms{{exeExt}}
method: none
cleanup:
desc: "Deletes Featurer's CMS binary from local build cache."
cmds:
- rm -f _build/featurer-cms{{exeExt}}

42
server/cmd/cms/main.go Normal file
View File

@@ -0,0 +1,42 @@
package main
import (
"log/slog"
"go.dev.pztrn.name/featurer/server/internal/application"
"go.dev.pztrn.name/featurer/server/internal/services/core/datastore"
)
func main() {
_ = slog.SetLogLoggerLevel(slog.LevelDebug)
app := application.New()
slog.Info(
"Launching Featurer's CMS...",
"version", application.Version,
"build", application.Build,
"branch", application.Branch,
"commit", application.Commit,
"build date", application.BuildDate,
)
// Initializing core services first.
checkError(datastore.Initialize(app))
// Then - features services.
// Start application.
checkError(app.Start())
<-app.GetShutdownDoneChannel()
slog.Info("Featurer's CMS.")
}
func checkError(err error) {
if err == nil {
return
}
panic(err)
}

View File

@@ -0,0 +1,21 @@
---
version: "3"
tasks:
build:
desc: "Builds Featurer main binary."
cmds:
- task: cleanup
- go build -ldflags="{{ .LDFLAGS }}" -tags netgo -o _build/featurer{{exeExt}} ./server/cmd/featurer/main.go
sources:
- ./**/*.go
- ./Taskfile.yml
- ./go.mod
generates:
- ./_build/featurer{{exeExt}}
method: none
cleanup:
desc: "Deletes Featurer main binary from local build cache."
cmds:
- rm -f _build/featurer{{exeExt}}

View File

@@ -0,0 +1,42 @@
package main
import (
"log/slog"
"go.dev.pztrn.name/featurer/server/internal/application"
"go.dev.pztrn.name/featurer/server/internal/services/core/datastore"
)
func main() {
_ = slog.SetLogLoggerLevel(slog.LevelDebug)
app := application.New()
slog.Info(
"Launching Featurer server...",
"version", application.Version,
"build", application.Build,
"branch", application.Branch,
"commit", application.Commit,
"build date", application.BuildDate,
)
// Initializing core services first.
checkError(datastore.Initialize(app))
// Then - features services.
// Start application.
checkError(app.Start())
<-app.GetShutdownDoneChannel()
slog.Info("Featurer stopped.")
}
func checkError(err error) {
if err == nil {
return
}
panic(err)
}