func (conn *Connection) Disconnect() {
	conn.socket.Disconnect()
}
Disconnect disconnects from the server.
package lib
import (
	"crypto/tls"
	"errors"
	"fmt"
	"strings"
	"github.com/ergochat/irc-go/ircmsg"
)
type ConnectionConfig struct {
	Host      string
	Port      int
	TLS       bool
	TLSConfig *tls.Config
}
type Connection struct {
	config         ConnectionConfig
	socket         *Socket
	hiddenCommands *map[string]bool
}
func NewConnection(config ConnectionConfig, hiddenCommands *map[string]bool) (*Connection, error) {
	if config.Port < 1 || 65535 < config.Port {
		return nil, errors.New("Port must be a number 1-65535")
	}
	socket, err := ConnectSocket(config.Host, config.Port, config.TLS, config.TLSConfig)
	if err != nil {
		return nil, err
	}
	return &Connection{
		config:         config,
		socket:         socket,
		hiddenCommands: hiddenCommands,
	}, nil
}
func (conn *Connection) GetLine() (string, error) {
	line, err := conn.socket.GetLine()
	return line, err
}
func (conn *Connection) SendMessage(print bool, tags map[string]string, prefix string, command string, params ...string) error {
	message := ircmsg.MakeMessage(tags, prefix, command, params...)
	line, err := message.Line()
	if err != nil {
		return err
	}
	line = strings.TrimRight(line, "\r\n")
	if print && !(*conn.hiddenCommands)[strings.ToUpper(command)] {
		fmt.Println(line)
	}
	conn.socket.SendLine(line)
	return nil
}
func (conn *Connection) SendLine(line string) error {
	return conn.socket.SendLine(line)
}