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
But right now we have these if statements that do validation based on an if type check.
ift, ok:=event.(SomeBusV5) {
}
However, if we add v6, v7, v8, this if statement will just keep growing. The handler pattern works really well here.
vardefaultHandlersCDEventClientHandlers=NewCDEventClientHandlers()
.Add("v5-validation", SomeBusV5Validator)
// then when users create clients we can just inject the default handlersfuncNewCDEventsClient(ctx context.Context, options...CDEventClientOption) (*CDEventsClient, err) {
client:=&CDEventsClient {
ClientHandlers: defaultHandlers,
}
returnclient
}
The text was updated successfully, but these errors were encountered:
So this kind of depends on #92
But right now we have these if statements that do validation based on an if type check.
However, if we add v6, v7, v8, this if statement will just keep growing. The handler pattern works really well here.
The text was updated successfully, but these errors were encountered: