Skip to content

Commit

Permalink
correct code snippets
Browse files Browse the repository at this point in the history
  • Loading branch information
tangowithfoxtrot committed Jun 27, 2024
1 parent 331c321 commit b256680
Showing 1 changed file with 11 additions and 11 deletions.
22 changes: 11 additions & 11 deletions languages/go/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ managing projects and secrets, as well as a client interface to facilitate opera

## Installation

Download the SDK files and place them in your Go project directory.
In your Go project: `go get github.com/bitwarden/sdk-go`

## Table of Contents

Expand Down Expand Up @@ -52,25 +52,25 @@ err := bitwardenClient.AccessTokenLogin(accessToken, &statePath)
#### Create a Project

```go
project, err := client.Projects().Create("organization_id", "project_name")
project, err := bitwardenClient.Projects().Create("organization_id", "project_name")
```

#### List Projects

```go
projects, err := client.Projects().List("organization_id")
projects, err := bitwardenClient.Projects().List("organization_id")
```

#### Update a Project

```go
project, err := client.Projects().Update("project_id", "organization_id", "new_project_name")
project, err := bitwardenClient.Projects().Update("project_id", "organization_id", "new_project_name")
```

#### Delete Projects

```go
project, err := client.Projects().Delete([]string{"project_id_1", "project_id_2"})
project, err := bitwardenClient.Projects().Delete([]string{"project_id_1", "project_id_2"})
```

---
Expand All @@ -80,34 +80,34 @@ project, err := client.Projects().Delete([]string{"project_id_1", "project_id_2"
#### Create a Secret

```go
secret, err := client.Secrets().Create("key", "value", "note", "organization_id", []string{"project_id"})
secret, err := bitwardenClient.Secrets().Create("key", "value", "note", "organization_id", []string{"project_id"})
```

#### List Secrets

```go
secrets, err := client.Secrets().List("organization_id")
secrets, err := bitwardenClient.Secrets().List("organization_id")
```

#### Update a Secret

```go
secret, err := client.Secrets().Update("secret_id", "new_key", "new_value", "new_note", "organization_id", []string{"project_id"})
secret, err := bitwardenClient.Secrets().Update("secret_id", "new_key", "new_value", "new_note", "organization_id", []string{"project_id"})
```

#### Delete Secrets

```go
secret, err := client.Secrets().Delete([]string{"secret_id_1", "secret_id_2"})
secret, err := bitwardenClient.Secrets().Delete([]string{"secret_id_1", "secret_id_2"})
```

#### Secrets Sync

```go
secretsSync, err := client.Secrets().Sync("organization_id", nil)
secretsSync, err := bitwardenClient.Secrets().Sync("organization_id", nil)

lastSyncedDate := time.Now()
secretsSync, err := client.Secrets().Sync("organization_id", lastSyncedDate)
secretsSync, err = bitwardenClient.Secrets().Sync("organization_id", lastSyncedDate)
```

---
Expand Down

0 comments on commit b256680

Please sign in to comment.