Skip to content

Commit

Permalink
Update clients reference
Browse files Browse the repository at this point in the history
  • Loading branch information
lampajr committed Apr 24, 2024
1 parent d93c4e4 commit 6f30408
Showing 1 changed file with 9 additions and 3 deletions.
12 changes: 9 additions & 3 deletions docs/site/content/en/docs/Reference/horreum-clients.md
Original file line number Diff line number Diff line change
Expand Up @@ -35,15 +35,15 @@ import asyncio
> `asyncio` is required because the client leverages it to perform async requests to the server.
```python
from horreum import new_horreum_client
from horreum import new_horreum_client, HorreumCredentials
```

> `new_horreum_client` utility function to setup the `HorreumClient` instance
Initialize the Horreum client

```python
client = await new_horreum_client(base_url="http://localhost:8080", username="user", password="secret")
client = await new_horreum_client(base_url="http://localhost:8080", credentials=HorreumCredentials(username=username, password=password))
```

Now let's start playing with it
Expand Down Expand Up @@ -87,7 +87,13 @@ var (
Initialize the Horreum client

```go
client, err := horreum.NewHorreumClient("http://localhost:8080", &username, &password)
client, err := horreum.NewHorreumClient("http://localhost:8080",
&horreum.HorreumCredentials{
Username: &username,
Password: &password,
},
nil,
)
if err != nil {
log.Fatalf("error creating Horreum client: %s", err.Error())
}
Expand Down

0 comments on commit 6f30408

Please sign in to comment.