DRY up the factory methods

use optional functions to set address functions
This commit is contained in:
2026-02-07 14:23:46 +00:00
parent 3c47d12719
commit 23422f9641
11 changed files with 99 additions and 93 deletions

View File

@@ -26,7 +26,7 @@ type engine struct {
respChan chan *osc.Message
}
func newEngine(mixerIP string, mixerPort int, kind mixerKind, opts ...Option) (*engine, error) {
func newEngine(mixerIP string, mixerPort int, kind mixerKind, opts ...EngineOption) (*engine, error) {
localAddr, err := net.ResolveUDPAddr("udp", fmt.Sprintf(":%d", 0))
if err != nil {
return nil, fmt.Errorf("failed to resolve local address: %v", err)