Documentation ¶
Index ¶
- Constants
- func NewClientModule() *application.ModuleBuilder
- func NewMainModule() *application.ModuleBuilder
- func NewServerModule() *application.ModuleBuilder
- func NewTestModule() *application.ModuleBuilder
- type Client
- type ClientSideConnection
- type Configuration
- type Connection
- type Connector
- type Downstream
- type HandlerSelector
- type HandlerSelectorBuilder
- type Headers
- type Listener
- type Location
- type Option
- type RxStream
- type Server
- type ServerSideConnection
- type TxStream
- type Upstream
Constants ¶
View Source
const ( NameProtocol = "TBMP/1.0" NameClient = "TBMP.client/1.0" NameServer = "TBMP.server/1.0" )
定义协议的名称(和版本)
View Source
const ( HeaderContentType = "Content-Type" HeaderProtocol = "Protocol" HeaderMethod = "Method" HeaderURL = "URL" HeaderClient = "Client" HeaderServer = "Server" HeaderStatus = "Status" )
定义一些常用的头部字段名称
Variables ¶
This section is empty.
Functions ¶
func NewClientModule ¶ added in v0.0.2
func NewClientModule() *application.ModuleBuilder
NewClientModule make module (client)
func NewMainModule ¶
func NewMainModule() *application.ModuleBuilder
NewMainModule make module (main)
func NewServerModule ¶ added in v0.0.2
func NewServerModule() *application.ModuleBuilder
NewServerModule make module (server)
func NewTestModule ¶ added in v0.0.2
func NewTestModule() *application.ModuleBuilder
NewTestModule make module (test)
Types ¶
type ClientSideConnection ¶
type ClientSideConnection interface { Connection Downstream() (RxStream, error) Upstream(input ...*Headers) (TxStream, error) }
ClientSideConnection ...
type Configuration ¶
type Configuration struct { Method string Protocol string Host string Port int Username string Password string Secure bool Headers Headers }
Configuration ...
type Connector ¶
type Connector interface {
Connect(url string, options ...Option) (ClientSideConnection, error)
}
Connector 表示一个 TBMP 连接器
type Downstream ¶ added in v0.0.2
Downstream ...
type HandlerSelector ¶ added in v0.0.2
type HandlerSelector string
HandlerSelector 是一个字符串,用于选择 handler
type HandlerSelectorBuilder ¶ added in v0.0.2
HandlerSelectorBuilder ...
func (*HandlerSelectorBuilder) Create ¶ added in v0.0.2
func (inst *HandlerSelectorBuilder) Create() HandlerSelector
Create ...
type Listener ¶
type Listener interface { io.Closer Accept() (ServerSideConnection, error) }
Listener ...
type Location ¶ added in v0.0.2
type Location struct { Scheme string User string Host string Port int Path string Query map[string]string Fragment string }
Location ...
type Option ¶ added in v0.0.2
type Option func(cfg *Configuration)
Option 定义选项函数的签名
func OptionHeader ¶ added in v0.0.2
OptionHeader 用于设置 header
func OptionMethod ¶ added in v0.0.2
OptionMethod 用于设置 method
type Server ¶
type Server interface { Name() string SetName(name string) Listen(cfg *Configuration) (Listener, error) }
Server ...
type ServerSideConnection ¶
type ServerSideConnection interface { Connection Upstream() (RxStream, error) Downstream(input ...*Headers) (TxStream, error) }
ServerSideConnection ...
Source Files ¶
Click to show internal directories.
Click to hide internal directories.