init transport

This commit is contained in:
Marcelo Pires 2018-09-05 01:04:40 +02:00
parent b8d1d7dc3d
commit 518d141dca
2 changed files with 14 additions and 4 deletions

View File

@ -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
}

View File

@ -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
}