listen

package
v0.0.0-...-46dda04 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jan 28, 2016 License: MIT Imports: 7 Imported by: 0

Documentation

Index

Constants

View Source
const (
	ADD = iota + 1
	RM
)
View Source
const (
	KW = iota + 1
	SB
)

Variables

This section is empty.

Functions

This section is empty.

Types

type Conf

type Conf struct {
	NetWork string
	Address string
	Timeout int

	KwsChannel string
	SbsChannel string
}

func NewConf

func NewConf(path string) (conf *Conf, err error)

func (*Conf) Dail

func (this *Conf) Dail() (conn redis.Conn, err error)

type Listener

type Listener struct {
	AddKeywordsChan    chan []*Keyword
	RemoveKeywordsChan chan []*Keyword
	AddSymbolsChan     chan []string
	RemoveSymbolsChan  chan []string
	// contains filtered or unexported fields
}

func New

func New(path string) (l *Listener, err error)

func (*Listener) AddKeywords

func (this *Listener) AddKeywords() <-chan []*Keyword

func (*Listener) AddSymbols

func (this *Listener) AddSymbols() <-chan []string

func (*Listener) RemoveKeywords

func (this *Listener) RemoveKeywords() <-chan []*Keyword

func (*Listener) RemoveSymbols

func (this *Listener) RemoveSymbols() <-chan []string

func (*Listener) Send

func (this *Listener) Send(kind int, data []byte) (err error)

func (*Listener) Subscribe

func (this *Listener) Subscribe(kws, sbs string)

type Notify

type Notify struct {
	Action int
	Data   interface{}
}

func NewNotify

func NewNotify(kind int, data []byte) (n *Notify, err error)

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL