Skip to content

Commit

Permalink
updated readme
Browse files Browse the repository at this point in the history
  • Loading branch information
ekaputra07 committed Nov 10, 2024
1 parent 817ed6e commit b3a2209
Showing 1 changed file with 18 additions and 1 deletion.
19 changes: 18 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,6 @@ Above method works well if you're trying to connect to a single hosting provider
You can create multiple instances of Warren that points to different providers:
```golang
import (
"context"
"github.com/ekaputra07/warren-go"
"github.com/ekaputra07/warren-go/api"
)
Expand All @@ -69,4 +68,22 @@ apiB := api.New("https://api.b.com", "apiKeyFromB")
wb := warren.Init(apiB)

wb.Location.ListLocations(ctx)
```

### Create client for specific module
If you just want to create a client for specific module e.g. Object Storage, simply import and initialize your desired module.
```golang
import (
"github.com/ekaputra07/warren-go/api"
"github.com/ekaputra07/warren-go/objectstorage"
)

// using default API client
c := objectstorage.NewClient(api.Default)
c.ListBuckets(ctx)

// OR manually setting base URL and API key
a := api.New("https://api.idcloudhost.com", "secret")
c2 := objectstorage.NewClient(a)
c2.ListBuckets(ctx)
```

0 comments on commit b3a2209

Please sign in to comment.