github.com/glide-im/glide@v1.6.0/pkg/subscription/chan.go (about) 1 package subscription 2 3 //goland:noinspection GoUnusedGlobalVariable 4 var ( 5 ErrChanNotExist = "channel does not exist" 6 ErrChanAlreadyExists = "channel already exists" 7 ErrChanClosed = "subscribe channel is closed" 8 ErrAlreadySubscribed = "already subscribed" 9 ErrNotSubscribed = "not subscribed" 10 ErrNotPublisher = "not publisher" 11 ) 12 13 type Subscriber struct { 14 ID string 15 Type string 16 } 17 18 func (s *Subscriber) Notify(msg Message) error { 19 return nil 20 } 21 22 type Channel interface { 23 Subscribe(id SubscriberID, extra interface{}) error 24 25 Unsubscribe(id SubscriberID) error 26 27 Update(i *ChanInfo) error 28 29 Publish(msg Message) error 30 31 Close() error 32 }