go/pkg/framework/framework.go
Snider f4da42d095 refactor(framework): rename package from framework to core
Aligns package name with directory structure (pkg/framework/core).
Fixes doc comment in e.go and adds core binary to gitignore.

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-30 09:45:18 +00:00

67 lines
1.7 KiB
Go

// Package framework provides the Core DI/service framework.
// Import this package for cleaner access to the framework types.
//
// Usage:
//
// import "github.com/host-uk/core/pkg/framework"
//
// app, _ := framework.New(
// framework.WithServiceLock(),
// )
package framework
import (
"github.com/host-uk/core/pkg/framework/core"
)
// Re-export core types for cleaner imports
type (
Core = core.Core
Option = core.Option
Message = core.Message
Startable = core.Startable
Stoppable = core.Stoppable
Config = core.Config
Display = core.Display
WindowOption = core.WindowOption
Features = core.Features
Contract = core.Contract
Error = core.Error
ServiceRuntime[T any] = core.ServiceRuntime[T]
Runtime = core.Runtime
ServiceFactory = core.ServiceFactory
)
// Re-export core functions
var (
New = core.New
WithService = core.WithService
WithName = core.WithName
WithApp = core.WithApp
WithAssets = core.WithAssets
WithServiceLock = core.WithServiceLock
App = core.App
E = core.E
NewRuntime = core.NewRuntime
NewWithFactories = core.NewWithFactories
)
// NewServiceRuntime creates a new ServiceRuntime for a service.
func NewServiceRuntime[T any](c *Core, opts T) *ServiceRuntime[T] {
return core.NewServiceRuntime(c, opts)
}
// Re-export generic functions
func ServiceFor[T any](c *Core, name string) (T, error) {
return core.ServiceFor[T](c, name)
}
func MustServiceFor[T any](c *Core, name string) T {
return core.MustServiceFor[T](c, name)
}
// Action types
type (
ActionServiceStartup = core.ActionServiceStartup
ActionServiceShutdown = core.ActionServiceShutdown
)