overflow_subscriber/subscriber.go
crusader efdb4f8699 ing
2017-09-01 15:13:18 +09:00

27 lines
631 B
Go

package overflow_subscriber
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)
}
type Subscriber interface {
Subscribe(h SubscriberHandler) error
Unsubscribe(h SubscriberHandler) error
}