Libraries Overview¶
Amadla's shared Go libraries provide common functionality used across all tools and plugins. They form a layered dependency hierarchy with LibraryUtils at the foundation.
Library Inventory¶
| Library | Module | Purpose |
|---|---|---|
| LibraryUtils | github.com/AmadlaOrg/LibraryUtils |
Foundation utilities: git, file, database, IPC, encryption |
| LibraryFramework | github.com/AmadlaOrg/LibraryFramework |
CLI framework wrapper around Cobra |
| LibraryPluginFramework | github.com/AmadlaOrg/LibraryPluginFramework |
Base plugin loading and IPC communication |
| LibraryDoormanFramework | github.com/AmadlaOrg/LibraryDoormanFramework |
Doorman plugin specialization for secret sources |
| LibraryJudgeFramework | github.com/AmadlaOrg/LibraryJudgeFramework |
Judge plugin specialization for compliance checks |
| LibraryEnjoinFramework | github.com/AmadlaOrg/LibraryEnjoinFramework |
Enjoin plugin specialization for system state configuration |
Dependency Graph¶
Build Order¶
Libraries must be built bottom-up due to replace directives:
- LibraryUtils — No Amadla dependencies
- LibraryFramework — Depends on LibraryUtils
- LibraryPluginFramework — Depends on LibraryUtils
- LibraryDoormanFramework — Depends on LibraryUtils
- LibraryJudgeFramework — Depends on LibraryUtils, LibraryFramework
- LibraryEnjoinFramework — Depends on LibraryUtils, LibraryFramework
Shared Patterns¶
All libraries follow these conventions:
- Interface-based design: Idiomatic Go naming (
Git,File,Database) - Struct implementations: Unexported structs (
gitImpl,fileImpl) - Constructors:
New()functions returning interface types - Mock generation: Mockery v2 configured in
.mockery.yaml - Testing: testify/assert + testify/mock (except hery which uses Ginkgo/Gomega)
- Local references:
replacedirectives ingo.modfor sibling directories