summaryrefslogtreecommitdiffstats
path: root/conn.go
diff options
context:
space:
mode:
authorSamuel Stauffer <samuel@descolada.com>2014-03-19 22:05:10 +0100
committerSamuel Stauffer <samuel@descolada.com>2014-03-19 22:05:10 +0100
commit4e3f3713c8f6debc9a2844af538094968142a714 (patch)
tree0c479514925aabf0bf8776b7756d8a7204820aec /conn.go
parentStylistic fixes, update imports, and some format string fixes (diff)
downloadldap-4e3f3713c8f6debc9a2844af538094968142a714.tar
ldap-4e3f3713c8f6debc9a2844af538094968142a714.tar.gz
ldap-4e3f3713c8f6debc9a2844af538094968142a714.tar.bz2
ldap-4e3f3713c8f6debc9a2844af538094968142a714.tar.lz
ldap-4e3f3713c8f6debc9a2844af538094968142a714.tar.xz
ldap-4e3f3713c8f6debc9a2844af538094968142a714.tar.zst
ldap-4e3f3713c8f6debc9a2844af538094968142a714.zip
Diffstat (limited to '')
-rw-r--r--conn.go10
1 files changed, 5 insertions, 5 deletions
diff --git a/conn.go b/conn.go
index 2dca164..ab3f437 100644
--- a/conn.go
+++ b/conn.go
@@ -28,7 +28,7 @@ type messagePacket struct {
Channel chan *ber.Packet
}
-// LDAP Connection
+// Conn represents an LDAP Connection
type Conn struct {
conn net.Conn
isSSL bool
@@ -55,7 +55,7 @@ func Dial(network, addr string) (*Conn, *Error) {
return conn, nil
}
-// Dial connects to the given address on the given network using net.Dial
+// DialSSL connects to the given address on the given network using net.Dial
// and then sets up SSL connection and returns a new Conn for the connection.
func DialSSL(network, addr string, config *tls.Config) (*Conn, *Error) {
c, err := tls.Dial(network, addr, config)
@@ -68,7 +68,7 @@ func DialSSL(network, addr string, config *tls.Config) (*Conn, *Error) {
return conn, nil
}
-// Dial connects to the given address on the given network using net.Dial
+// DialTLS connects to the given address on the given network using net.Dial
// and then starts a TLS session and returns a new Conn for the connection.
func DialTLS(network, addr string, config *tls.Config) (*Conn, *Error) {
c, err := net.Dial(network, addr)
@@ -138,7 +138,7 @@ func (l *Conn) startTLS(config *tls.Config) *Error {
messageID := l.nextMessageID()
if l.isSSL {
- return NewError(ErrorNetwork, errors.New("Already encrypted"))
+ return NewError(ErrorNetwork, errors.New("ldap: already encrypted"))
}
packet := ber.Encode(ber.ClassUniversal, ber.TypeConstructed, ber.TagSequence, nil, "LDAP Request")
@@ -176,7 +176,7 @@ func (l *Conn) startTLS(config *tls.Config) *Error {
func (l *Conn) sendMessage(packet *ber.Packet) (chan *ber.Packet, *Error) {
if l.isClosing {
- return nil, NewError(ErrorNetwork, errors.New("Connection closed"))
+ return nil, NewError(ErrorNetwork, errors.New("ldap: connection closed"))
}
out := make(chan *ber.Packet)
message := &messagePacket{