Skip to content

v3 refactoring with interface-based testability #3

Merged
sthelen-enqs merged 3 commits intodevfrom
feature/v3-interfaces-and-testability
Feb 23, 2026
Merged

v3 refactoring with interface-based testability #3
sthelen-enqs merged 3 commits intodevfrom
feature/v3-interfaces-and-testability

Conversation

@DerAndereAndi
Copy link
Copy Markdown
Member

  • Add api/ package with PacketConn, ConnectionFactory, InterfaceProvider interfaces
  • Add mocks/ package with mockery-generated mocks for testing
  • Split connection.go into conn_factory.go, conn_ipv4.go, conn_ipv6.go, conn_provider.go
  • Rename connection.go to mdns.go (contains only mDNS constants)
  • Export Client type and add NewClient() constructor
  • Add WithClientConnFactory and WithServerConnFactory options for mock injection
  • Remove deprecated Server.TTL() method
  • Add comprehensive unit tests (87.6% coverage)
  • Update README with v3 examples and testing documentation
  • Bump version to v3.0.0

Breaking changes:

  • Browse() now requires a 'removed' channel parameter
  • Module path is github.com/enbility/zeroconf/v3

Breaking change release targeting:
- Proper interfaces for testability
- Dependency injection
- Generated mocks
- Improved test coverage
- Removal of global state
- Add api/ package with PacketConn, ConnectionFactory, InterfaceProvider interfaces
- Add mocks/ package with mockery-generated mocks for testing
- Split connection.go into conn_factory.go, conn_ipv4.go, conn_ipv6.go, conn_provider.go
- Rename connection.go to mdns.go (contains only mDNS constants)
- Export Client type and add NewClient() constructor
- Add WithClientConnFactory and WithServerConnFactory options for mock injection
- Remove deprecated Server.TTL() method
- Add comprehensive unit tests (87.6% coverage)
- Update README with v3 examples and testing documentation
- Bump version to v3.0.0

Breaking changes:
- Browse() now requires a 'removed' channel parameter
- Module path is github.com/enbility/zeroconf/v3
Copy link
Copy Markdown
Contributor

@sthelen-enqs sthelen-enqs left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Other than the comment about maybe moving the refactoring plan, LGTM.

@sthelen-enqs sthelen-enqs merged commit bab96fa into dev Feb 23, 2026
@sthelen-enqs sthelen-enqs deleted the feature/v3-interfaces-and-testability branch February 23, 2026 11:07
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants