Skip to content

Commit

Permalink
change replace to first class imports
Browse files Browse the repository at this point in the history
  • Loading branch information
fredcarle committed Nov 13, 2023
1 parent 25b0d04 commit a901e85
Show file tree
Hide file tree
Showing 30 changed files with 50 additions and 58 deletions.
2 changes: 1 addition & 1 deletion cli/start.go
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ import (
"strings"
"syscall"

badger "github.com/dgraph-io/badger/v4"
badger "github.com/sourcenetwork/badger/v4"
"github.com/spf13/cobra"

"github.com/sourcenetwork/defradb/client"
Expand Down
2 changes: 1 addition & 1 deletion core/parser.go
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ package core
import (
"context"

"github.com/graphql-go/graphql/language/ast"
"github.com/sourcenetwork/graphql-go/language/ast"
"github.com/sourcenetwork/immutable"

"github.com/sourcenetwork/defradb/client"
Expand Down
2 changes: 1 addition & 1 deletion datastore/badger/v4/datastore.go
Original file line number Diff line number Diff line change
Expand Up @@ -11,11 +11,11 @@ import (
"sync"
"time"

badger "github.com/dgraph-io/badger/v4"
ds "github.com/ipfs/go-datastore"
dsq "github.com/ipfs/go-datastore/query"
logger "github.com/ipfs/go-log/v2"
goprocess "github.com/jbenet/goprocess"
badger "github.com/sourcenetwork/badger/v4"
"go.uber.org/zap"

"github.com/sourcenetwork/defradb/datastore/iterable"
Expand Down
2 changes: 1 addition & 1 deletion datastore/badger/v4/datastore_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -15,9 +15,9 @@ import (
"testing"
"time"

"github.com/dgraph-io/badger/v4"
ds "github.com/ipfs/go-datastore"
dsq "github.com/ipfs/go-datastore/query"
"github.com/sourcenetwork/badger/v4"
"github.com/stretchr/testify/assert"
"github.com/stretchr/testify/require"
)
Expand Down
2 changes: 1 addition & 1 deletion datastore/badger/v4/iterator.go
Original file line number Diff line number Diff line change
Expand Up @@ -17,10 +17,10 @@ import (
"context"
"sync"

badger "github.com/dgraph-io/badger/v4"
ds "github.com/ipfs/go-datastore"
dsq "github.com/ipfs/go-datastore/query"
goprocess "github.com/jbenet/goprocess"
badger "github.com/sourcenetwork/badger/v4"

"github.com/sourcenetwork/defradb/datastore/iterable"
)
Expand Down
2 changes: 1 addition & 1 deletion datastore/concurrent_txt_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -14,8 +14,8 @@ import (
"context"
"testing"

badger "github.com/dgraph-io/badger/v4"
ds "github.com/ipfs/go-datastore"
badger "github.com/sourcenetwork/badger/v4"
"github.com/stretchr/testify/require"

badgerds "github.com/sourcenetwork/defradb/datastore/badger/v4"
Expand Down
2 changes: 1 addition & 1 deletion datastore/txn_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -14,8 +14,8 @@ import (
"context"
"testing"

badger "github.com/dgraph-io/badger/v4"
ds "github.com/ipfs/go-datastore"
badger "github.com/sourcenetwork/badger/v4"
"github.com/stretchr/testify/require"

badgerds "github.com/sourcenetwork/defradb/datastore/badger/v4"
Expand Down
2 changes: 1 addition & 1 deletion datastore/wrappedstore_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -14,9 +14,9 @@ import (
"context"
"testing"

badger "github.com/dgraph-io/badger/v4"
ds "github.com/ipfs/go-datastore"
"github.com/ipfs/go-datastore/query"
badger "github.com/sourcenetwork/badger/v4"
"github.com/stretchr/testify/require"

badgerds "github.com/sourcenetwork/defradb/datastore/badger/v4"
Expand Down
2 changes: 1 addition & 1 deletion db/db_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ import (
"context"
"testing"

badger "github.com/dgraph-io/badger/v4"
badger "github.com/sourcenetwork/badger/v4"

badgerds "github.com/sourcenetwork/defradb/datastore/badger/v4"
)
Expand Down
11 changes: 2 additions & 9 deletions go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -5,15 +5,13 @@ go 1.20
require (
github.com/bits-and-blooms/bitset v1.11.0
github.com/bxcodec/faker v2.0.1+incompatible
github.com/dgraph-io/badger/v4 v4.1.0
github.com/evanphx/json-patch/v5 v5.7.0
github.com/fxamacker/cbor/v2 v2.5.0
github.com/getkin/kin-openapi v0.120.0
github.com/go-chi/chi/v5 v5.0.10
github.com/go-chi/cors v1.2.1
github.com/go-errors/errors v1.5.1
github.com/gofrs/uuid/v5 v5.0.0
github.com/graphql-go/graphql v0.8.1
github.com/iancoleman/strcase v0.3.0
github.com/ipfs/boxo v0.15.0
github.com/ipfs/go-block-format v0.2.0
Expand All @@ -33,7 +31,9 @@ require (
github.com/multiformats/go-multiaddr v0.12.0
github.com/multiformats/go-multibase v0.2.0
github.com/multiformats/go-multihash v0.2.3
github.com/sourcenetwork/badger/v4 v4.2.1-0.20231113215945-a63444ca5276
github.com/sourcenetwork/go-libp2p-pubsub-rpc v0.0.13
github.com/sourcenetwork/graphql-go v0.7.10-0.20231113214537-a9560c1898dd
github.com/sourcenetwork/immutable v0.3.0
github.com/spf13/cobra v1.8.0
github.com/spf13/pflag v1.0.5
Expand Down Expand Up @@ -82,7 +82,6 @@ require (
github.com/golang/glog v1.1.2 // indirect
github.com/golang/groupcache v0.0.0-20210331224755-41bb18bfe9da // indirect
github.com/golang/protobuf v1.5.3 // indirect
github.com/golang/snappy v0.0.4 // indirect
github.com/google/flatbuffers v2.0.6+incompatible // indirect
github.com/google/gopacket v1.1.19 // indirect
github.com/google/pprof v0.0.0-20231023181126-ff6d637d2a7b // indirect
Expand Down Expand Up @@ -192,9 +191,3 @@ require (
gopkg.in/yaml.v3 v3.0.1 // indirect
lukechampine.com/blake3 v1.2.1 // indirect
)

// SourceNetwork fork og graphql-go
replace (
github.com/dgraph-io/badger/v4 => github.com/sourcenetwork/badger/v4 v4.0.0-20230801145501-d3a57bd4c2ec
github.com/graphql-go/graphql => github.com/sourcenetwork/graphql-go v0.7.10-0.20230511091704-fe7085512c23
)
9 changes: 4 additions & 5 deletions go.sum
Original file line number Diff line number Diff line change
Expand Up @@ -209,7 +209,6 @@ github.com/golang/protobuf v1.5.0/go.mod h1:FsONVRAS9T7sI+LIUmWTfcYkHO4aIWwzhcaS
github.com/golang/protobuf v1.5.3 h1:KhyjKVUg7Usr/dYsdSqoFveMYd5ko72D+zANwlG1mmg=
github.com/golang/protobuf v1.5.3/go.mod h1:XVQd3VNwM+JqD3oG2Ue2ip4fOMUkwXdXDdiuN0vRsmY=
github.com/golang/snappy v0.0.4 h1:yAGX7huGHXlcLOEtBnF4w7FQwA26wojNCwOYAEhLjQM=
github.com/golang/snappy v0.0.4/go.mod h1:/XxbfmMg8lxefKM7IXC3fBNl/7bRcc72aCRzEWrmP2Q=
github.com/google/btree v0.0.0-20180813153112-4030bb1f1f0c/go.mod h1:lNA+9X1NB3Zf8V7Ke586lFgjr2dZNuvo3lPJSGZ5JPQ=
github.com/google/btree v1.0.0/go.mod h1:lNA+9X1NB3Zf8V7Ke586lFgjr2dZNuvo3lPJSGZ5JPQ=
github.com/google/flatbuffers v2.0.6+incompatible h1:XHFReMv7nFFusa+CEokzWbzaYocKXI6C7hdU5Kgh9Lw=
Expand Down Expand Up @@ -562,12 +561,12 @@ github.com/sourcegraph/annotate v0.0.0-20160123013949-f4cad6c6324d/go.mod h1:Udh
github.com/sourcegraph/conc v0.3.0 h1:OQTbbt6P72L20UqAkXXuLOj79LfEanQ+YQFNpLA9ySo=
github.com/sourcegraph/conc v0.3.0/go.mod h1:Sdozi7LEKbFPqYX2/J+iBAM6HpqSLTASQIKqDmF7Mt0=
github.com/sourcegraph/syntaxhighlight v0.0.0-20170531221838-bd320f5d308e/go.mod h1:HuIsMU8RRBOtsCgI77wP899iHVBQpCmg4ErYMZB+2IA=
github.com/sourcenetwork/badger/v4 v4.0.0-20230801145501-d3a57bd4c2ec h1:br39/Te7XrQmirI+QtT6YblhD9T6B2dzDNI9eoI26Pg=
github.com/sourcenetwork/badger/v4 v4.0.0-20230801145501-d3a57bd4c2ec/go.mod h1:qfCqhPoWDFJRx1gp5QwwyGo8xk1lbHUxvK9nK0OGAak=
github.com/sourcenetwork/badger/v4 v4.2.1-0.20231113215945-a63444ca5276 h1:TpQDDPfucDgCNH0NVqVUk6SSq6T6G8p9HIocmwZh9Tg=
github.com/sourcenetwork/badger/v4 v4.2.1-0.20231113215945-a63444ca5276/go.mod h1:lxiZTDBw0vheFMqSwX2OvB6RTDI1+/UtVCSU4rpThFM=
github.com/sourcenetwork/go-libp2p-pubsub-rpc v0.0.13 h1:d/PeGZutd5NcDr6ltAv8ubN5PxsHMp1YUnhHY/QCWB4=
github.com/sourcenetwork/go-libp2p-pubsub-rpc v0.0.13/go.mod h1:jUoQv592uUX1u7QBjAY4C+l24X9ArhPfifOqXpDHz4U=
github.com/sourcenetwork/graphql-go v0.7.10-0.20230511091704-fe7085512c23 h1:QcSWSYlE1alUC0uOO/trppYMLpR8OuFIL8IqR+PR5sA=
github.com/sourcenetwork/graphql-go v0.7.10-0.20230511091704-fe7085512c23/go.mod h1:3Ty9EMes+aoxl8xS0CsuCGQZ4JEsOlC5yqQDLOKoBRw=
github.com/sourcenetwork/graphql-go v0.7.10-0.20231113214537-a9560c1898dd h1:lmpW39/8wPJ0khWRhOcj7Bj0HYKbSmQ8rXMJw1cMB8U=
github.com/sourcenetwork/graphql-go v0.7.10-0.20231113214537-a9560c1898dd/go.mod h1:rkahXkgRH/3vZErN1Bx+qt1+w+CV5fgaJyKKWgISe4U=
github.com/sourcenetwork/immutable v0.3.0 h1:gHPtGvLrTBTK5YpDAhMU+u+S8v1F6iYmc3nbZLryMdc=
github.com/sourcenetwork/immutable v0.3.0/go.mod h1:GD7ceuh/HD7z6cdIwzKK2ctzgZ1qqYFJpsFp+8qYnbI=
github.com/spaolacci/murmur3 v1.1.0 h1:7c1g84S4BPRrfL5Xrdp6fOJ206sU9y293DDHaoy0bLI=
Expand Down
2 changes: 1 addition & 1 deletion net/node_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -15,10 +15,10 @@ import (
"testing"
"time"

badger "github.com/dgraph-io/badger/v4"
"github.com/libp2p/go-libp2p/core/event"
"github.com/libp2p/go-libp2p/core/peer"
ma "github.com/multiformats/go-multiaddr"
badger "github.com/sourcenetwork/badger/v4"
"github.com/stretchr/testify/require"

"github.com/sourcenetwork/defradb/client"
Expand Down
4 changes: 2 additions & 2 deletions planner/doc.go
Original file line number Diff line number Diff line change
Expand Up @@ -34,8 +34,8 @@ The plan is executed as defined above, result by result, by iteratively calling
return True or False, depending on if it successfully produced a record, which can be accessed via the Values() method.
The plan starts with a base ast.Document, which represents the entire provided request string, parsed into an
appropriate AST Document. The AST Document is generated by the https://github.com/graphql-go/graphql package. It is
then further parsed using a native DefraDB GraphQL Parser
appropriate AST Document. The AST Document is generated by the https://github.com/sourcenetwork/graphql-go package. It
is then further parsed using a native DefraDB GraphQL Parser
(https://github.com/sourcenetwork/defradb/request/graphql/parser), which converts the complex AST Document, into a
manageable structure, with all the relevant request information readily available.
Expand Down
8 changes: 4 additions & 4 deletions request/graphql/parser.go
Original file line number Diff line number Diff line change
Expand Up @@ -13,10 +13,10 @@ package graphql
import (
"context"

gql "github.com/graphql-go/graphql"
"github.com/graphql-go/graphql/language/ast"
gqlp "github.com/graphql-go/graphql/language/parser"
"github.com/graphql-go/graphql/language/source"
gql "github.com/sourcenetwork/graphql-go"
"github.com/sourcenetwork/graphql-go/language/ast"
gqlp "github.com/sourcenetwork/graphql-go/language/parser"
"github.com/sourcenetwork/graphql-go/language/source"
"github.com/sourcenetwork/immutable"

"github.com/sourcenetwork/defradb/client"
Expand Down
4 changes: 2 additions & 2 deletions request/graphql/parser/commit.go
Original file line number Diff line number Diff line change
Expand Up @@ -13,8 +13,8 @@ package parser
import (
"strconv"

gql "github.com/graphql-go/graphql"
"github.com/graphql-go/graphql/language/ast"
gql "github.com/sourcenetwork/graphql-go"
"github.com/sourcenetwork/graphql-go/language/ast"
"github.com/sourcenetwork/immutable"

"github.com/sourcenetwork/defradb/client/request"
Expand Down
8 changes: 4 additions & 4 deletions request/graphql/parser/filter.go
Original file line number Diff line number Diff line change
Expand Up @@ -14,10 +14,10 @@ import (
"strconv"
"strings"

gql "github.com/graphql-go/graphql"
"github.com/graphql-go/graphql/language/ast"
gqlp "github.com/graphql-go/graphql/language/parser"
gqls "github.com/graphql-go/graphql/language/source"
gql "github.com/sourcenetwork/graphql-go"
"github.com/sourcenetwork/graphql-go/language/ast"
gqlp "github.com/sourcenetwork/graphql-go/language/parser"
gqls "github.com/sourcenetwork/graphql-go/language/source"
"github.com/sourcenetwork/immutable"

"github.com/sourcenetwork/defradb/client"
Expand Down
4 changes: 2 additions & 2 deletions request/graphql/parser/introspection.go
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,8 @@
package parser

import (
gql "github.com/graphql-go/graphql"
"github.com/graphql-go/graphql/language/ast"
gql "github.com/sourcenetwork/graphql-go"
"github.com/sourcenetwork/graphql-go/language/ast"
)

// IsIntrospectionQuery parses a root ast.Document and determines if it is an
Expand Down
4 changes: 2 additions & 2 deletions request/graphql/parser/mutation.go
Original file line number Diff line number Diff line change
Expand Up @@ -13,8 +13,8 @@ package parser
import (
"strings"

gql "github.com/graphql-go/graphql"
"github.com/graphql-go/graphql/language/ast"
gql "github.com/sourcenetwork/graphql-go"
"github.com/sourcenetwork/graphql-go/language/ast"
"github.com/sourcenetwork/immutable"

"github.com/sourcenetwork/defradb/client"
Expand Down
4 changes: 2 additions & 2 deletions request/graphql/parser/query.go
Original file line number Diff line number Diff line change
Expand Up @@ -13,8 +13,8 @@ package parser
import (
"strconv"

gql "github.com/graphql-go/graphql"
"github.com/graphql-go/graphql/language/ast"
gql "github.com/sourcenetwork/graphql-go"
"github.com/sourcenetwork/graphql-go/language/ast"
"github.com/sourcenetwork/immutable"

"github.com/sourcenetwork/defradb/client"
Expand Down
4 changes: 2 additions & 2 deletions request/graphql/parser/request.go
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,8 @@
package parser

import (
gql "github.com/graphql-go/graphql"
"github.com/graphql-go/graphql/language/ast"
gql "github.com/sourcenetwork/graphql-go"
"github.com/sourcenetwork/graphql-go/language/ast"
"github.com/sourcenetwork/immutable"

"github.com/sourcenetwork/defradb/client"
Expand Down
4 changes: 2 additions & 2 deletions request/graphql/parser/subscription.go
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,8 @@
package parser

import (
gql "github.com/graphql-go/graphql"
"github.com/graphql-go/graphql/language/ast"
gql "github.com/sourcenetwork/graphql-go"
"github.com/sourcenetwork/graphql-go/language/ast"

"github.com/sourcenetwork/defradb/client/request"
)
Expand Down
6 changes: 3 additions & 3 deletions request/graphql/schema/collection.go
Original file line number Diff line number Diff line change
Expand Up @@ -19,9 +19,9 @@ import (
"github.com/sourcenetwork/defradb/client/request"
"github.com/sourcenetwork/defradb/request/graphql/schema/types"

"github.com/graphql-go/graphql/language/ast"
gqlp "github.com/graphql-go/graphql/language/parser"
"github.com/graphql-go/graphql/language/source"
"github.com/sourcenetwork/graphql-go/language/ast"
gqlp "github.com/sourcenetwork/graphql-go/language/parser"
"github.com/sourcenetwork/graphql-go/language/source"
)

// FromString parses a GQL SDL string into a set of collection descriptions.
Expand Down
2 changes: 1 addition & 1 deletion request/graphql/schema/descriptions.go
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
package schema

import (
gql "github.com/graphql-go/graphql"
gql "github.com/sourcenetwork/graphql-go"

"github.com/sourcenetwork/defradb/client"
)
Expand Down
2 changes: 1 addition & 1 deletion request/graphql/schema/generate.go
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ import (
"context"
"fmt"

gql "github.com/graphql-go/graphql"
gql "github.com/sourcenetwork/graphql-go"

"github.com/sourcenetwork/defradb/client"

Expand Down
4 changes: 2 additions & 2 deletions request/graphql/schema/manager.go
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
package schema

import (
gql "github.com/graphql-go/graphql"
gql "github.com/sourcenetwork/graphql-go"

schemaTypes "github.com/sourcenetwork/defradb/request/graphql/schema/types"
)
Expand Down Expand Up @@ -53,7 +53,7 @@ func (s *SchemaManager) Schema() *gql.Schema {
func (s *SchemaManager) ResolveTypes() error {
// basically, this function just refreshes the
// schema.TypeMap, and runs the internal
// typeMapReducer (https://github.com/graphql-go/graphql/blob/v0.7.9/schema.go#L275)
// typeMapReducer (https://github.com/sourcenetwork/graphql-go/blob/v0.7.9/schema.go#L275)
// which ensures all the necessary types are defined in the
// typeMap, and if there are any outstanding Thunks/closures
// resolve them.
Expand Down
2 changes: 1 addition & 1 deletion request/graphql/schema/types/base.go
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
package types

import (
gql "github.com/graphql-go/graphql"
gql "github.com/sourcenetwork/graphql-go"
)

// BooleanOperatorBlock filter block for boolean types.
Expand Down
2 changes: 1 addition & 1 deletion request/graphql/schema/types/commits.go
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
package types

import (
gql "github.com/graphql-go/graphql"
gql "github.com/sourcenetwork/graphql-go"

"github.com/sourcenetwork/defradb/client/request"
)
Expand Down
2 changes: 1 addition & 1 deletion request/graphql/schema/types/types.go
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
package types

import (
gql "github.com/graphql-go/graphql"
gql "github.com/sourcenetwork/graphql-go"
)

const (
Expand Down
2 changes: 1 addition & 1 deletion tests/bench/bench_util.go
Original file line number Diff line number Diff line change
Expand Up @@ -18,8 +18,8 @@ import (
"sync"
"testing"

"github.com/dgraph-io/badger/v4"
ds "github.com/ipfs/go-datastore"
"github.com/sourcenetwork/badger/v4"

"github.com/sourcenetwork/defradb/client"
"github.com/sourcenetwork/defradb/errors"
Expand Down
2 changes: 1 addition & 1 deletion tests/integration/db.go
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ import (
"strconv"
"testing"

badger "github.com/dgraph-io/badger/v4"
badger "github.com/sourcenetwork/badger/v4"

"github.com/sourcenetwork/defradb/client"
badgerds "github.com/sourcenetwork/defradb/datastore/badger/v4"
Expand Down

0 comments on commit a901e85

Please sign in to comment.