diff --git a/client/definitions.go b/client/definitions.go index 269a703ac9..c4c7f675fd 100644 --- a/client/definitions.go +++ b/client/definitions.go @@ -12,7 +12,6 @@ package client import ( "context" - "errors" "fmt" "strings" @@ -20,6 +19,7 @@ import ( "github.com/sourcenetwork/defradb/client/request" "github.com/sourcenetwork/defradb/datastore" + "github.com/sourcenetwork/defradb/errors" ) // CollectionDefinition contains the metadata defining what a Collection is. diff --git a/client/document.go b/client/document.go index b4ae927522..108f00b658 100644 --- a/client/document.go +++ b/client/document.go @@ -12,7 +12,6 @@ package client import ( "encoding/json" - "errors" "regexp" "strings" "sync" @@ -24,6 +23,7 @@ import ( "github.com/valyala/fastjson" "github.com/sourcenetwork/defradb/client/request" + "github.com/sourcenetwork/defradb/errors" ccid "github.com/sourcenetwork/defradb/internal/core/cid" ) diff --git a/datastore/prefix_query.go b/datastore/prefix_query.go index 13d055893c..dfc4bbc3e2 100644 --- a/datastore/prefix_query.go +++ b/datastore/prefix_query.go @@ -13,11 +13,12 @@ package datastore import ( "context" "encoding/json" - "errors" ds "github.com/ipfs/go-datastore" "github.com/ipfs/go-datastore/query" + + "github.com/sourcenetwork/defradb/errors" ) // DeserializePrefix deserializes all elements with the given prefix from the given storage. diff --git a/http/client_collection.go b/http/client_collection.go index 1a56ab50e1..d23a59a40c 100644 --- a/http/client_collection.go +++ b/http/client_collection.go @@ -14,7 +14,6 @@ import ( "bytes" "context" "encoding/json" - "errors" "net/http" "net/url" "strings" @@ -22,6 +21,8 @@ import ( "github.com/sourcenetwork/immutable" sse "github.com/vito/go-sse/sse" + "github.com/sourcenetwork/defradb/errors" + "github.com/sourcenetwork/defradb/client" "github.com/sourcenetwork/defradb/internal/encryption" ) diff --git a/internal/db/description/collection.go b/internal/db/description/collection.go index 1c8c4667ef..c27f63694a 100644 --- a/internal/db/description/collection.go +++ b/internal/db/description/collection.go @@ -13,7 +13,6 @@ package description import ( "context" "encoding/json" - "errors" "sort" ds "github.com/ipfs/go-datastore" @@ -21,6 +20,7 @@ import ( "github.com/sourcenetwork/defradb/client" "github.com/sourcenetwork/defradb/datastore" + "github.com/sourcenetwork/defradb/errors" "github.com/sourcenetwork/defradb/internal/keys" ) diff --git a/internal/db/fetcher/indexer_iterators.go b/internal/db/fetcher/indexer_iterators.go index 5e3671d3aa..8f266a693b 100644 --- a/internal/db/fetcher/indexer_iterators.go +++ b/internal/db/fetcher/indexer_iterators.go @@ -13,7 +13,6 @@ package fetcher import ( "cmp" "context" - "errors" "strings" "time" @@ -21,6 +20,7 @@ import ( "github.com/sourcenetwork/defradb/client" "github.com/sourcenetwork/defradb/datastore" + "github.com/sourcenetwork/defradb/errors" "github.com/sourcenetwork/defradb/internal/connor" "github.com/sourcenetwork/defradb/internal/keys" "github.com/sourcenetwork/defradb/internal/planner/mapper" diff --git a/internal/db/fetcher/multi.go b/internal/db/fetcher/multi.go index d896568954..c2c6b8d958 100644 --- a/internal/db/fetcher/multi.go +++ b/internal/db/fetcher/multi.go @@ -11,9 +11,9 @@ package fetcher import ( - "errors" - "github.com/sourcenetwork/immutable" + + "github.com/sourcenetwork/defradb/errors" ) // multiFetcher is a fetcher that orchastrates the fetching of documents via multiple child fetchers. diff --git a/internal/db/indexed_docs_test.go b/internal/db/indexed_docs_test.go index 3999436138..8f1c37a61e 100644 --- a/internal/db/indexed_docs_test.go +++ b/internal/db/indexed_docs_test.go @@ -13,7 +13,6 @@ package db import ( "context" "encoding/json" - "errors" "testing" ipfsDatastore "github.com/ipfs/go-datastore" @@ -28,6 +27,7 @@ import ( "github.com/sourcenetwork/defradb/client" "github.com/sourcenetwork/defradb/datastore" "github.com/sourcenetwork/defradb/datastore/mocks" + "github.com/sourcenetwork/defradb/errors" "github.com/sourcenetwork/defradb/internal/core" "github.com/sourcenetwork/defradb/internal/db/fetcher" fetcherMocks "github.com/sourcenetwork/defradb/internal/db/fetcher/mocks" diff --git a/internal/db/view.go b/internal/db/view.go index e9a4d0d31c..29550c8f24 100644 --- a/internal/db/view.go +++ b/internal/db/view.go @@ -12,7 +12,6 @@ package db import ( "context" - "errors" "fmt" ds "github.com/ipfs/go-datastore" @@ -23,6 +22,7 @@ import ( "github.com/sourcenetwork/defradb/acp/identity" "github.com/sourcenetwork/defradb/client" "github.com/sourcenetwork/defradb/client/request" + "github.com/sourcenetwork/defradb/errors" "github.com/sourcenetwork/defradb/internal/core" "github.com/sourcenetwork/defradb/internal/db/description" "github.com/sourcenetwork/defradb/internal/keys" diff --git a/internal/request/graphql/schema/manager.go b/internal/request/graphql/schema/manager.go index 1a3f923ddc..ec1c26e12f 100644 --- a/internal/request/graphql/schema/manager.go +++ b/internal/request/graphql/schema/manager.go @@ -11,9 +11,8 @@ package schema import ( - "errors" - "github.com/sourcenetwork/defradb/client" + "github.com/sourcenetwork/defradb/errors" gql "github.com/sourcenetwork/graphql-go" gqlp "github.com/sourcenetwork/graphql-go/language/parser" diff --git a/node/node.go b/node/node.go index aa47bfbc5c..5c5ebc0d49 100644 --- a/node/node.go +++ b/node/node.go @@ -12,7 +12,6 @@ package node import ( "context" - "errors" "fmt" gohttp "net/http" @@ -20,6 +19,7 @@ import ( "github.com/sourcenetwork/immutable" "github.com/sourcenetwork/defradb/client" + "github.com/sourcenetwork/defradb/errors" "github.com/sourcenetwork/defradb/http" "github.com/sourcenetwork/defradb/internal/db" "github.com/sourcenetwork/defradb/internal/kms"