Documentation ¶
Index ¶
Constants ¶
View Source
const ( SubscriberSubscribe int64 = 1 SubscriberUnsubscribe = 2 SubscriberUpdate = 5 )
View Source
const ( ChanCreate int64 = 1 ChanDelete = 2 ChanUpdate = 3 )
Variables ¶
View Source
var ( ErrChanNotExist = errors.New("channel does not exist") ErrChanAlreadyExists = errors.New("channel already exists") ErrChanClosed = errors.New("subscribe channel is closed") ErrAlreadySubscribed = errors.New("already subscribed") ErrNotSubscribed = errors.New("not subscribed") ErrNotPublisher = errors.New("not publisher") )
View Source
var (
ErrUnknownFlag = errors.New("unknown flag")
)
Functions ¶
This section is empty.
Types ¶
type ChanInfo ¶ added in v1.1.0
func NewChanInfo ¶ added in v1.1.0
type Channel ¶
type Channel interface { Subscribe(id SubscriberID, extra interface{}) error Unsubscribe(id SubscriberID) error UpdateSubscribe(id SubscriberID, extra interface{}) error Update(extra interface{}) error Publish(msg Message) error Close() error }
type ChannelUpdate ¶
type ChannelUpdate struct { Flag int64 Extra interface{} }
type Subscriber ¶
func (*Subscriber) Notify ¶
func (s *Subscriber) Notify(msg Message) error
type SubscriberID ¶ added in v1.1.0
type SubscriberID string
type Update ¶ added in v1.1.0
type Update struct { Flag int64 ID SubscriberID Extra interface{} }
Click to show internal directories.
Click to hide internal directories.