Skip to content

Plugins Ecosystem (goforge-plugins) ​

The goforge-plugins repository provides an experimental plugin surface alongside GoForge.

Early WIP Status

goforge-plugins is currently an early prototype (no go.mod or goforge CLI plugin installer yet). Only observability/ contains code today; auth/, cache/, graphql/, job-queue/, and scheduler/ are planned placeholders. For production user authentication today, use Limen (see Security & Authentication).


observability.Plugin Interface (observability/plugin.go) ​

go
type Plugin interface {
	Name() string
	Apply(engine *gin.Engine)
	Shutdown(ctx context.Context) error
}

OpenTelemetry Plugin (observability/otel/otel.go) ​

  • otel.New(otel.Config{ServiceName, OTLPEndpoint, MetricsPath}) initializes an otlptracegrpc exporter + sdktrace.TracerProvider (reading OTEL_SERVICE_NAME, OTEL_EXPORTER_OTLP_ENDPOINT, OTEL_METRICS_PATH).
  • Apply(engine) wraps requests with otelhttp.NewHandler and registers GET <MetricsPath> (currently returns a placeholder metrics text stub until a Prometheus exporter is wired).
  • To obtain *gin.Engine from boot.App, iterate app.Servers and type-assert *server.HTTPServer:
go
for _, srv := range app.Servers {
	if httpSrv, ok := srv.(*server.HTTPServer); ok {
		p.Apply(httpSrv.Engine())
	}
}

Released under the Apache-2.0 License.