Forked from
Eclipse Projects / xfsc / Organisational Credential Manager - W-Stack / Status List Service
36 commits behind the upstream repository.
Code owners
Assign users and groups as approvers for specific file changes. Learn more.
main.go 1.07 KiB
package main
import (
"context"
log "github.com/sirupsen/logrus"
ctxPkg "gitlab.eclipse.org/eclipse/xfsc/libraries/microservice/core/pkg/ctx"
logPkg "gitlab.eclipse.org/eclipse/xfsc/libraries/microservice/core/pkg/logr"
"gitlab.eclipse.org/eclipse/xfsc/organisational-credential-manager-w-stack/status-list-service/internal/api"
"gitlab.eclipse.org/eclipse/xfsc/organisational-credential-manager-w-stack/status-list-service/internal/config"
"gitlab.eclipse.org/eclipse/xfsc/organisational-credential-manager-w-stack/status-list-service/internal/database"
)
func main() {
ctx := context.Background()
if err := config.Load(); err != nil {
log.Fatalf("failed to load config: %v", err)
}
currentConf := &config.CurrentStatusListConfig
logger, err := logPkg.New(currentConf.LogLevel, currentConf.IsDev, nil)
if err != nil {
log.Fatalf("failed to init logger: %v", err)
}
ctx = ctxPkg.WithLogger(ctx, *logger)
dbConf := ¤tConf.Database
db, err := database.New(ctx, *dbConf, currentConf.BlockSizeInBytes)
api.Listen(db, currentConf.Port, currentConf.CreationTopic)
}