Skip to content

Commit

Permalink
Added module support and extended README
Browse files Browse the repository at this point in the history
  • Loading branch information
parimaldeshmukh committed May 4, 2019
1 parent ff0800b commit 3d71614
Show file tree
Hide file tree
Showing 3 changed files with 41 additions and 0 deletions.
32 changes: 32 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,38 @@ func main() {
}
```

### Cache Configuration
* `MaxCacheSize int` The maximum number of cached secrets to maintain before evicting secrets that have not been accessed recently.
* `CacheItemTTL int64` The number of nanoseconds that a cached item is considered valid before requiring a refresh of the secret state. Items that have exceeded this TTL will be refreshed synchronously when requesting the secret value. If the synchronous refresh failed, the stale secret will be returned.
* `VersionStage string` The version stage that will be used when requesting the secret values for this cache.
* `Hook CacheHook` Used to hook in-memory cache updates.

#### Instantiating Cache with a custom Config and a custom Client
```go

//Create a custom secretsmanager client
client := getCustomClient()

//Create a custom CacheConfig struct
config := secretcache.CacheConfig{
MaxCacheSize: secretcache.DefaultMaxCacheSize + 10,
VersionStage: secretcache.DefaultVersionStage,
CacheItemTTL: secretcache.DefaultCacheItemTTL,
}

//Instantiate the cache
cache, _ := secretcache.New(
func(c *secretcache.Cache) { c.CacheConfig = config },
func(c *secretcache.Cache) { c.Client = client },
)
```

### Getting Help
We use GitHub issues for tracking bugs and caching library feature requests and have limited bandwidth to address them. Please use these community resources for getting help:
* Ask a question on [Stack Overflow](https://stackoverflow.com/) and tag it with [aws-secrets-manager](https://stackoverflow.com/questions/tagged/aws-secrets-manager).
* Open a support ticket with [AWS Support](https://console.aws.amazon.com/support/home#/)
* if it turns out that you may have found a bug, please [open an issue](https://github.com/aws/aws-secretsmanager-caching-python/issues/new).

## License

This library is licensed under the Apache 2.0 License.
5 changes: 5 additions & 0 deletions go.mod
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
module github.com/aws/aws-secretsmanager-caching-go

go 1.12

require github.com/aws/aws-sdk-go v1.19.23
4 changes: 4 additions & 0 deletions go.sum
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
github.com/aws/aws-sdk-go v1.19.23 h1:euoy2X3HKkQUtsRXlC9ZuFruesVfKpsAl1brCTphClM=
github.com/aws/aws-sdk-go v1.19.23/go.mod h1:KmX6BPdI08NWTb3/sm4ZGu5ShLoqVDhKgpiN924inxo=
github.com/jmespath/go-jmespath v0.0.0-20180206201540-c2b33e8439af h1:pmfjZENx5imkbgOkpRUYLnmbU7UEFbjtDA2hxJ1ichM=
github.com/jmespath/go-jmespath v0.0.0-20180206201540-c2b33e8439af/go.mod h1:Nht3zPeWKUH0NzdCt2Blrr5ys8VGpn0CEB0cQHVjt7k=

0 comments on commit 3d71614

Please sign in to comment.