handler

package
v0.0.0-...-45afcdd Latest Latest
Warning

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

Go to latest
Published: Jul 13, 2015 License: MIT Imports: 13 Imported by: 0

Documentation

Index

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)
)
View Source
var ErrHand = errors.New("HEAD ERROR ")

Functions

This section is empty.

Types

type NsqHandler

type NsqHandler struct {
	// contains filtered or unexported fields
}

func (*NsqHandler) HandleMessage

func (self *NsqHandler) HandleMessage(message *nsq.Message) error

type NsqRouteRequest

type NsqRouteRequest struct {
	sync.RWMutex
	Id        uint32 //用户id
	Typ       uint16 //消息类型
	RouteName string //来源路由服务器 -回写使用
	// contains filtered or unexported fields
}

用来预处理nsq 发过来的数据

func (*NsqRouteRequest) BaseByte

func (self *NsqRouteRequest) BaseByte() []byte

func (*NsqRouteRequest) Byte

func (self *NsqRouteRequest) Byte() []byte

func (NsqRouteRequest) Copy

func (self NsqRouteRequest) Copy() lib.Request

func (*NsqRouteRequest) GetId

func (self *NsqRouteRequest) GetId() uint32

func (*NsqRouteRequest) GetRoute

func (self *NsqRouteRequest) GetRoute() string

func (*NsqRouteRequest) Marshal

func (self *NsqRouteRequest) Marshal(data interface{}) (err error)

func (*NsqRouteRequest) Reset

func (self *NsqRouteRequest) Reset()

func (*NsqRouteRequest) SetId

func (self *NsqRouteRequest) SetId(id uint32)

func (*NsqRouteRequest) SetRoute

func (self *NsqRouteRequest) SetRoute(name string)

func (*NsqRouteRequest) SetType

func (self *NsqRouteRequest) SetType(id uint16)

func (*NsqRouteRequest) Type

func (self *NsqRouteRequest) Type() uint16

func (*NsqRouteRequest) Unmarshal

func (self *NsqRouteRequest) Unmarshal(info interface{}) (err error)

func (*NsqRouteRequest) UnmarshalData

func (self *NsqRouteRequest) UnmarshalData(data []byte) (err error)

type RouteRequest

type RouteRequest struct {
	sync.RWMutex
	Id        uint32 //用户id
	Typ       uint16 //消息类型
	RouteName string //来源路由服务器 -回写使用
	// contains filtered or unexported fields
}

用来预处理nsq 发过来的数据

func (RouteRequest) BaseByte

func (self RouteRequest) BaseByte() []byte

func (RouteRequest) Byte

func (self RouteRequest) Byte() []byte

func (RouteRequest) Copy

func (self RouteRequest) Copy() Request

func (RouteRequest) GetId

func (self RouteRequest) GetId() uint32

func (RouteRequest) GetRoute

func (self RouteRequest) GetRoute() string

func (*RouteRequest) Marshal

func (self *RouteRequest) Marshal(data interface{}) (err error)

func (*RouteRequest) MarshalData

func (self *RouteRequest) MarshalData() []byte

func (*RouteRequest) Reset

func (self *RouteRequest) Reset()

func (*RouteRequest) SetId

func (self *RouteRequest) SetId(id uint32)

func (*RouteRequest) SetRoute

func (self *RouteRequest) SetRoute(s string)

func (*RouteRequest) SetType

func (self *RouteRequest) SetType(id uint16)

func (*RouteRequest) Type

func (self *RouteRequest) Type() uint16

func (*RouteRequest) Unmarshal

func (self *RouteRequest) Unmarshal(info interface{}) (err error)

func (*RouteRequest) UnmarshalData

func (self *RouteRequest) UnmarshalData(data []byte) (err error)

type RouteResponseWrite

type RouteResponseWrite struct {
	sync.RWMutex
	RouteName string

	Id uint32
	// contains filtered or unexported fields
}

func (*RouteResponseWrite) Close

func (self *RouteResponseWrite) Close() (err error)

* 重点用在nsq 向route 发送数据时。

func (*RouteResponseWrite) Write

func (self *RouteResponseWrite) Write(body []byte) (n int, err error)

func (*RouteResponseWrite) WriteToConsumer

func (self *RouteResponseWrite) WriteToConsumer(body []byte) (n int, err error)

type SocketServer

type SocketServer struct {
	// contains filtered or unexported fields
}

func (*SocketServer) Run

func (self *SocketServer) Run(conf Configure) error

func (*SocketServer) Stop

func (self *SocketServer) Stop()

Jump to

Keyboard shortcuts

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