File tree Expand file tree Collapse file tree 3 files changed +8
-8
lines changed
Expand file tree Collapse file tree 3 files changed +8
-8
lines changed Original file line number Diff line number Diff line change 11# DataLoader
2- [ ![ GoDoc] ( https://godoc.org/github.com /nicksrandall/dataloader?status.svg )] ( https://godoc.org/github.com/nicksrandall/dataloader )
2+ [ ![ GoDoc] ( https://godoc.org/gopkg.in /nicksrandall/dataloader.v3 ?status.svg )] ( https://godoc.org/github.com/nicksrandall/dataloader )
33[ ![ Build Status] ( https://travis-ci.org/nicksrandall/dataloader.svg?branch=master )] ( https://travis-ci.org/nicksrandall/dataloader )
44[ ![ codecov] ( https://codecov.io/gh/nicksrandall/dataloader/branch/master/graph/badge.svg )] ( https://codecov.io/gh/nicksrandall/dataloader )
55
@@ -9,7 +9,7 @@ This is an implementation of [Facebook's DataLoader](https://github.com/facebook
99This project is a work in progress. Feedback is encouraged.
1010
1111## Install
12- ` go get -u gopkg.in/nicksrandall/dataloader.v2 `
12+ ` go get -u gopkg.in/nicksrandall/dataloader.v3 `
1313
1414## Usage
1515``` go
Original file line number Diff line number Diff line change @@ -16,7 +16,7 @@ type Cache struct {
1616}
1717
1818// Get gets an item from the cache
19- func (c * Cache ) Get (key string ) (dataloader.Thunk , bool ) {
19+ func (c * Cache ) Get (_ context. Context , key string ) (dataloader.Thunk , bool ) {
2020 v , ok := c .ARCCache .Get (key )
2121 if ok {
2222 return v .(dataloader.Thunk ), ok
@@ -25,12 +25,12 @@ func (c *Cache) Get(key string) (dataloader.Thunk, bool) {
2525}
2626
2727// Set sets an item in the cache
28- func (c * Cache ) Set (key string , value dataloader.Thunk ) {
28+ func (c * Cache ) Set (_ context. Context , key string , value dataloader.Thunk ) {
2929 c .ARCCache .Add (key , value )
3030}
3131
3232// Delete deletes an item in the cache
33- func (c * Cache ) Delete (key string ) bool {
33+ func (c * Cache ) Delete (_ context. Context , key string ) bool {
3434 if c .ARCCache .Contains (key ) {
3535 c .ARCCache .Remove (key )
3636 return true
Original file line number Diff line number Diff line change @@ -17,7 +17,7 @@ type Cache struct {
1717}
1818
1919// Get gets a value from the cache
20- func (c * Cache ) Get (key string ) (dataloader.Thunk , bool ) {
20+ func (c * Cache ) Get (_ context. Context , key string ) (dataloader.Thunk , bool ) {
2121 v , ok := c .c .Get (key )
2222 if ok {
2323 return v .(dataloader.Thunk ), ok
@@ -26,12 +26,12 @@ func (c *Cache) Get(key string) (dataloader.Thunk, bool) {
2626}
2727
2828// Set sets a value in the cache
29- func (c * Cache ) Set (key string , value dataloader.Thunk ) {
29+ func (c * Cache ) Set (_ context. Context , key string , value dataloader.Thunk ) {
3030 c .c .Set (key , value , 0 )
3131}
3232
3333// Delete deletes and item in the cache
34- func (c * Cache ) Delete (key string ) bool {
34+ func (c * Cache ) Delete (_ context. Context , key string ) bool {
3535 if _ , found := c .c .Get (key ); found {
3636 c .c .Delete (key )
3737 return true
You can’t perform that action at this time.
0 commit comments