Documentation ¶
Index ¶
- Variables
- type FilterFunc
- type ListFunc
- type RedisStorage
- func (r *RedisStorage) Delegate(obj interface{})
- func (r *RedisStorage) DelegateErr(err error)
- func (r *RedisStorage) Id() string
- func (r *RedisStorage) Key() string
- func (r *RedisStorage) Notify(data interface{}) error
- func (r *RedisStorage) NotifyResponse(traceId string, resp []byte) error
- func (r *RedisStorage) NotifyResult(traceId string, timeout int, data interface{}) ([]byte, error)
- func (r *RedisStorage) NotifyWatch(traceId string, stopCh <-chan struct{}) <-chan []byte
- func (r *RedisStorage) Result() <-chan interface{}
- func (r *RedisStorage) Run()
- func (r *RedisStorage) Stop() error
- func (r *RedisStorage) WatchErr() <-chan error
- func (r *RedisStorage) Watched() (bool, error)
- type SharedWatch
- type Storage
Constants ¶
This section is empty.
Variables ¶
View Source
var ErrNotWatch = errors.New("watch key is not subscribed")
View Source
var ErrTimeout = errors.New("result timeout")
Functions ¶
This section is empty.
Types ¶
type FilterFunc ¶
type FilterFunc func(interface{}) bool
type RedisStorage ¶
type RedisStorage struct {
// contains filtered or unexported fields
}
func (*RedisStorage) Delegate ¶
func (r *RedisStorage) Delegate(obj interface{})
func (*RedisStorage) DelegateErr ¶
func (r *RedisStorage) DelegateErr(err error)
func (*RedisStorage) Id ¶
func (r *RedisStorage) Id() string
func (*RedisStorage) Key ¶
func (r *RedisStorage) Key() string
func (*RedisStorage) Notify ¶
func (r *RedisStorage) Notify(data interface{}) error
func (*RedisStorage) NotifyResponse ¶
func (r *RedisStorage) NotifyResponse(traceId string, resp []byte) error
func (*RedisStorage) NotifyResult ¶
func (r *RedisStorage) NotifyResult(traceId string, timeout int, data interface{}) ([]byte, error)
func (*RedisStorage) NotifyWatch ¶
func (r *RedisStorage) NotifyWatch(traceId string, stopCh <-chan struct{}) <-chan []byte
func (*RedisStorage) Result ¶
func (r *RedisStorage) Result() <-chan interface{}
func (*RedisStorage) Run ¶
func (r *RedisStorage) Run()
func (*RedisStorage) Stop ¶
func (r *RedisStorage) Stop() error
func (*RedisStorage) WatchErr ¶
func (r *RedisStorage) WatchErr() <-chan error
func (*RedisStorage) Watched ¶
func (r *RedisStorage) Watched() (bool, error)
type SharedWatch ¶
type SharedWatch struct {
// contains filtered or unexported fields
}
SharedWatch 在一个实例中共享同一个watchKey的监听
func (*SharedWatch) Stop ¶
func (s *SharedWatch) Stop(watchKey string, delegate sharedWatchDelegate)
Stop 停止对该委托对象的监听
type Storage ¶
type Storage interface { Key() string Stop() error Run() Result() <-chan interface{} WatchErr() <-chan error Notify(interface{}) error Watched() (bool, error) NotifyResult(traceId string, timeout int, data interface{}) ([]byte, error) NotifyWatch(traceId string, stopCh <-chan struct{}) <-chan []byte NotifyResponse(traceId string, resp []byte) error }
func NewRedisStorage ¶
Click to show internal directories.
Click to hide internal directories.