Skip to content

Commit eb23331

Browse files
committed
docs(readme): update code examples and formatting
Add code block syntax highlighting and fix import path in documentation. Improve readability by using proper markdown code blocks with language hints and consistent spacing throughout the documentation.
1 parent 39d2919 commit eb23331

File tree

2 files changed

+19
-8
lines changed

2 files changed

+19
-8
lines changed

README.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -37,6 +37,7 @@ Once imported, create a new Backstage API client to access different parts of Ba
3737
```go
3838
client, err := backstage.NewClient(baseURL, "default", nil)
3939
```
40+
4041
If you want to use a custom HTTP client (for example, to handle authentication, retries or different timeouts), you can pass it as the
4142
third argument:
4243

doc.go

Lines changed: 18 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -5,25 +5,35 @@ Package backstage provides a client for the Backstage API.
55
66
Add the package to your project as following:
77
8-
import "github.com/tdabasinskas/go-backstage"
8+
```go
9+
import "github.com/datolabs-io/go-backstage/v3"
10+
```
911
1012
Once imported, create a new Backstage API client to access different parts of Backstage API:
1113
12-
client, err := backstage.NewClient(baseURL, "default", nil)
14+
```go
15+
client, err := backstage.NewClient(baseURL, "default", nil)
16+
```
1317
1418
If you want to use a custom HTTP client (for example, to handle authentication, retries or different timeouts), you can pass it as the
1519
third argument:
1620
17-
httpClient := &http.Client{}
18-
client, err := backstage.NewClient(baseURL, "default", httpClient)
21+
```go
22+
httpClient := &http.Client{}
23+
client, err := backstage.NewClient(baseURL, "default", httpClient)
24+
```
1925
2026
The client than can be used to access different parts of the API, e.g. get the list of entities, sorted in specific order:
2127
28+
```go
29+
2230
entities, response, err := c.Catalog.Entities.s.List(context.Background(), &ListEntityOptions{
23-
Filters: ListEntityFilter{},
24-
Fields: []string{},
25-
Order: []ListEntityOrder{{ Direction: OrderDescending, Field: "metadata.name" },
26-
},
31+
Filters: []string{},
32+
Fields: []string{},
33+
Order: []ListEntityOrder{{ Direction: OrderDescending, Field: "metadata.name" },
34+
},
2735
})
36+
37+
```
2838
*/
2939
package backstage

0 commit comments

Comments
 (0)