Skip to content

Commit

Permalink
chore: update module name to v5
Browse files Browse the repository at this point in the history
  • Loading branch information
caiorcferreira committed Feb 24, 2021
1 parent e2cb2b8 commit 385757e
Show file tree
Hide file tree
Showing 78 changed files with 170 additions and 171 deletions.
4 changes: 2 additions & 2 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ peg:
pigeon ./internal/parser/ast/grammar.peg > ./internal/parser/ast/grammar.go

dev:
RESTQL_PORT=9000 RESTQL_HEALTH_PORT=9001 RESTQL_PPROF_PORT=9002 go run -race -ldflags="-X github.com/b2wdigital/restQL-golang/v4/cmd.build=$(RESTQL_BUILD)" main.go
RESTQL_PORT=9000 RESTQL_HEALTH_PORT=9001 RESTQL_PPROF_PORT=9002 go run -race -ldflags="-X github.com/b2wdigital/restQL-golang/v5/cmd.build=$(RESTQL_BUILD)" main.go

unit:
go test -race -count=1 ./internal/...
Expand All @@ -23,7 +23,7 @@ e2e-run:
go test -race -count=1 ./test/e2e/...

build:
CGO_ENABLED=0 GOOS=linux GOARCH=amd64 go build -o bin/restQL -ldflags="-s -w -X github.com/b2wdigital/restQL-golang/v4/cmd.build=$(RESTQL_BUILD) -extldflags -static" -tags netgo main.go
CGO_ENABLED=0 GOOS=linux GOARCH=amd64 go build -o bin/restQL -ldflags="-s -w -X github.com/b2wdigital/restQL-golang/v5/cmd.build=$(RESTQL_BUILD) -extldflags -static" -tags netgo main.go

# Modules support
deps-reset:
Expand Down
8 changes: 4 additions & 4 deletions cmd/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -3,10 +3,10 @@ package cmd
import (
"context"
"fmt"
"github.com/b2wdigital/restQL-golang/v4/internal/platform/conf"
"github.com/b2wdigital/restQL-golang/v4/internal/platform/logger"
"github.com/b2wdigital/restQL-golang/v4/internal/platform/web"
"github.com/b2wdigital/restQL-golang/v4/pkg/restql"
"github.com/b2wdigital/restQL-golang/v5/internal/platform/conf"
"github.com/b2wdigital/restQL-golang/v5/internal/platform/logger"
"github.com/b2wdigital/restQL-golang/v5/internal/platform/web"
"github.com/b2wdigital/restQL-golang/v5/pkg/restql"
"github.com/pkg/errors"
"github.com/valyala/fasthttp"
_ "go.uber.org/automaxprocs"
Expand Down
2 changes: 1 addition & 1 deletion docs/restql/plugins.md
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ For example, if you are developing a Lifecycle plugin, the recommended entrypoin
```go
package main

import "github.com/b2wdigital/restQL-golang/v4/pkg/restql"
import "github.com/b2wdigital/restQL-golang/v5/pkg/restql"

func init() {
restql.RegisterPlugin(restql.PluginInfo{
Expand Down
2 changes: 1 addition & 1 deletion go.mod
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
module github.com/b2wdigital/restQL-golang/v4
module github.com/b2wdigital/restQL-golang/v5

go 1.15

Expand Down
2 changes: 1 addition & 1 deletion internal/domain/ports.go
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ package domain

import (
"context"
"github.com/b2wdigital/restQL-golang/v4/pkg/restql"
"github.com/b2wdigital/restQL-golang/v5/pkg/restql"
"github.com/pkg/errors"
)

Expand Down
3 changes: 1 addition & 2 deletions internal/domain/resource.go
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
package domain

import "github.com/b2wdigital/restQL-golang/v4/pkg/restql"
import "github.com/b2wdigital/restQL-golang/v5/pkg/restql"

// ResourceID is an unique identifier used by a statement.
// If an alias is present, it is used. Otherwise, the resource
Expand Down Expand Up @@ -54,4 +54,3 @@ type Details struct {
CacheControl restql.ResourceCacheControl
Debug *Debugging
}

4 changes: 2 additions & 2 deletions internal/eval/aggregators.go
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,8 @@ package eval

import (
"fmt"
"github.com/b2wdigital/restQL-golang/v4/internal/domain"
"github.com/b2wdigital/restQL-golang/v4/pkg/restql"
"github.com/b2wdigital/restQL-golang/v5/internal/domain"
"github.com/b2wdigital/restQL-golang/v5/pkg/restql"
"github.com/imdario/mergo"
"github.com/pkg/errors"
)
Expand Down
8 changes: 4 additions & 4 deletions internal/eval/aggregators_test.go
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
package eval_test

import (
"github.com/b2wdigital/restQL-golang/v4/pkg/restql"
"github.com/b2wdigital/restQL-golang/v5/pkg/restql"
"testing"

"github.com/b2wdigital/restQL-golang/v4/internal/domain"
"github.com/b2wdigital/restQL-golang/v4/internal/eval"
"github.com/b2wdigital/restQL-golang/v4/test"
"github.com/b2wdigital/restQL-golang/v5/internal/domain"
"github.com/b2wdigital/restQL-golang/v5/internal/eval"
"github.com/b2wdigital/restQL-golang/v5/test"
)

func TestApplyAggregators(t *testing.T) {
Expand Down
2 changes: 1 addition & 1 deletion internal/eval/eval.go
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ package eval
import (
"context"
"errors"
"github.com/b2wdigital/restQL-golang/v4/pkg/restql"
"github.com/b2wdigital/restQL-golang/v5/pkg/restql"
)

// MappingsReader is an interface implemented by types that
Expand Down
10 changes: 5 additions & 5 deletions internal/eval/evaluator.go
Original file line number Diff line number Diff line change
Expand Up @@ -4,11 +4,11 @@ import (
"context"
"fmt"

"github.com/b2wdigital/restQL-golang/v4/internal/domain"
"github.com/b2wdigital/restQL-golang/v4/internal/parser"
"github.com/b2wdigital/restQL-golang/v4/internal/platform/plugins"
"github.com/b2wdigital/restQL-golang/v4/internal/runner"
"github.com/b2wdigital/restQL-golang/v4/pkg/restql"
"github.com/b2wdigital/restQL-golang/v5/internal/domain"
"github.com/b2wdigital/restQL-golang/v5/internal/parser"
"github.com/b2wdigital/restQL-golang/v5/internal/platform/plugins"
"github.com/b2wdigital/restQL-golang/v5/internal/runner"
"github.com/b2wdigital/restQL-golang/v5/pkg/restql"
"github.com/pkg/errors"
)

Expand Down
4 changes: 2 additions & 2 deletions internal/eval/filters.go
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,8 @@ import (
"fmt"
"regexp"

"github.com/b2wdigital/restQL-golang/v4/internal/domain"
"github.com/b2wdigital/restQL-golang/v4/pkg/restql"
"github.com/b2wdigital/restQL-golang/v5/internal/domain"
"github.com/b2wdigital/restQL-golang/v5/pkg/restql"
"github.com/pkg/errors"
)

Expand Down
8 changes: 4 additions & 4 deletions internal/eval/filters_test.go
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@
package eval_test

import (
"github.com/b2wdigital/restQL-golang/v4/pkg/restql"
"github.com/b2wdigital/restQL-golang/v5/pkg/restql"
"regexp"
"testing"

"github.com/b2wdigital/restQL-golang/v4/internal/domain"
"github.com/b2wdigital/restQL-golang/v4/internal/eval"
"github.com/b2wdigital/restQL-golang/v4/test"
"github.com/b2wdigital/restQL-golang/v5/internal/domain"
"github.com/b2wdigital/restQL-golang/v5/internal/eval"
"github.com/b2wdigital/restQL-golang/v5/test"
)

func TestHiddenFilter(t *testing.T) {
Expand Down
4 changes: 2 additions & 2 deletions internal/eval/variables.go
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,10 @@ package eval

import (
"encoding/json"
"github.com/b2wdigital/restQL-golang/v4/pkg/restql"
"github.com/b2wdigital/restQL-golang/v5/pkg/restql"
"strconv"

"github.com/b2wdigital/restQL-golang/v4/internal/domain"
"github.com/b2wdigital/restQL-golang/v5/internal/domain"
)

// ResolveVariables returns a restQL query with all variables
Expand Down
8 changes: 4 additions & 4 deletions internal/eval/variables_test.go
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
package eval_test

import (
"github.com/b2wdigital/restQL-golang/v4/internal/eval"
"github.com/b2wdigital/restQL-golang/v4/pkg/restql"
"github.com/b2wdigital/restQL-golang/v5/internal/eval"
"github.com/b2wdigital/restQL-golang/v5/pkg/restql"
"testing"

"github.com/b2wdigital/restQL-golang/v4/internal/domain"
"github.com/b2wdigital/restQL-golang/v4/test"
"github.com/b2wdigital/restQL-golang/v5/internal/domain"
"github.com/b2wdigital/restQL-golang/v5/test"
)

func TestResolveVariables(t *testing.T) {
Expand Down
4 changes: 2 additions & 2 deletions internal/parser/ast/ast_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,8 @@ import (
"fmt"
"testing"

"github.com/b2wdigital/restQL-golang/v4/internal/parser/ast"
"github.com/b2wdigital/restQL-golang/v4/test"
"github.com/b2wdigital/restQL-golang/v5/internal/parser/ast"
"github.com/b2wdigital/restQL-golang/v5/test"
)

func String(s string) *string {
Expand Down
4 changes: 2 additions & 2 deletions internal/parser/optimizer.go
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,8 @@ import (
"regexp"
"strings"

"github.com/b2wdigital/restQL-golang/v4/internal/domain"
"github.com/b2wdigital/restQL-golang/v4/internal/parser/ast"
"github.com/b2wdigital/restQL-golang/v5/internal/domain"
"github.com/b2wdigital/restQL-golang/v5/internal/parser/ast"
"github.com/pkg/errors"
)

Expand Down
4 changes: 2 additions & 2 deletions internal/parser/parser.go
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,8 @@ package parser

import (
"errors"
"github.com/b2wdigital/restQL-golang/v4/internal/domain"
"github.com/b2wdigital/restQL-golang/v4/internal/parser/ast"
"github.com/b2wdigital/restQL-golang/v5/internal/domain"
"github.com/b2wdigital/restQL-golang/v5/internal/parser/ast"
)

// ErrInvalidQuery represents a given query that not comply with the restQL syntax
Expand Down
6 changes: 3 additions & 3 deletions internal/parser/parser_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,9 @@ import (
"regexp"
"testing"

"github.com/b2wdigital/restQL-golang/v4/internal/domain"
"github.com/b2wdigital/restQL-golang/v4/internal/parser"
"github.com/b2wdigital/restQL-golang/v4/test"
"github.com/b2wdigital/restQL-golang/v5/internal/domain"
"github.com/b2wdigital/restQL-golang/v5/internal/parser"
"github.com/b2wdigital/restQL-golang/v5/test"
)

func TestQueryParser(t *testing.T) {
Expand Down
2 changes: 1 addition & 1 deletion internal/platform/cache/cache.go
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ package cache

import (
"context"
"github.com/b2wdigital/restQL-golang/v4/pkg/restql"
"github.com/b2wdigital/restQL-golang/v5/pkg/restql"
"time"

"github.com/bluele/gcache"
Expand Down
6 changes: 3 additions & 3 deletions internal/platform/cache/parser.go
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,10 @@ package cache

import (
"context"
"github.com/b2wdigital/restQL-golang/v4/pkg/restql"
"github.com/b2wdigital/restQL-golang/v5/pkg/restql"

"github.com/b2wdigital/restQL-golang/v4/internal/domain"
"github.com/b2wdigital/restQL-golang/v4/internal/parser"
"github.com/b2wdigital/restQL-golang/v5/internal/domain"
"github.com/b2wdigital/restQL-golang/v5/internal/parser"
"github.com/pkg/errors"
)

Expand Down
4 changes: 2 additions & 2 deletions internal/platform/cache/persistence.go
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,8 @@ package cache
import (
"context"

"github.com/b2wdigital/restQL-golang/v4/internal/platform/persistence"
"github.com/b2wdigital/restQL-golang/v4/pkg/restql"
"github.com/b2wdigital/restQL-golang/v5/internal/platform/persistence"
"github.com/b2wdigital/restQL-golang/v5/pkg/restql"
"github.com/pkg/errors"
)

Expand Down
8 changes: 4 additions & 4 deletions internal/platform/httpclient/client.go
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
package httpclient

import (
"github.com/b2wdigital/restQL-golang/v4/internal/domain"
"github.com/b2wdigital/restQL-golang/v4/internal/platform/conf"
"github.com/b2wdigital/restQL-golang/v4/internal/platform/plugins"
"github.com/b2wdigital/restQL-golang/v4/pkg/restql"
"github.com/b2wdigital/restQL-golang/v5/internal/domain"
"github.com/b2wdigital/restQL-golang/v5/internal/platform/conf"
"github.com/b2wdigital/restQL-golang/v5/internal/platform/plugins"
"github.com/b2wdigital/restQL-golang/v5/pkg/restql"
)

// New constructs an HTTPClient instances.
Expand Down
8 changes: 4 additions & 4 deletions internal/platform/httpclient/fasthttp.go
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,10 @@ package httpclient

import (
"context"
"github.com/b2wdigital/restQL-golang/v4/internal/domain"
"github.com/b2wdigital/restQL-golang/v4/internal/platform/conf"
"github.com/b2wdigital/restQL-golang/v4/internal/platform/plugins"
"github.com/b2wdigital/restQL-golang/v4/pkg/restql"
"github.com/b2wdigital/restQL-golang/v5/internal/domain"
"github.com/b2wdigital/restQL-golang/v5/internal/platform/conf"
"github.com/b2wdigital/restQL-golang/v5/internal/platform/plugins"
"github.com/b2wdigital/restQL-golang/v5/pkg/restql"
"github.com/pkg/errors"
"github.com/rs/dnscache"
"github.com/valyala/fasthttp"
Expand Down
2 changes: 1 addition & 1 deletion internal/platform/httpclient/request.go
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ package httpclient
import (
"bytes"
"encoding/json"
"github.com/b2wdigital/restQL-golang/v4/pkg/restql"
"github.com/b2wdigital/restQL-golang/v5/pkg/restql"
"github.com/pkg/errors"
"github.com/valyala/fasthttp"
"net/http"
Expand Down
2 changes: 1 addition & 1 deletion internal/platform/httpclient/response.go
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
package httpclient

import (
"github.com/b2wdigital/restQL-golang/v4/pkg/restql"
"github.com/b2wdigital/restQL-golang/v5/pkg/restql"
"github.com/valyala/fasthttp"
"time"
)
Expand Down
2 changes: 1 addition & 1 deletion internal/platform/logger/logger.go
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ import (
"io"
"io/ioutil"

"github.com/b2wdigital/restQL-golang/v4/pkg/restql"
"github.com/b2wdigital/restQL-golang/v5/pkg/restql"
"github.com/rs/zerolog"
)

Expand Down
2 changes: 1 addition & 1 deletion internal/platform/persistence/database.go
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ package persistence

import (
"context"
"github.com/b2wdigital/restQL-golang/v4/pkg/restql"
"github.com/b2wdigital/restQL-golang/v5/pkg/restql"
"github.com/pkg/errors"
)

Expand Down
4 changes: 2 additions & 2 deletions internal/platform/persistence/mappings.go
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,8 @@ import (
"regexp"
"strings"

"github.com/b2wdigital/restQL-golang/v4/internal/domain"
"github.com/b2wdigital/restQL-golang/v4/pkg/restql"
"github.com/b2wdigital/restQL-golang/v5/internal/domain"
"github.com/b2wdigital/restQL-golang/v5/pkg/restql"
)

var envMappingWithTenantRegex = regexp.MustCompile("^RESTQL_MAPPING_(\\w+)_(\\w+)$")
Expand Down
6 changes: 3 additions & 3 deletions internal/platform/persistence/mappings_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -3,12 +3,12 @@ package persistence
import (
"context"
"fmt"
"github.com/b2wdigital/restQL-golang/v4/pkg/restql"
"github.com/b2wdigital/restQL-golang/v5/pkg/restql"
"io/ioutil"
"testing"

"github.com/b2wdigital/restQL-golang/v4/internal/platform/logger"
"github.com/b2wdigital/restQL-golang/v4/test"
"github.com/b2wdigital/restQL-golang/v5/internal/platform/logger"
"github.com/b2wdigital/restQL-golang/v5/test"
)

const mytenant = "mytenant"
Expand Down
2 changes: 1 addition & 1 deletion internal/platform/persistence/query.go
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ package persistence

import (
"context"
"github.com/b2wdigital/restQL-golang/v4/pkg/restql"
"github.com/b2wdigital/restQL-golang/v5/pkg/restql"
"github.com/pkg/errors"
)

Expand Down
4 changes: 2 additions & 2 deletions internal/platform/plugins/plugins.go
Original file line number Diff line number Diff line change
Expand Up @@ -2,12 +2,12 @@ package plugins

import (
"context"
"github.com/b2wdigital/restQL-golang/v4/internal/domain"
"github.com/b2wdigital/restQL-golang/v5/internal/domain"
"net/http"
"net/url"
"runtime/debug"

"github.com/b2wdigital/restQL-golang/v4/pkg/restql"
"github.com/b2wdigital/restQL-golang/v5/pkg/restql"
"github.com/pkg/errors"
"github.com/valyala/fasthttp"
)
Expand Down
2 changes: 1 addition & 1 deletion internal/platform/plugins/static_loader.go
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
package plugins

import (
"github.com/b2wdigital/restQL-golang/v4/pkg/restql"
"github.com/b2wdigital/restQL-golang/v5/pkg/restql"
"github.com/pkg/errors"
)

Expand Down
4 changes: 2 additions & 2 deletions internal/platform/web/admin.go
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,8 @@ package web
import (
"bytes"
"encoding/json"
"github.com/b2wdigital/restQL-golang/v4/internal/platform/persistence"
"github.com/b2wdigital/restQL-golang/v4/pkg/restql"
"github.com/b2wdigital/restQL-golang/v5/internal/platform/persistence"
"github.com/b2wdigital/restQL-golang/v5/pkg/restql"
"github.com/valyala/fasthttp"
"strconv"
)
Expand Down
Loading

0 comments on commit 385757e

Please sign in to comment.