Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
View Source
var ( // ErrNotSupport is returned when the callback handler does not support // the callback format. ErrNotSupport = fmt.Errorf("no support") )
Functions ¶
Types ¶
type Callback ¶
type Callback interface { // Callback is the handler to parse the callback address and send // the notification. // // The second argument, value, is the changed and new value. // // If the implementation cannot parse or handle the callback, it should // return an error, ErrNotSupport. Callback(callback string, value string) error }
Callback defines an interface of the callback notification handler.
func RegisterCallback ¶
RegisterCallback registers a callback notification handler with a name.
Notice: If the name has been registered, it will replace the old one and return it. If callback is nil, it will panic.
type CallbackFunc ¶
CallbackFunc converts a function to Callback.
func (CallbackFunc) Callback ¶
func (c CallbackFunc) Callback(callback, value string) error
Callback implements the interface Callback.
Click to show internal directories.
Click to hide internal directories.