No description
Find a file
Snider 954cd714a1 fix: strip module prefix from coverage paths for Codecov
Co-Authored-By: Virgil <virgil@lethean.io>
2026-03-21 09:16:24 +00:00
.claude chore: save LocaleProvider and Locales changes 2026-03-17 01:45:42 +00:00
.core feat: add .core/ build and release configuration 2026-03-06 17:40:40 +00:00
.githooks chore(githooks): fix pre-commit QA 2026-02-05 22:07:14 +00:00
.github/workflows fix: strip module prefix from coverage paths for Codecov 2026-03-21 09:16:24 +00:00
docs docs: remove implemented plans, annotate partial ones 2026-03-14 08:09:20 +00:00
tests refactor: flatten polyglot layout to standard Go module 2026-03-21 08:27:14 +00:00
.editorconfig chore: add Go repo norms (badges, contributing, lint, taskfile, editorconfig) 2026-02-23 06:45:52 +00:00
.gitattributes feat: git command, build improvements, and go fmt git-aware (#74) 2026-02-01 10:48:44 +00:00
.gitignore chore: ignore workspace and IDE dirs 2026-03-15 10:21:42 +00:00
.mcp.json chore: save LocaleProvider and Locales changes 2026-03-17 01:45:42 +00:00
app.go refactor: flatten polyglot layout to standard Go module 2026-03-21 08:27:14 +00:00
array.go refactor: flatten polyglot layout to standard Go module 2026-03-21 08:27:14 +00:00
CLAUDE.md feat: integrate mnt into Core struct — c.Mnt() for mount operations 2026-03-18 00:06:29 +00:00
cli.go refactor: flatten polyglot layout to standard Go module 2026-03-21 08:27:14 +00:00
command.go refactor: flatten polyglot layout to standard Go module 2026-03-21 08:27:14 +00:00
config.go refactor: flatten polyglot layout to standard Go module 2026-03-21 08:27:14 +00:00
contract.go refactor: flatten polyglot layout to standard Go module 2026-03-21 08:27:14 +00:00
core.go refactor: flatten polyglot layout to standard Go module 2026-03-21 08:27:14 +00:00
data.go refactor: flatten polyglot layout to standard Go module 2026-03-21 08:27:14 +00:00
drive.go refactor: flatten polyglot layout to standard Go module 2026-03-21 08:27:14 +00:00
embed.go refactor: flatten polyglot layout to standard Go module 2026-03-21 08:27:14 +00:00
error.go refactor: flatten polyglot layout to standard Go module 2026-03-21 08:27:14 +00:00
fs.go refactor: flatten polyglot layout to standard Go module 2026-03-21 08:27:14 +00:00
go.mod refactor: flatten polyglot layout to standard Go module 2026-03-21 08:27:14 +00:00
go.sum refactor: flatten polyglot layout to standard Go module 2026-03-21 08:27:14 +00:00
i18n.go refactor: flatten polyglot layout to standard Go module 2026-03-21 08:27:14 +00:00
ipc.go refactor: flatten polyglot layout to standard Go module 2026-03-21 08:27:14 +00:00
LICENSE.txt Add initial project structure with core functionality and basic files 2025-10-24 04:55:10 +01:00
lock.go refactor: flatten polyglot layout to standard Go module 2026-03-21 08:27:14 +00:00
log.go refactor: flatten polyglot layout to standard Go module 2026-03-21 08:27:14 +00:00
options.go refactor: flatten polyglot layout to standard Go module 2026-03-21 08:27:14 +00:00
README.md docs: rewrite README + add CI workflow with Codecov 2026-03-21 09:00:13 +00:00
runtime.go refactor: flatten polyglot layout to standard Go module 2026-03-21 08:27:14 +00:00
service.go refactor: flatten polyglot layout to standard Go module 2026-03-21 08:27:14 +00:00
string.go refactor: flatten polyglot layout to standard Go module 2026-03-21 08:27:14 +00:00
task.go refactor: flatten polyglot layout to standard Go module 2026-03-21 08:27:14 +00:00
utils.go refactor: flatten polyglot layout to standard Go module 2026-03-21 08:27:14 +00:00

Core

codecov Go Version License Go Reference

Dependency injection and service lifecycle framework for Go. Zero external dependencies beyond testify for tests.

import "dappco.re/go/core"

Quick Start

c := core.New(core.Options{
    {Key: "name", Value: "myapp"},
})

// Register a service
c.Service("auth", core.Service{
    OnStart:  func() core.Result { return core.Result{OK: true} },
    OnStop:   func() core.Result { return core.Result{OK: true} },
})

// Retrieve it
r := c.Service("auth")
if r.OK { /* use r.Value */ }

// Register and run commands
c.Command("deploy", handler)
c.Cli().Run()

Primitives

Options

Key-value pairs that flow through all subsystems:

opts := core.Options{
    {Key: "name", Value: "brain"},
    {Key: "port", Value: 8080},
}

name := opts.String("name")
port := opts.Int("port")
ok   := opts.Has("debug")

Result

Universal return type replacing (value, error):

r := c.Data().New(core.Options{{Key: "name", Value: "store"}})
if r.OK { use(r.Value) }

// Map from Go conventions
r.Result(file, err)   // OK = err == nil, Value = file

Service

Managed component with optional lifecycle hooks:

core.Service{
    Name:     "cache",
    Options:  opts,
    OnStart:  func() core.Result { /* ... */ },
    OnStop:   func() core.Result { /* ... */ },
    OnReload: func() core.Result { /* ... */ },
}

Subsystems

Accessor Purpose
c.Options() Input configuration
c.App() Application identity
c.Data() Embedded/stored content
c.Drive() Resource handle registry
c.Fs() Local filesystem I/O
c.Config() Configuration + feature flags
c.Cli() CLI surface layer
c.Command("path") Command tree
c.Service("name") Service registry
c.Lock("name") Named mutexes
c.IPC() Message bus

IPC / Message Bus

Fire-and-forget actions, request/response queries, and task dispatch:

// Register a handler
c.IPC().On(func(c *core.Core, msg core.Message) core.Result {
    // handle message
    return core.Result{OK: true}
})

// Dispatch
c.IPC().Action(core.Message{Action: "cache.flush"})

Install

go get dappco.re/go/core@latest

License

EUPL-1.2