Documentation ¶
Index ¶
- Variables
- type JsonRequest
- func (self *JsonRequest) BaseByte() []byte
- func (self *JsonRequest) Byte() []byte
- func (self JsonRequest) Copy() RequestByNsq
- func (self *JsonRequest) GetId() uint64
- func (self *JsonRequest) GetRoute() string
- func (self *JsonRequest) Marshal(data interface{}) (err error)
- func (self *JsonRequest) Reset()
- func (self *JsonRequest) SetId(id uint64)
- func (self *JsonRequest) SetRoute(name string)
- func (self *JsonRequest) SetType(id uint16)
- func (self *JsonRequest) Type() uint16
- func (self *JsonRequest) Unmarshal(info interface{}) error
- func (self *JsonRequest) UnmarshalData(data []byte) (err error)
- type JsonResponseWrite
- type NsqReaderHandler
- type ReaderHandler
Constants ¶
This section is empty.
Variables ¶
View Source
var ( Error = log.New(os.Stderr, "ERROR ", log.Lshortfile|log.LstdFlags) Debug = log.New(os.Stderr, "DEBUG ", log.Lshortfile|log.LstdFlags) NewReaderHandler *ReaderHandler )
Functions ¶
This section is empty.
Types ¶
type JsonRequest ¶
type JsonRequest struct { sync.RWMutex Typ uint16 //消息类型 Id uint64 //用户id RouteName string //来源路由服务器 -回写使用 // contains filtered or unexported fields }
用来预处理nsq 发过来的数据
func (*JsonRequest) BaseByte ¶
func (self *JsonRequest) BaseByte() []byte
func (*JsonRequest) Byte ¶
func (self *JsonRequest) Byte() []byte
func (JsonRequest) Copy ¶
func (self JsonRequest) Copy() RequestByNsq
func (*JsonRequest) GetId ¶
func (self *JsonRequest) GetId() uint64
func (*JsonRequest) GetRoute ¶
func (self *JsonRequest) GetRoute() string
func (*JsonRequest) Marshal ¶
func (self *JsonRequest) Marshal(data interface{}) (err error)
func (*JsonRequest) Reset ¶
func (self *JsonRequest) Reset()
func (*JsonRequest) SetId ¶
func (self *JsonRequest) SetId(id uint64)
func (*JsonRequest) SetRoute ¶
func (self *JsonRequest) SetRoute(name string)
func (*JsonRequest) SetType ¶
func (self *JsonRequest) SetType(id uint16)
func (*JsonRequest) Type ¶
func (self *JsonRequest) Type() uint16
func (*JsonRequest) Unmarshal ¶
func (self *JsonRequest) Unmarshal(info interface{}) error
func (*JsonRequest) UnmarshalData ¶
func (self *JsonRequest) UnmarshalData(data []byte) (err error)
type JsonResponseWrite ¶
func (*JsonResponseWrite) Close ¶
func (self *JsonResponseWrite) Close() (err error)
* 重点用在nsq 向route 发送数据时。
func (*JsonResponseWrite) Write ¶
func (self *JsonResponseWrite) Write(body []byte) (err error)
type NsqReaderHandler ¶
type NsqReaderHandler struct { Producer *nsq.Producer // contains filtered or unexported fields }
func (*NsqReaderHandler) HandleMessage ¶
func (self *NsqReaderHandler) HandleMessage(message *nsq.Message) error
type ReaderHandler ¶
type ReaderHandler struct { Consumer *nsq.Consumer Producer *nsq.Producer // contains filtered or unexported fields }
func (*ReaderHandler) Run ¶
func (self *ReaderHandler) Run(conf *Configure) error
func (*ReaderHandler) Stop ¶
func (self *ReaderHandler) Stop()
Click to show internal directories.
Click to hide internal directories.