dankgo

module
v0.0.0-...-ed59ffc Latest Latest
Warning

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

Go to latest
Published: Jul 18, 2026 License: MIT

README

dankgo

Common Go modules used by DMS & the Dank Linux suite (dankcalendar, dgop, danksearch, and whatever comes next).

Every app in the suite was carrying its own copy of the same logger, unix-socket RPC, chi/huma scaffolding, and XDG path helpers. This is that code, extracted once.

Packages

Package What it is
log charmbracelet logger singleton. log.SetEnvPrefix("DANKCAL") → reads DANKCAL_LOG_LEVEL / DANKCAL_LOG_FILE. File sink strips ANSI.
paths XDG dirs + per-process socket paths, keyed by app name. paths.New("dankcal").SocketPath()
errdefs CustomError/ErrorType with HTTP status mapping. Apps register their own types from AppErrorBase up. stdlib-only.
errdefs/humaerr huma error envelope + HumaErrorFunc. Split out so non-HTTP apps never pull huma.
ipc JSON-over-unix-socket RPC: server (ping/subscribe/unsubscribe built in), client, event bus, mux. Stale sockets get reaped by PID. Apps with their own subscribe protocol set SubscribeHandler; per-connection handshake capabilities via CapabilitiesFunc.
ipc/params Typed extraction from map[string]any request params.
shellapp Quickshell app lifecycle: run/restart/kill commands, daemon supervision, PID/session tracking, config-dir resolution (-c<PREFIX>_SHELL_DIR → live instance → embedded UI). App-specific behavior hooks in via PreLaunch, ExtraEnv, OnUIExit, and an optional Done() channel on the backend.
shellapp/shellfs Materializes an embedded UI tree onto disk — content-hashed, read-only, pruned when stale.
syncmap Generic sync.Map (typed keys and values).
dbusutil godbus variant helpers: typed Get/As, recursive Normalize.
httpapi huma/chi scaffold: NewHumaConfig, /docs page, router with health + recoverer, graceful Server. Use à la carte or via NewRouter.
httpapi/middleware The chi-ported logger/recoverer/request-id set.
netutil GetIPAddress header dance.
app Thin bootstrap: app.New(info, rootCmd) wires logging + version, app.Serve(ctx, runners...) handles signals and shutdown. Not a framework.

Using it

go get github.com/AvengeMedia/dankgo@v0.1.0

Minimal daemon

a := app.New(app.Info{Name: "Dank Thing", ID: "dankthing", Version: version}, rootCmd)

srv := ipc.NewServer(ipc.Config{AppName: "dankthing", APIVersion: 1}, route)
if err := srv.Listen(); err != nil {
    return err
}
return app.Serve(ctx, srv)

Directories

Path Synopsis
middleware
From go-chi https://github.com/go-chi/chi/blob/d32a83448b5f43e42bc96487c6b0b3667a92a2e4/middleware/request_id.go
From go-chi https://github.com/go-chi/chi/blob/d32a83448b5f43e42bc96487c6b0b3667a92a2e4/middleware/request_id.go
internal
ipc
Package shellapp runs a quickshell-based desktop app: it supervises the UI process, daemonizes, tracks instances via PID files, resolves the shell config dir, and talks to a running instance over dankgo/ipc.
Package shellapp runs a quickshell-based desktop app: it supervises the UI process, daemonizes, tracks instances via PID files, resolves the shell config dir, and talks to a running instance over dankgo/ipc.
shellfs
Package shellfs materializes an embedded UI tree onto the filesystem, since quickshell needs real paths.
Package shellfs materializes an embedded UI tree onto the filesystem, since quickshell needs real paths.

Jump to

Keyboard shortcuts

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