Documentation
¶
Index ¶
- func HandleError(err error)
- func HandlePanic(x any)
- type Agent
- type Configuration
- type Connection
- type ConnectionParams
- type Connector
- type ConnectorRegistration
- type Context
- type HypertextConnection
- type HypertextConnector
- type HypertextHeaders
- type HypertextRequest
- type HypertextResponse
- type Listener
- type ListenerParams
- type Mode
- type PktlineConnection
- type PktlineConnector
- type SimpleConnection
- type SimpleConnector
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type Agent ¶
type Agent interface { Connect(p *ConnectionParams) (Connection, error) Listen(p *ListenerParams) (Listener, error) }
Agent 代表一个 what 客户端
type Configuration ¶
Configuration ...
type ConnectionParams ¶
type ConnectionParams struct { Service string Mode Mode URL string // a station node URL DoGet bool // for listener to get connection Timeout time.Duration }
ConnectionParams ...
type Connector ¶
type Connector interface { Connect(c *Context, p *ConnectionParams) (Connection, error) Registration() *ConnectorRegistration }
Connector ...
type ConnectorRegistration ¶
type ConnectorRegistration struct { Enabled bool Priority int Name string Mode Mode Connector Connector Support func(*ConnectionParams) bool }
ConnectorRegistration ...
type Context ¶
type Context struct { Connectors []Connector Agent Agent Config Configuration }
Context ...
type HypertextConnection ¶
type HypertextConnection interface { Connection Do(req *HypertextRequest) (*HypertextResponse, error) }
HypertextConnection ...
type HypertextConnector ¶
type HypertextConnector struct { }
HypertextConnector ...
func (*HypertextConnector) Connect ¶
func (inst *HypertextConnector) Connect(c *Context, p *ConnectionParams) (Connection, error)
Connect ...
func (*HypertextConnector) Registration ¶
func (inst *HypertextConnector) Registration() *ConnectorRegistration
Registration ...
type HypertextHeaders ¶
type HypertextHeaders struct {
// contains filtered or unexported fields
}
HypertextHeaders ...
type HypertextRequest ¶
type HypertextRequest struct { Protocol string Method string URL string Headers HypertextHeaders Content []byte }
HypertextRequest ...
type HypertextResponse ¶
type HypertextResponse struct { Protocol string Request *HypertextRequest Status int Message string Headers HypertextHeaders Connection PktlineConnection Content []byte }
HypertextResponse ...
func (*HypertextResponse) Error ¶
func (inst *HypertextResponse) Error() error
Error 如果响应结果有误,封装成 error; 否则返回 nil
type Listener ¶
type Listener interface { io.Closer Accept() (Connection, error) }
Listener 代表一个 what 服务监听器
type Mode ¶
type Mode string
Mode ... 表示连接模式
type PktlineConnection ¶
type PktlineConnection interface { Connection pktline.Reader pktline.Writer }
PktlineConnection ...
type PktlineConnector ¶
type PktlineConnector struct { }
PktlineConnector ...
func (*PktlineConnector) Connect ¶
func (inst *PktlineConnector) Connect(c *Context, p *ConnectionParams) (Connection, error)
Connect ...
func (*PktlineConnector) Registration ¶
func (inst *PktlineConnector) Registration() *ConnectorRegistration
Registration ...
type SimpleConnection ¶
type SimpleConnection interface { Connection io.Reader io.Writer }
SimpleConnection ...
type SimpleConnector ¶
type SimpleConnector struct { }
SimpleConnector ...
func (*SimpleConnector) Connect ¶
func (inst *SimpleConnector) Connect(c *Context, p *ConnectionParams) (Connection, error)
Connect ...
func (*SimpleConnector) Registration ¶
func (inst *SimpleConnector) Registration() *ConnectorRegistration
Registration ...
Click to show internal directories.
Click to hide internal directories.