Files
nadir-agent/internal/module/module.go
T
urania 2bf11dda91
build-and-release / release (push) Failing after 17m7s
feat: first release
2026-06-22 16:51:18 +02:00

27 lines
522 B
Go

package module
import (
"nadir/internal/rbac"
"github.com/danielgtaylor/huma/v2"
)
type Module interface {
ID() string
Permissions() []rbac.Permission // permissions this module exposes (no "*")
Register(api huma.API)
}
// Title returns the display name for a module ID, capitalizing the first
// letter (modules are single lowercase words: "system" -> "System").
func Title(id string) string {
if id == "" {
return ""
}
b := id[0]
if b >= 'a' && b <= 'z' {
b -= 'a' - 'A'
}
return string(b) + id[1:]
}