mirror of
https://github.com/empayre/fleet.git
synced 2024-11-06 08:55:24 +00:00
fb32f0cf40
Generally renamed `kolide` -> `fleet`
25 lines
681 B
Go
25 lines
681 B
Go
// Package pubsub implements pub/sub interfaces defined in package fleet.
|
|
package pubsub
|
|
|
|
// Error defines the interface of errors specific to the pubsub package
|
|
type Error interface {
|
|
error
|
|
// NoSubscriber returns true if the error occurred because there are no
|
|
// subscribers on the channel
|
|
NoSubscriber() bool
|
|
}
|
|
|
|
// NoSubscriberError can be returned when channel operations fail because there
|
|
// are no subscribers. Its NoSubscriber() method always returns true.
|
|
type noSubscriberError struct {
|
|
Channel string
|
|
}
|
|
|
|
func (e noSubscriberError) Error() string {
|
|
return "no subscriber for channel " + e.Channel
|
|
}
|
|
|
|
func (e noSubscriberError) NoSubscriber() bool {
|
|
return true
|
|
}
|