Skip to content

Commit

Permalink
update README
Browse files Browse the repository at this point in the history
  • Loading branch information
juliaqiuxy committed Jun 7, 2021
1 parent 4fa68aa commit 1c3a8e1
Showing 1 changed file with 7 additions and 3 deletions.
10 changes: 7 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,12 @@ $ go get github.com/juliaqiuxy/wfcache
### Usage

```go
import "github.com/juliaqiuxy/wfcache"
import (
"github.com/juliaqiuxy/wfcache"
basicAdapter "github.com/juliaqiuxy/wfcache/basic"
bigCacheAdapter "github.com/juliaqiuxy/wfcache/bigcache"
dynamodbAdapter "github.com/juliaqiuxy/wfcache/dynamodb"
)

c, err := wfcache.Create(
basicAdapter.Create(5 * time.Minute),
Expand All @@ -52,6 +57,7 @@ import (
"context"
"github.com/juliaqiuxy/wfcache"
"gopkg.in/DataDog/dd-trace-go.v1/ddtrace/tracer"
basicAdapter "github.com/juliaqiuxy/wfcache/basic"
)

func onStartStorageOp(ctx context.Context, opName string) interface{} {
Expand All @@ -67,8 +73,6 @@ wfcache.CreateWithHooks(
onStartStorageOp,
onFinishStorageOp,
basicAdapter.Create(5 * time.Minute),
bigCacheAdapter.Create(2 * time.Hour),
dynamodbAdapter.Create(dynamodbClient, "my-cache-table", 24 * time.Hour),
)
```

Expand Down

0 comments on commit 1c3a8e1

Please sign in to comment.