Skip to content

Commit

Permalink
Apply review suggestions for LDAP BBEs
Browse files Browse the repository at this point in the history
  • Loading branch information
Nuvindu committed Aug 21, 2024
1 parent 7375592 commit 70cac9c
Show file tree
Hide file tree
Showing 4 changed files with 20 additions and 19 deletions.
12 changes: 6 additions & 6 deletions examples/ldap-add-remove-entry/ldap_add_remove_entry.bal
Original file line number Diff line number Diff line change
Expand Up @@ -3,12 +3,12 @@ import ballerina/ldap;

public function main() returns error? {
// Initializes a new LDAP client with credentials.
ldap:Client ldapClient = check new ({
hostName: "localhost",
port: 389,
domainName: "cn=admin,dc=example,dc=com",
password: "adminpassword"
});
ldap:Client ldapClient = check new (
hostName = "localhost",
port = 389,
domainName = "cn=admin,dc=example,dc=com",
password = "adminpassword"
);

// Creates an `ldap:Entry` record for the new entry.
ldap:Entry addEntry = {
Expand Down
8 changes: 4 additions & 4 deletions examples/ldap-add-remove-entry/ldap_add_remove_entry.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,14 +9,14 @@ The `delete` operation removes an entry from a directory server. It requires a `
::: code ldap_add_remove_entry.bal :::

## Prerequisites

- Make sure to keep an LDAP server up and running while running the example.
- Ensure that an LDAP server is up and running locally on port 389 while running the example.

- Run the example by executing the command below.

::: out ldap_add_remove_entry.server.out :::

## Related links

- [`ldap:Client` - API documentation](https://lib.ballerina.io/ballerina/ldap/latest#Client)
- [`ldap:Client` `add` operation - API documentation](https://central.ballerina.io/ballerina/ldap/latest#Client-add)
- [`ldap:Client` `delete` operation - API documentation](https://central.ballerina.io/ballerina/ldap/latest#Client-delete)
- [`ldap` module - API documentation](https://lib.ballerina.io/ballerina/ldap/latest/)
- [`ldap:Client` - Specification](/spec/ldap/#2-ldap-client)
14 changes: 7 additions & 7 deletions examples/ldap-search-entry/ldap_search_entry.bal
Original file line number Diff line number Diff line change
Expand Up @@ -2,13 +2,13 @@ import ballerina/io;
import ballerina/ldap;

public function main() returns error? {
// Initializes a new LDAP client.
ldap:Client ldapClient = check new ({
hostName: "localhost",
port: 389,
domainName: "cn=admin,dc=example,dc=com",
password: "adminpassword"
});
// Initializes a new LDAP client with credentials.
ldap:Client ldapClient = check new (
hostName = "localhost",
port = 389,
domainName = "cn=admin,dc=example,dc=com",
password = "adminpassword"
);

// Searches for an entry in the directory server.
ldap:SearchResult searchResult = check ldapClient->search(
Expand Down
5 changes: 3 additions & 2 deletions examples/ldap-search-entry/ldap_search_entry.md
Original file line number Diff line number Diff line change
Expand Up @@ -13,12 +13,13 @@ When a directory server processes a valid search request, it finds entries withi
::: code ldap_search_entry.bal :::

## Prerequisites
- Make sure to keep an LDAP server up and running while running the example.
- Ensure that an LDAP server is up and running locally on port 389 while running the example.

- Run the example by executing the command below.

::: out ldap_search_entry.server.out :::

## Related links
- [`ldap:Client` - API documentation](https://lib.ballerina.io/ballerina/ldap/latest#Client)
- [`ldap:Client` `search` operation - API documentation](https://central.ballerina.io/ballerina/ldap/latest#Client-search)
- [`ldap` module - API documentation](https://lib.ballerina.io/ballerina/ldap/latest/)
- [`ldap:Client` - Specification](/spec/ldap/#2-ldap-client)

0 comments on commit 70cac9c

Please sign in to comment.