Skip to content

Commit a3ed1b1

Browse files
lampajrstalep
authored andcommitted
Update clients reference
1 parent dd9790c commit a3ed1b1

File tree

1 file changed

+9
-3
lines changed

1 file changed

+9
-3
lines changed

docs/site/content/en/docs/Reference/horreum-clients.md

+9-3
Original file line numberDiff line numberDiff line change
@@ -35,15 +35,15 @@ import asyncio
3535
> `asyncio` is required because the client leverages it to perform async requests to the server.
3636
3737
```python
38-
from horreum import new_horreum_client
38+
from horreum import new_horreum_client, HorreumCredentials
3939
```
4040

4141
> `new_horreum_client` utility function to setup the `HorreumClient` instance
4242
4343
Initialize the Horreum client
4444

4545
```python
46-
client = await new_horreum_client(base_url="http://localhost:8080", username="user", password="secret")
46+
client = await new_horreum_client(base_url="http://localhost:8080", credentials=HorreumCredentials(username=username, password=password))
4747
```
4848

4949
Now let's start playing with it
@@ -87,7 +87,13 @@ var (
8787
Initialize the Horreum client
8888

8989
```go
90-
client, err := horreum.NewHorreumClient("http://localhost:8080", &username, &password)
90+
client, err := horreum.NewHorreumClient("http://localhost:8080",
91+
&horreum.HorreumCredentials{
92+
Username: &username,
93+
Password: &password,
94+
},
95+
nil,
96+
)
9197
if err != nil {
9298
log.Fatalf("error creating Horreum client: %s", err.Error())
9399
}

0 commit comments

Comments
 (0)