Split out TransportConfiguration

This allows using the same transport configuration from both clients and components.
This commit is contained in:
Wichert Akkerman
2019-10-11 06:24:27 +02:00
committed by Mickaël Rémond
parent 66e219844b
commit 96fccbd399
4 changed files with 26 additions and 22 deletions

View File

@@ -1,12 +1,15 @@
package xmpp
import (
"crypto/tls"
"io"
"os"
)
type Config struct {
// TransportConfiguration must not be modified after having been passed to NewClient. Any
// changes made after connecting are ignored.
TransportConfiguration
Address string
Jid string
parsedJid *Jid // For easier manipulation
@@ -14,9 +17,6 @@ type Config struct {
StreamLogger *os.File // Used for debugging
Lang string // TODO: should default to 'en'
ConnectTimeout int // Client timeout in seconds. Default to 15
// tls.Config must not be modified after having been passed to NewClient. Any
// changes made after connecting are ignored.
TLSConfig *tls.Config
// Insecure can be set to true to allow to open a session without TLS. If TLS
// is supported on the server, we will still try to use it.
Insecure bool