Documentation ¶ Index ¶ type Msg type PqPubSub func NewPQ(dsn string) (*PqPubSub, error) func (l *PqPubSub) Close() error func (l *PqPubSub) Listener() chan Msg func (l *PqPubSub) Publish(key, payload string) error func (l *PqPubSub) Subscribe(_ context.Context, key string) error func (l *PqPubSub) Unsubscribe(_ context.Context, key string) error type PubSub Constants ¶ This section is empty. Variables ¶ This section is empty. Functions ¶ This section is empty. Types ¶ type Msg ¶ type Msg struct { Key string Payload string } type PqPubSub ¶ type PqPubSub struct { Notify chan Msg L *pq.Listener Log log.Logger // contains filtered or unexported fields } func NewPQ ¶ func NewPQ(dsn string) (*PqPubSub, error) func (*PqPubSub) Close ¶ func (l *PqPubSub) Close() error func (*PqPubSub) Listener ¶ func (l *PqPubSub) Listener() chan Msg func (*PqPubSub) Publish ¶ func (l *PqPubSub) Publish(key, payload string) error func (*PqPubSub) Subscribe ¶ func (l *PqPubSub) Subscribe(_ context.Context, key string) error func (*PqPubSub) Unsubscribe ¶ func (l *PqPubSub) Unsubscribe(_ context.Context, key string) error type PubSub ¶ type PubSub interface { Subscribe(ctx context.Context, key string) error Unsubscribe(ctx context.Context, key string) error Publish(key, payload string) error Listener() chan Msg Close() error } Source Files ¶ View all Source files pq.go pubsub.go Click to show internal directories. Click to hide internal directories.