overflow_subscriber/subscriber.go

27 lines
631 B
Go
Raw 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-09-01 06:13:18 +00:00
Subscribe(h SubscriberHandler) error
Unsubscribe(h SubscriberHandler) error
2017-08-30 02:06:34 +00:00
}