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
@dgduncan, as a user I want to be able to remove, disable or re-enable hooks. This flexibility allows users to configure mochi on runtime which can be very beneficial on various concepts, such as tenant isolation.
Proposal
mqtt.Server has a public method which allows users to add hooks.
For that, a mqtt.HookBase needs to be embedded into custom hook struct.
// ID returns the ID of the hook.typemyCustomHookstruct {
mqtt.HookBase
}
func (h*myCustomHook ) ID() string {
return"my-custom-hook"
}
Since every hook has to implement func (...) ID() string than we could find it's reference in the broker hence a server method like below would be straightforward and self-explanatory for the user.
// RemoveHook removes a hook by it's id.func (s*Server) RemoveHook(idstring) error
The text was updated successfully, but these errors were encountered:
yusufcanb
added a commit
to yusufcanb/server
that referenced
this issue
Jul 23, 2024
Use Case
@dgduncan, as a user I want to be able to remove, disable or re-enable hooks. This flexibility allows users to configure mochi on runtime which can be very beneficial on various concepts, such as tenant isolation.
Proposal
mqtt.Server
has a public method which allows users to add hooks.For that, a
mqtt.HookBase
needs to be embedded into custom hook struct.Since every hook has to implement
func (...) ID() string
than we could find it's reference in the broker hence a server method like below would be straightforward and self-explanatory for the user.The text was updated successfully, but these errors were encountered: