cli/runtime.go
Snider 003996b148 refactor: Flatten repository structure (#28)
- Move Go files from core, e, and runtime directories to the project root.
- Unify package declarations to a single 'core' package.
- Update go.work to exclude the cmd directory from the main build.
- Resolve naming conflicts and update import paths.
- Fix tests to work with the new structure.

Co-authored-by: google-labs-jules[bot] <161369871+google-labs-jules[bot]@users.noreply.github.com>
2025-11-13 18:47:46 +00:00

25 lines
626 B
Go

package core
// ServiceRuntime is a helper struct embedded in services to provide access to the core application.
type ServiceRuntime[T any] struct {
core *Core
opts T
}
// NewServiceRuntime creates a new ServiceRuntime instance for a service.
func NewServiceRuntime[T any](c *Core, opts T) *ServiceRuntime[T] {
return &ServiceRuntime[T]{
core: c,
opts: opts,
}
}
// Core returns the central core instance.
func (r *ServiceRuntime[T]) Core() *Core {
return r.core
}
// Config returns the registered Config service from the core application.
func (r *ServiceRuntime[T]) Config() Config {
return r.core.Config()
}