Skip to content

Commit

Permalink
docs(api): update README's and code comments
Browse files Browse the repository at this point in the history
Signed-off-by: Salim Afiune Maya <[email protected]>
  • Loading branch information
afiune committed Mar 25, 2020
1 parent e26a3cd commit 9d3e739
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 5 deletions.
9 changes: 7 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,12 @@ A Golang API client for interacting with the [Lacework API](https://support.lace

### Basic Usage
```go
import "github.com/lacework/go-sdk/api"
import (
"fmt"
"log"

"github.com/lacework/go-sdk/api"
)

lacework, err := api.NewClient("account")
if err == nil {
Expand All @@ -22,7 +27,7 @@ if err != nil {
}

// Output: YOUR-ACCESS-TOKEN
fmt.Printf("%s\n", tokenRes.Token())
fmt.Println(tokenRes.Token())
```
Look at the [api/](api/) folder for more documentation.

Expand Down
4 changes: 2 additions & 2 deletions api/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ if err != nil {
log.Fatal(err)
}

integrations, err := lacework.GetIntegrations()
integrations, err := lacework.Integrations.List()
if err != nil {
log.Fatal(err)
}
Expand All @@ -40,5 +40,5 @@ if err != nil {
// CUSTOMER_123456B DATADOG
// CUSTOMER_123456A CONT_VULN_CFG
// CUSTOMER_123456C PAGER_DUTY_API
fmt.Println(integrations.List())
fmt.Println(integrations.String())
```
2 changes: 1 addition & 1 deletion api/http.go
Original file line number Diff line number Diff line change
Expand Up @@ -106,7 +106,7 @@ func (c *Client) DoDecoder(req *http.Request, v interface{}) (*http.Response, er
return res, err
}

// requestDecoder performs an http request on an endpoint, and
// RequestDecoder performs an http request on an endpoint, and
// decodes the response into the provided interface, all at once
func (c *Client) RequestDecoder(method, path string, body io.Reader, v interface{}) error {
request, err := c.NewRequest(method, path, body)
Expand Down

0 comments on commit 9d3e739

Please sign in to comment.