runtime

package
v0.7.4 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jul 22, 2026 License: Apache-2.0 Imports: 23 Imported by: 0

Documentation

Overview

Package runtime owns the standard Procyon application bootstrap and lifecycle. Applications supply only their business composition, routes, policies, event handlers and migrations.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Run

func Run(ctx context.Context, opts Options) error

Run initializes the framework, composes the project, starts all HTTP servers and shuts components down in reverse order.

Types

type Application

type Application struct {
	RegisterEvents func(*coreevents.Bus) error
	Policies       func() []authz.Policy
	Authorization  func() authz.Options
	SetAuthorizer  func(*authz.CasbinAuthorizer)
	RegisterRoutes func(Routes) error
	Shutdown       func(context.Context) error
}

Application contains project-owned lifecycle callbacks. Nil callbacks are treated as no-ops.

type ApplicationFactory

type ApplicationFactory func(context.Context, Dependencies) (Application, error)

type Dependencies

type Dependencies struct {
	Config       coreconfig.Config
	DB           *gorm.DB
	Logger       *zap.Logger
	Events       *coreevents.Bus
	Metrics      *telemetry.BusinessMetrics
	Capabilities *coreplugins.CapabilityRegistry
}

Dependencies are the framework-owned services available while composing an application's business layer.

type Options

type Options struct {
	Version             string
	ConfigPath          string
	StaticDir           string
	DefaultLanguage     string
	Migrate             bool
	ShutdownTimeout     time.Duration
	PluginRegistrations []coreplugins.Registration
	MigrateApplication  func(context.Context, Dependencies) error
	NewApplication      ApplicationFactory
	Validator           echo.Validator
}

Options configures the standard Procyon runtime.

type Routes

type Routes struct {
	Public          *echo.Echo
	API             *echo.Group
	Authenticated   *echo.Group
	Admin           *echo.Group
	Upload          *echo.Group
	UploadRoot      *echo.Group
	Operations      *echo.Echo
	Require         func(domain, object, action string) echo.MiddlewareFunc
	Authenticate    echo.MiddlewareFunc
	RequireAdminKey echo.MiddlewareFunc
}

Routes exposes the stable route groups owned by the runtime.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL