# go-ldap/ldap architecture

> Architecture diagram of the GitHub repository go-ldap/ldap, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2026-10-04). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/go-ldap/ldap
- Repository: https://github.com/go-ldap/ldap

## Overview

This is a Go LDAPv3 client library: application code connects to a directory server, performs LDAP operations, and consumes responses or errors. The graph preserves the README’s major operation families and the core protocol, search, identity, and authentication capabilities. Source excerpts show connection setup and a bind delegation; most operation-to-transport wiring was not shown, so those internal links are omitted rather than inferred.

Main entry points: [`v3/client.go`](https://github.com/go-ldap/ldap/blob/master/v3/client.go) (Client interface), [`v3/bind.go`](https://github.com/go-ldap/ldap/blob/master/v3/bind.go) (Bind operations), [`v3/conn.go`](https://github.com/go-ldap/ldap/blob/master/v3/conn.go) (Connection), [`v3/control.go`](https://github.com/go-ldap/ldap/blob/master/v3/control.go) (LDAP controls)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_transport["Connection and protocol"]
  node_connection["Connection<br/>[conn.go]"]
  node_packet["Protocol packets<br/>[packet.go]"]
  node_responses["Responses and errors<br/>[response.go]"]
  node_controls["LDAP controls<br/>[control.go]"]
end

subgraph group_operations["Directory operations"]
  node_search["Search and sync<br/>[search.go]"]
  node_modify["Modify entries<br/>[modify.go]"]
  node_add["Add entries<br/>[add.go]"]
  node_delete["Delete entries<br/>[del.go]"]
  node_modifydn["Rename entries<br/>[moddn.go]"]
  node_extended["Extended operations<br/>[extended.go]"]
  node_password["Password modify<br/>[passwdmodify.go]"]
  node_whoami["Who Am I<br/>[whoami.go]"]
  node_api["Client interface<br/>[client.go]"]
end

subgraph group_identity["Identity and filters"]
  node_dn["Distinguished names<br/>[dn.go]"]
  node_filters["Filter compile<br/>[filter.go]"]
end

subgraph group_auth["Authentication"]
  node_bind["Bind operations<br/>[bind.go]"]
  node_gssapi["GSSAPI client<br/>[client.go]"]
  node_sspi["Windows SSPI<br/>[sspi.go]"]
end

node_application(("Application"))
node_directory(("LDAP server"))

node_application -->|"connects"| node_connection
node_connection -->|"communicates"| node_directory
node_application -->|"uses"| node_api
node_api -->|"offers search"| node_search
node_api -->|"offers modify"| node_modify
node_api -->|"offers add"| node_add
node_api -->|"offers delete"| node_delete
node_api -->|"offers rename"| node_modifydn
node_api -->|"offers extended"| node_extended
node_api -->|"offers password"| node_password
node_api -->|"offers identity"| node_whoami
node_api -->|"offers bind"| node_bind
node_bind -->|"delegates simple bind"| node_bind
node_application -->|"parses names"| node_dn
node_application -->|"compiles filters"| node_filters
node_application -->|"configures controls"| node_controls
node_bind -.->|"supports GSSAPI"| node_gssapi
node_bind -.->|"supports Windows auth"| node_sspi

click node_connection "https://github.com/go-ldap/ldap/blob/master/v3/conn.go"
click node_packet "https://github.com/go-ldap/ldap/blob/master/v3/packet.go"
click node_responses "https://github.com/go-ldap/ldap/blob/master/v3/response.go"
click node_controls "https://github.com/go-ldap/ldap/blob/master/v3/control.go"
click node_search "https://github.com/go-ldap/ldap/blob/master/v3/search.go"
click node_modify "https://github.com/go-ldap/ldap/blob/master/v3/modify.go"
click node_add "https://github.com/go-ldap/ldap/blob/master/v3/add.go"
click node_delete "https://github.com/go-ldap/ldap/blob/master/v3/del.go"
click node_modifydn "https://github.com/go-ldap/ldap/blob/master/v3/moddn.go"
click node_extended "https://github.com/go-ldap/ldap/blob/master/v3/extended.go"
click node_password "https://github.com/go-ldap/ldap/blob/master/v3/passwdmodify.go"
click node_whoami "https://github.com/go-ldap/ldap/blob/master/v3/whoami.go"
click node_bind "https://github.com/go-ldap/ldap/blob/master/v3/bind.go"
click node_gssapi "https://github.com/go-ldap/ldap/blob/master/v3/gssapi/client.go"
click node_sspi "https://github.com/go-ldap/ldap/blob/master/v3/gssapi/sspi.go"
click node_dn "https://github.com/go-ldap/ldap/blob/master/v3/dn.go"
click node_filters "https://github.com/go-ldap/ldap/blob/master/v3/filter.go"
click node_api "https://github.com/go-ldap/ldap/blob/master/v3/client.go"

classDef toneNeutral fill:#f8fafc,stroke:#334155,stroke-width:1.5px,color:#0f172a
classDef toneBlue fill:#dbeafe,stroke:#2563eb,stroke-width:1.5px,color:#172554
classDef toneAmber fill:#fef3c7,stroke:#d97706,stroke-width:1.5px,color:#78350f
classDef toneMint fill:#dcfce7,stroke:#16a34a,stroke-width:1.5px,color:#14532d
classDef toneRose fill:#ffe4e6,stroke:#e11d48,stroke-width:1.5px,color:#881337
classDef toneIndigo fill:#e0e7ff,stroke:#4f46e5,stroke-width:1.5px,color:#312e81
classDef toneTeal fill:#ccfbf1,stroke:#0f766e,stroke-width:1.5px,color:#134e4a
class node_connection,node_packet,node_responses,node_controls toneBlue
class node_search,node_modify,node_add,node_delete,node_modifydn,node_extended,node_password,node_whoami,node_api toneAmber
class node_dn,node_filters,node_directory toneMint
class node_bind,node_gssapi,node_sspi toneRose
class node_application toneIndigo
```

## Components

### Connection and protocol

- [Connection](https://github.com/go-ldap/ldap/blob/master/v3/conn.go): `v3/conn.go`
- [Protocol packets](https://github.com/go-ldap/ldap/blob/master/v3/packet.go): `v3/packet.go`
- [Responses and errors](https://github.com/go-ldap/ldap/blob/master/v3/response.go): `v3/response.go`
- [LDAP controls](https://github.com/go-ldap/ldap/blob/master/v3/control.go): `v3/control.go`

### Directory operations

- [Search and sync](https://github.com/go-ldap/ldap/blob/master/v3/search.go): `v3/search.go`
- [Modify entries](https://github.com/go-ldap/ldap/blob/master/v3/modify.go): `v3/modify.go`
- [Add entries](https://github.com/go-ldap/ldap/blob/master/v3/add.go): `v3/add.go`
- [Delete entries](https://github.com/go-ldap/ldap/blob/master/v3/del.go): `v3/del.go`
- [Rename entries](https://github.com/go-ldap/ldap/blob/master/v3/moddn.go): `v3/moddn.go`
- [Extended operations](https://github.com/go-ldap/ldap/blob/master/v3/extended.go): `v3/extended.go`
- [Password modify](https://github.com/go-ldap/ldap/blob/master/v3/passwdmodify.go): `v3/passwdmodify.go`
- [Who Am I](https://github.com/go-ldap/ldap/blob/master/v3/whoami.go): `v3/whoami.go`
- [Client interface](https://github.com/go-ldap/ldap/blob/master/v3/client.go): `v3/client.go`

### Identity and filters

- [Distinguished names](https://github.com/go-ldap/ldap/blob/master/v3/dn.go): `v3/dn.go`
- [Filter compile](https://github.com/go-ldap/ldap/blob/master/v3/filter.go): `v3/filter.go`

### Authentication

- [Bind operations](https://github.com/go-ldap/ldap/blob/master/v3/bind.go): `v3/bind.go`
- [GSSAPI client](https://github.com/go-ldap/ldap/blob/master/v3/gssapi/client.go): `v3/gssapi/client.go`
- [Windows SSPI](https://github.com/go-ldap/ldap/blob/master/v3/gssapi/sspi.go): `v3/gssapi/sspi.go`

### Other components

- **Application**
- **LDAP server**

## Connections

- Application → Connection: connects (evidence: `README.md`)
- Connection → LDAP server: communicates (evidence: `README.md`)
- Application → Client interface: uses (evidence: `README.md`)
- Client interface → Search and sync: offers search (evidence: `v3/client.go`)
- Client interface → Modify entries: offers modify (evidence: `v3/client.go`)
- Client interface → Add entries: offers add (evidence: `README.md`)
- Client interface → Delete entries: offers delete (evidence: `README.md`)
- Client interface → Rename entries: offers rename (evidence: `v3/client.go`)
- Client interface → Extended operations: offers extended (evidence: `v3/client.go`)
- Client interface → Password modify: offers password (evidence: `v3/client.go`)
- Client interface → Who Am I: offers identity (evidence: `README.md`)
- Client interface → Bind operations: offers bind (evidence: `v3/client.go`)
- Bind operations → Bind operations: delegates simple bind (evidence: `v3/bind.go`)
- Application → Distinguished names: parses names (evidence: `README.md`)
- Application → Filter compile: compiles filters (evidence: `README.md`)
- Application → LDAP controls: configures controls (evidence: `README.md`)
- Bind operations → GSSAPI client: supports GSSAPI
- Bind operations → Windows SSPI: supports Windows auth
