You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
refactor: implement builder pattern for OmnectDeviceServiceClient with lifecycle management
This refactoring improves the architecture of OmnectDeviceServiceClient by:
- Implementing a type-safe builder pattern as the only way to create the client
- Making certificate setup optional and injectable via closure
- Making publish endpoint registration optional
- Extracting client creation into dedicated build_service_client() function
- Bumping version to 1.0.6
Key changes:
- OmnectDeviceServiceClient fields are now private, enforcing builder usage
- Builder supports optional certificate setup via with_certificate_setup()
- Builder supports optional publish endpoint via with_publish_endpoint()
- Certificate payload (CreateCertPayload) is now public and reusable
- Removed intermediate WorkloadCertPayload struct for simplicity
- Shutdown is now a DeviceServiceClient trait method called explicitly from main
- Improved Dockerfile to copy entire src directory structure
This design provides better encapsulation, clearer lifecycle management,
and looser coupling between modules through dependency injection.
Signed-off-by: Jan Zachmann <50990105+JanZachmann@users.noreply.github.com>
0 commit comments