Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add env gaurav #7

Open
wants to merge 3 commits into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 8 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -55,6 +55,10 @@ Use go build to add the SDK to your project's Go module dependencies. The SDK r
go build ./...
```

```sh
export API_KEY="Apikey from Servcie Crednetials"
export RESOURCE_INSTANCE_ID="Resource Instance Id from Bucket Service Credentials"
```
## Example code

Create a file `main.go`, replacing your own values for API key, instance ID, and bucket name:
Expand All @@ -64,16 +68,18 @@ package main

import (
"fmt"
"os"

"github.com/IBM/ibm-cos-sdk-go/aws"
"github.com/IBM/ibm-cos-sdk-go/aws/credentials/ibmiam"
"github.com/IBM/ibm-cos-sdk-go/aws/session"
"github.com/IBM/ibm-cos-sdk-go/service/s3"
)


const (
apiKey = "<API_KEY>"
serviceInstanceID = "<RESOURCE_INSTANCE_ID>"
apiKey = os.Getenv("API_KEY")
serviceInstanceID = os.Getnev("RESOURCE_INSTANCE_ID")
authEndpoint = "https://iam.cloud.ibm.com/identity/token"
serviceEndpoint = "https://s3-api.us-geo.objectstorage.softlayer.net"
)
Expand Down