Documentation ¶
Index ¶
- type Asker
- type HttpAsker
- func (a *HttpAsker) Connect() error
- func (a *HttpAsker) NewRequest(method string, uri string, params map[string]string) *ghttp.Request
- func (a *HttpAsker) Send(req *ghttp.Request, callback func(*ghttp.Context)) error
- func (a *HttpAsker) SetWorkHandler()
- func (a *HttpAsker) Write(data *[]byte, length int32) error
- type IAsker
- func NewAsker(socketType define.SocketType, site int32, laddr *net.TCPAddr, nWork int32, ...) (IAsker, error)
- func NewHttpAsker(site int32, laddr *net.TCPAddr, nConnect int32, nWork int32) (IAsker, error)
- func NewTcp0Asker(site int32, laddr *net.TCPAddr, nConnect int32, nWork int32, ...) (IAsker, error)
- type Tcp0Asker
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Asker ¶
type Asker struct {
// contains filtered or unexported fields
}
func (*Asker) GetAddress ¶
type HttpAsker ¶
type HttpAsker struct { *Asker // 依序處理請求 Handlers map[int32]ghttp.HandlerFunc // contains filtered or unexported fields }
func (*HttpAsker) NewRequest ¶
func (*HttpAsker) SetWorkHandler ¶
func (a *HttpAsker) SetWorkHandler()
[Work State: 1] 由外部定義 workHandler,定義如何處理工作
type IAsker ¶
type IAsker interface { // 開始連線 Connect() error // 執行一次主迴圈 Handler() // 取得連線位置 GetAddress() (string, int32) // 供外部寫出數據(寫到寫出緩存中) Write(*[]byte, int32) error }
func NewHttpAsker ¶
type Tcp0Asker ¶
type Tcp0Asker struct { *Asker // contains filtered or unexported fields }
func (*Tcp0Asker) SetWorkHandler ¶
由外部定義 workHandler,定義如何處理工作
Click to show internal directories.
Click to hide internal directories.