Skip to content

Commit

Permalink
Documenting new storages integration.
Browse files Browse the repository at this point in the history
  • Loading branch information
andream16 committed Dec 15, 2024
1 parent ef15f97 commit 8497c61
Show file tree
Hide file tree
Showing 3 changed files with 44 additions and 4 deletions.
30 changes: 26 additions & 4 deletions sdk/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -22,10 +22,11 @@ while taking care of the boring things for you:

You can customise a component using the following environment variables:

| Environment Variable | Type | Required | Default | Possible Values |
|-------------------------------------|--------|-----------|--------------------------|--------------------------|
| SMITHY\_COMPONENT\_NAME | string | yes | - | - |
| SMITHY\_LOG\_LEVEL | string | false | info, debug, warn, error |
| Environment Variable | Type | Required | Default | Possible Values |
|-------------------------------------|--------|----------|--------------------------|-------------------------------------|
| SMITHY\_COMPONENT\_NAME | string | yes | - | - |
| SMITHY\_LOG\_LEVEL | string | false | info, debug, warn, error |
| SMITHY\_STORE\_TYPE | string | no | sqlite | sqlite, postgresql, findings-client |

`Runners` can be supplied with `RunnerConfigOption`s to customise how a component runs.
In the following example you can see how we change the component name:
Expand Down Expand Up @@ -289,6 +290,27 @@ if err := component.RunReporter(
}
```

### Storages

Smithy SDK allows to configure different storages to boost adoption.

By default, [sqlite](https://www.sqlite.org/) is used for local development.

#### Postgresql

You can configure a Postgresql storage by plugging in `/store/remote/postgresql` or configuring the required
environment variables defined in its README.

#### Findings Client

You can configure a grpc findings client storage by plugging in `/store/remote/findings-client` or configuring the required
environment variables defined in its README.

#### Custom

You can supply your own implementation of a storage by satisfying the `componenent.Storer` interface and leveraging the
`RunnerWithStorer` option.

### Contributing

#### Database Schemas
Expand Down
9 changes: 9 additions & 0 deletions sdk/component/store/remote/findings-client/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
# Findings Client

This implementation of `component.Storer` interacts with a findings client via GRPC.

## Configuration

| Environment Variable | Type | Required | Default | Possible Values |
|-------------------------------------|--------|----------|--------------------------|--------------------------|
| SMITHY\_REMOTE\_STORE\_FINDINGS\_SERVICE\_ADDR | string | no | localhost:50051 | - |
9 changes: 9 additions & 0 deletions sdk/component/store/remote/postgresql/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
# Postgresql

This implementation of `component.Storer` interacts with postgresql.

## Configuration

| Environment Variable | Type | Required | Default | Possible Values |
|-------------------------------------|--------|----------|--------------------------|--------------------------|
| SMITHY\_REMOTE\_STORE\_POSTGRES\_DSN | string | yes | - | - |

0 comments on commit 8497c61

Please sign in to comment.