Documentation ¶
Index ¶
Constants ¶
View Source
const ( // InstanceEventTopic 服务发现事件主题 InstanceEventTopic = "instance_event" // LeaderChangeEventTopic LeaderChangeEventTopic = "leader_change_event" )
事件主题
Variables ¶
This section is empty.
Functions ¶
func Subscribe ¶
Subscribe subscribe topic @param topic Topic name @param name Subscribe name @param handler Message handler @param opts Subscription options @return error Subscribe failed, return error
func Unsubscribe ¶
Unsubscribe unsubscribe topic @param topic Topic name @param name Subscribe name
Types ¶
type Handler ¶
type Handler interface { // PreProcess do preprocess logic for event PreProcess(context.Context, any) any // OnEvent event process logic OnEvent(ctx context.Context, any2 any) error }
Handler event handler
Click to show internal directories.
Click to hide internal directories.