Skip to content

Commit

Permalink
chore: update format code inside Readme
Browse files Browse the repository at this point in the history
  • Loading branch information
tranhoangvuit committed Oct 8, 2023
1 parent fce9db6 commit ab15174
Showing 1 changed file with 12 additions and 16 deletions.
28 changes: 12 additions & 16 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -25,9 +25,6 @@ import (

func main() {
storageClient := storage_go.NewClient("https://<project-reference-id>.supabase.co/storage/v1", "<project-secret-api-key>", nil)

// Another way
storage_go.NewClient("https://<project-reference-id>.supabase.co/storage/v1", "", )
}
```

Expand All @@ -39,8 +36,8 @@ func main() {

```go
result, err := storageClient.CreateBucket("bucket-id", storage_go.BucketOptions{
Public: true,
})
Public: true,
})
```

- Retrieve the details of an existing Storage bucket:
Expand All @@ -53,8 +50,8 @@ func main() {

```go
result, err := storageClient.UpdateBucket("bucket-id", storage_go.BucketOptions{
Public: true,
})
Public: true,
})
```

- Remove all objects inside a single bucket:
Expand Down Expand Up @@ -95,13 +92,13 @@ func main() {

```go
result, err := storageClient.ListFiles("bucket-id", "", storage_go.FileSearchOptions{
Limit: 10,
Offset: 0,
SortByOptions: storage_go.SortBy{
Column: "",
Order: "",
},
})
Limit: 10,
Offset: 0,
SortByOptions: storage_go.SortBy{
Column: "",
Order: "",
},
})
```

> Note: The `list` method also accepts a map of optional parameters.
Expand Down Expand Up @@ -132,7 +129,6 @@ func main() {
const expireIn = 60

result, err := storageClient.CreateSignedUrl("test", "test.mp4", expireIn)

```

- Retrieve URLs for assets in public buckets:
Expand All @@ -147,7 +143,7 @@ func main() {
fileBody := ... // load your file here

resp, err := storageClient.CreateSignedUploadUrl("test", "test.txt")
res, err := storageClient.UploadToSignedUrl(resp.Url, file)
res, err := storageClient.UploadToSignedUrl(resp.Url, file)
```

## License
Expand Down

0 comments on commit ab15174

Please sign in to comment.