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 | Status |
|---|---|---|---|
| LibraryUtils | github.com/AmadlaOrg/LibraryUtils |
Foundation utilities: git, file, database, IPC, encryption | Active |
| LibraryFramework | github.com/AmadlaOrg/LibraryFramework |
CLI framework wrapper around Cobra | Active |
| LibraryPluginFramework | github.com/AmadlaOrg/LibraryPluginFramework |
Base plugin loading and IPC communication | Active |
| LibraryClerkFramework | github.com/AmadlaOrg/LibraryClerkFramework |
Clerk plugin specialization for secret sources | Active |
| LibraryAuditFramework | github.com/AmadlaOrg/LibraryAuditFramework |
Auditor plugin specialization for compliance checks | Active |
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
- LibraryClerkFramework — Depends on LibraryUtils
- LibraryAuditFramework — Depends on LibraryUtils, LibraryFramework
Shared Patterns¶
All libraries follow these conventions:
- Interface-based design:
I-prefixed interfaces (IGit,IFile,IDatabase) - Struct implementations:
S-prefixed structs (SGit,SFile) - Constructors:
New*Service()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