Documentation ¶
Index ¶
Constants ¶
View Source
const ( EncryptionOff = 0 EncryptionRequired = 1 EncryptionDisabled = 3 )
Variables ¶
View Source
var ProtocolDialers map[string]ProtocolDialer = map[string]ProtocolDialer{}
View Source
var ProtocolParsers []ProtocolParser = []ProtocolParser{
tcpParser{},
}
ProtocolParsers is an ordered list of protocols that can be dialed. Each parser must have a corresponding Dialer in mssql.ProtocolDialers
Functions ¶
func SetupTLS ¶
func SetupTLS(certificate string, insecureSkipVerify bool, hostInCertificate string, minTLSVersion string) (*tls.Config, error)
Build a tls.Config object from the supplied certificate.
func TLSVersionFromString ¶
Types ¶
type BrowserData ¶
type Config ¶
type Config struct { Port uint64 Host string Instance string Database string User string Password string Encryption Encryption TLSConfig *tls.Config FailOverPartner string FailOverPort uint64 // If true the TLSConfig servername should use the routed server. HostInCertificateProvided bool // Read Only intent for application database. // NOTE: This does not make queries to most databases read-only. ReadOnlyIntent bool LogFlags Log ServerSPN string Workstation string AppName string // If true disables database/sql's automatic retry of queries // that start on bad connections. DisableRetry bool DialTimeout time.Duration // DialTimeout defaults to 15s per protocol. Set negative to disable. ConnTimeout time.Duration // Use context for timeouts. KeepAlive time.Duration // Leave at default. PacketSize uint16 Parameters map[string]string // Protocols is an ordered list of protocols to dial Protocols []string // ProtocolParameters are written by non-tcp ProtocolParser implementations ProtocolParameters map[string]interface{} }
type Encryption ¶
type Encryption int
type ProtocolDialer ¶
type ProtocolDialer interface { // Translates data from SQL Browser to parameters in the config ParseBrowserData(data BrowserData, p *Config) error // DialConnection eturns a Dialer to make the connection. On success, also set Config.ServerSPN if it is unset. DialConnection(ctx context.Context, p *Config) (conn net.Conn, err error) // Returns true if information is needed from the SQL Browser service to make a connection CallBrowser(p *Config) bool }
ProtocolDialer makes the network connection for a protocol
Click to show internal directories.
Click to hide internal directories.