Refactor package `backend` to decouple interfaces
Nobody has claimed this yet.
- Dominant language
- Go
- Stars
- 73
- Forks
- 41
- Avg merge
- 21h 3m
- Merged PRs (30d)
- 21
Description
Development Task
Currently, BackendConnMgr calls structs Authenticator and CmdProcessor directly, which makes them coupled. It makes UT more complicated, and it will be hard to extend this module. E.g, we may override some behaviors through plugins.
We can define interface Auth for Authenticator and CmdEngine for CmdProcessor. UT can mock implementations and plugins can override the default implementation by defining another implementation.
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start in the backend package by tracing how BackendConnMgr calls Authenticator and CmdProcessor, then inspect the existing unit tests. Define the Auth and CmdEngine interfaces around the required behavior and update the manager to use implementations, including mock implementations in tests. Done means unit tests can mock both collaborators and alternate plugin implementations can provide them.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- go
- Domain
- backend
- Issue type
- Refactor
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 45/100