overflow_subscriber/subscriber.go

30 lines
655 B
Go
Raw Permalink Normal View History

2017-08-30 02:06:34 +00:00
package overflow_subscriber
2017-09-01 06:13:18 +00:00
import "fmt"
type ChannelExistError struct {
Channel string
}
// Error returns the formatted configuration error.
func (cee ChannelExistError) Error() string {
return fmt.Sprintf("Subscriber: Channel[%q] is already subscribed.", cee.Channel)
}
type ChannelIsNotExistError struct {
Channel string
}
// Error returns the formatted configuration error.
func (cinee ChannelIsNotExistError) Error() string {
return fmt.Sprintf("Subscriber: Channel[%q] is not subscribed.", cinee.Channel)
}
2017-08-30 02:06:34 +00:00
type Subscriber interface {
2017-11-09 09:39:21 +00:00
Start() error
Stop()
2017-09-01 06:13:18 +00:00
Subscribe(h SubscriberHandler) error
Unsubscribe(h SubscriberHandler) error
2017-08-30 02:06:34 +00:00
}