Skip to content

Commit 5afa5c1

Browse files
committed
Adding support for godep
1 parent dd4c637 commit 5afa5c1

File tree

3 files changed

+30
-96
lines changed

3 files changed

+30
-96
lines changed

Godeps/Godeps.json

Lines changed: 21 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

Godeps/Readme

Lines changed: 5 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

README.md

Lines changed: 4 additions & 96 deletions
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,12 @@
11
# DataLoader
2-
[![GoDoc](https://godoc.org/gopkg.in/nicksrandall/dataloader.v3?status.svg)](https://godoc.org/github.com/nicksrandall/dataloader)
3-
[![Build Status](https://travis-ci.org/nicksrandall/dataloader.svg?branch=master)](https://travis-ci.org/nicksrandall/dataloader)
4-
[![codecov](https://codecov.io/gh/nicksrandall/dataloader/branch/master/graph/badge.svg)](https://codecov.io/gh/nicksrandall/dataloader)
2+
[![GoDoc](https://godoc.org/gopkg.in/graph-gophers/dataloader.v3?status.svg)](https://godoc.org/github.com/graph-gophers/dataloader)
3+
[![Build Status](https://travis-ci.org/graph-gophers/dataloader.svg?branch=master)](https://travis-ci.org/graph-gophers/dataloader)
4+
[![codecov](https://codecov.io/gh/graph-gophers/dataloader/branch/master/graph/badge.svg)](https://codecov.io/gh/graph-gophers/dataloader)
55

66
This is an implementation of [Facebook's DataLoader](https://github.com/facebook/dataloader) in Golang.
77

8-
## Status
9-
This project is a work in progress. Feedback is encouraged.
10-
118
## Install
12-
`go get -u gopkg.in/nicksrandall/dataloader.v5`
9+
`go get -u github.com/graph-gophers/dataloader`
1310

1411
## Usage
1512
```go
@@ -40,95 +37,6 @@ if err != nil {
4037
log.Printf("value: %#v", result)
4138
```
4239

43-
## Upgrade from v1 to v2
44-
The only difference between v1 and v2 is that we added use of [context](https://golang.org/pkg/context).
45-
46-
```diff
47-
- loader.Load(key string) Thunk
48-
+ loader.Load(ctx context.Context, key string) Thunk
49-
- loader.LoadMany(keys []string) ThunkMany
50-
+ loader.LoadMany(ctx context.Context, keys []string) ThunkMany
51-
```
52-
53-
```diff
54-
- type BatchFunc func([]string) []*Result
55-
+ type BatchFunc func(context.Context, []string) []*Result
56-
```
57-
58-
## Upgrade from v2 to v3
59-
```diff
60-
// dataloader.Interface as added context.Context to methods
61-
- loader.Prime(key string, value interface{}) Interface
62-
+ loader.Prime(ctx context.Context, key string, value interface{}) Interface
63-
- loader.Clear(key string) Interface
64-
+ loader.Clear(ctx context.Context, key string) Interface
65-
```
66-
67-
```diff
68-
// cache interface as added context.Context to methods
69-
type Cache interface {
70-
- Get(string) (Thunk, bool)
71-
+ Get(context.Context, string) (Thunk, bool)
72-
- Set(string, Thunk)
73-
+ Set(context.Context, string, Thunk)
74-
- Delete(string) bool
75-
+ Delete(context.Context, string) bool
76-
Clear()
77-
}
78-
```
79-
80-
## Upgrade from v3 to v4
81-
```diff
82-
// dataloader.Interface as now allows interace{} as key rather than string
83-
- loader.Load(context.Context, key string) Thunk
84-
+ loader.Load(ctx context.Context, key interface{}) Thunk
85-
- loader.LoadMany(context.Context, key []string) ThunkMany
86-
+ loader.LoadMany(ctx context.Context, keys []interface{}) ThunkMany
87-
- loader.Prime(context.Context, key string, value interface{}) Interface
88-
+ loader.Prime(ctx context.Context, key interface{}, value interface{}) Interface
89-
- loader.Clear(context.Context, key string) Interface
90-
+ loader.Clear(ctx context.Context, key interface{}) Interface
91-
```
92-
93-
```diff
94-
// cache interface now allows interface{} as key instead of string
95-
type Cache interface {
96-
- Get(context.Context, string) (Thunk, bool)
97-
+ Get(context.Context, interface{}) (Thunk, bool)
98-
- Set(context.Context, string, Thunk)
99-
+ Set(context.Context, interface{}, Thunk)
100-
- Delete(context.Context, string) bool
101-
+ Delete(context.Context, interface{}) bool
102-
Clear()
103-
}
104-
```
105-
106-
## Upgrade from v4 to v5
107-
```diff
108-
// dataloader.Interface as now allows interace{} as key rather than string
109-
- loader.Load(context.Context, key interface{}) Thunk
110-
+ loader.Load(ctx context.Context, key Key) Thunk
111-
- loader.LoadMany(context.Context, key []interface{}) ThunkMany
112-
+ loader.LoadMany(ctx context.Context, keys Keys) ThunkMany
113-
- loader.Prime(context.Context, key interface{}, value interface{}) Interface
114-
+ loader.Prime(ctx context.Context, key Key, value interface{}) Interface
115-
- loader.Clear(context.Context, key interface{}) Interface
116-
+ loader.Clear(ctx context.Context, key Key) Interface
117-
```
118-
119-
```diff
120-
// cache interface now allows interface{} as key instead of string
121-
type Cache interface {
122-
- Get(context.Context, interface{}) (Thunk, bool)
123-
+ Get(context.Context, Key) (Thunk, bool)
124-
- Set(context.Context, interface{}, Thunk)
125-
+ Set(context.Context, Key, Thunk)
126-
- Delete(context.Context, interface{}) bool
127-
+ Delete(context.Context, Key) bool
128-
Clear()
129-
}
130-
```
131-
13240
### Don't need/want to use context?
13341
You're welcome to install the v1 version of this library.
13442

0 commit comments

Comments
 (0)