init transport
This commit is contained in:
parent
b8d1d7dc3d
commit
518d141dca
16
client.go
16
client.go
@ -6,9 +6,9 @@ import (
|
||||
)
|
||||
|
||||
type options struct {
|
||||
inExtension message.Extension
|
||||
outExtension message.Extension
|
||||
transport transport.Transport
|
||||
inExt message.Extension
|
||||
outExt message.Extension
|
||||
transport transport.Transport
|
||||
}
|
||||
|
||||
var defaultOpts = options{
|
||||
@ -36,6 +36,16 @@ func NewClient(url string, opts ...Option) (*Client, error) {
|
||||
for _, opt := range opts {
|
||||
opt(&c.opts)
|
||||
}
|
||||
tops := &transport.Options{
|
||||
Url: url,
|
||||
InExt: c.opts.inExt,
|
||||
OutExt: c.opts.outExt,
|
||||
}
|
||||
|
||||
err := c.opts.transport.Init(tops)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
return &c, nil
|
||||
}
|
||||
|
||||
|
@ -7,7 +7,7 @@ import "github.com/thesyncim/faye/message"
|
||||
type Options struct {
|
||||
Url string
|
||||
InExt message.Extension
|
||||
outExt message.Extension
|
||||
OutExt message.Extension
|
||||
//todo dial timeout
|
||||
//todo read/write deadline
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user