Skip to content

Commit fc46c85

Browse files
committed
Update docs
1 parent 6657456 commit fc46c85

File tree

1 file changed

+11
-2
lines changed

1 file changed

+11
-2
lines changed

README.md

Lines changed: 11 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -76,7 +76,16 @@ if err != nil {
7676
// handle error
7777
}
7878
fmt.Printf("limit: %d, used: %d, remaining: %d, reset: %s\n", resp.Limit, resp.Used, resp.Remaining, resp.Reset)
79-
// Output: limit: 1000, used: 0, remaining: 1000, reset: 2025-02-01 23:59:59 +0000 +00
79+
// Output: limit: 1000, used: 0, remaining: 1000, reset: 2025-01-31 23:59:59 +0000 UTC
80+
```
81+
82+
You can also get the rate limits from the response headers:
83+
```go
84+
email, resp, err := client.CreateEmail(context.Background(), tempmail.CreateEmailOptions{})
85+
if err != nil {
86+
// handle error
87+
}
88+
fmt.Printf("Rate limit: %d\n", resp.Rate.Limit)
8089
```
8190

8291
### Creating Temporary Emails
@@ -85,7 +94,7 @@ email, _, err := client.CreateEmail(context.Background(), tempmail.CreateEmailOp
8594
Domain: "example.com",
8695
})
8796
if err != nil {
88-
// handle error
97+
// handle error
8998
}
9099
fmt.Printf("Created temporary email: %s (TTL: %d seconds)\n", email.Email, email.TTL)
91100
```

0 commit comments

Comments
 (0)