Skip to content

Latest commit

 

History

History
52 lines (38 loc) · 1.41 KB

File metadata and controls

52 lines (38 loc) · 1.41 KB

starterapplication

Tier: Starter · Status: Full · Java original: firefly-starter-application · .NET project: FireflyFramework.Starter.Application

Overview

starterapplication composes startercore with a pre-wired plugins.Registry — the canonical application-tier wiring used by services that load plugins (IDP, orchestration, rule-engine integrations) at startup.

type Application struct {
    *startercore.Core
    Plugins *plugins.Registry
}

func New(cfg startercore.Config) *Application

The StarterName defaults to "starter-application" (overriding the Core default "starter-core") so the actuator /info and the startup banner correctly identify the tier.

Quick start

import (
    "context"
    "github.com/fireflyframework/fireflyframework-go/plugins"
    "github.com/fireflyframework/fireflyframework-go/starterapplication"
    "github.com/fireflyframework/fireflyframework-go/startercore"
)

app := starterapplication.New(startercore.Config{AppName: "approval-engine"})

app.Plugins.Register(idpPlugin{adapter: keycloakAdapter})
app.Plugins.Register(ruleEnginePlugin{loader: yamlLoader})

if err := app.Plugins.StartAll(ctx); err != nil { panic(err) }
defer app.Plugins.StopAll(ctx)

Testing

cd starterapplication
go test ./...

Covers the wired Plugin Registry being non-nil and roundtrip plugin start + stop.