diff --git a/README.md b/README.md index 15e33a4..2152907 100644 --- a/README.md +++ b/README.md @@ -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. \ No newline at end of file diff --git a/go.mod b/go.mod new file mode 100644 index 0000000..7ed9b9b --- /dev/null +++ b/go.mod @@ -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 diff --git a/go.sum b/go.sum new file mode 100644 index 0000000..b3a04ab --- /dev/null +++ b/go.sum @@ -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=