Initial commit.
This commit is contained in:
48
server/internal/services/core/datastore/datastore.go
Normal file
48
server/internal/services/core/datastore/datastore.go
Normal file
@@ -0,0 +1,48 @@
|
||||
package datastore
|
||||
|
||||
import (
|
||||
"fmt"
|
||||
"log/slog"
|
||||
|
||||
"go.dev.pztrn.name/featurer/server/internal/application"
|
||||
"go.dev.pztrn.name/featurer/server/internal/services/core"
|
||||
)
|
||||
|
||||
type datastore struct {
|
||||
app *application.Application
|
||||
}
|
||||
|
||||
// Initialize initializes service.
|
||||
func Initialize(app *application.Application) error {
|
||||
plan := &datastore{
|
||||
app: app,
|
||||
}
|
||||
|
||||
if err := app.RegisterService(plan); err != nil {
|
||||
return fmt.Errorf("%w: %w", core.ErrDatastore, err)
|
||||
}
|
||||
|
||||
return nil
|
||||
}
|
||||
|
||||
func (p *datastore) ConnectDependencies() error {
|
||||
return nil
|
||||
}
|
||||
|
||||
func (p *datastore) GetName() string {
|
||||
return core.ServiceNameDatastore
|
||||
}
|
||||
|
||||
func (p *datastore) Initialize() error {
|
||||
slog.Info("Initializing data storage...")
|
||||
|
||||
return nil
|
||||
}
|
||||
|
||||
func (p *datastore) LaunchStartupTasks() error {
|
||||
return nil
|
||||
}
|
||||
|
||||
func (p *datastore) Shutdown() error {
|
||||
return nil
|
||||
}
|
Reference in New Issue
Block a user