Refactor kafka to pure Go (franz-go), fix DBC stubs, update Dockerfile
This commit is contained in:
@@ -7,14 +7,14 @@ import (
|
||||
"strings"
|
||||
"sync"
|
||||
|
||||
"fiskerinc.com/modules/adminroles"
|
||||
"fiskerinc.com/modules/cache"
|
||||
"fiskerinc.com/modules/common/authproviders"
|
||||
c "fiskerinc.com/modules/common/context"
|
||||
"fiskerinc.com/modules/db/queries"
|
||||
"fiskerinc.com/modules/jwt"
|
||||
"fiskerinc.com/modules/logger"
|
||||
"fiskerinc.com/modules/utils"
|
||||
"github.com/fiskerinc/cloud-services/pkg/adminroles"
|
||||
"github.com/fiskerinc/cloud-services/pkg/cache"
|
||||
"github.com/fiskerinc/cloud-services/pkg/common/authproviders"
|
||||
c "github.com/fiskerinc/cloud-services/pkg/common/context"
|
||||
"github.com/fiskerinc/cloud-services/pkg/db/queries"
|
||||
"github.com/fiskerinc/cloud-services/pkg/jwt"
|
||||
"github.com/fiskerinc/cloud-services/pkg/logger"
|
||||
"github.com/fiskerinc/cloud-services/pkg/utils"
|
||||
)
|
||||
|
||||
var ErrorNoAPITokenHeader = errors.New("no api token header")
|
||||
|
||||
@@ -7,16 +7,16 @@ import (
|
||||
"testing"
|
||||
"time"
|
||||
|
||||
"fiskerinc.com/modules/adminroles"
|
||||
"fiskerinc.com/modules/cache"
|
||||
"fiskerinc.com/modules/common"
|
||||
"fiskerinc.com/modules/common/authproviders"
|
||||
c "fiskerinc.com/modules/common/context"
|
||||
"fiskerinc.com/modules/db/queries"
|
||||
"fiskerinc.com/modules/db/queries/mocks"
|
||||
"fiskerinc.com/modules/httphandlers"
|
||||
"fiskerinc.com/modules/redis"
|
||||
"fiskerinc.com/modules/testhelper"
|
||||
"github.com/fiskerinc/cloud-services/pkg/adminroles"
|
||||
"github.com/fiskerinc/cloud-services/pkg/cache"
|
||||
"github.com/fiskerinc/cloud-services/pkg/common"
|
||||
"github.com/fiskerinc/cloud-services/pkg/common/authproviders"
|
||||
c "github.com/fiskerinc/cloud-services/pkg/common/context"
|
||||
"github.com/fiskerinc/cloud-services/pkg/db/queries"
|
||||
"github.com/fiskerinc/cloud-services/pkg/db/queries/mocks"
|
||||
"github.com/fiskerinc/cloud-services/pkg/httphandlers"
|
||||
"github.com/fiskerinc/cloud-services/pkg/redis"
|
||||
"github.com/fiskerinc/cloud-services/pkg/testhelper"
|
||||
)
|
||||
|
||||
type testCaseAuthAPIToken struct {
|
||||
|
||||
@@ -3,9 +3,9 @@ package httphandlers
|
||||
import (
|
||||
"context"
|
||||
|
||||
"fiskerinc.com/modules/adminroles"
|
||||
"fiskerinc.com/modules/common/authproviders"
|
||||
c "fiskerinc.com/modules/common/context"
|
||||
"github.com/fiskerinc/cloud-services/pkg/adminroles"
|
||||
"github.com/fiskerinc/cloud-services/pkg/common/authproviders"
|
||||
c "github.com/fiskerinc/cloud-services/pkg/common/context"
|
||||
)
|
||||
|
||||
type AuthBase struct {
|
||||
|
||||
@@ -5,13 +5,13 @@ import (
|
||||
"errors"
|
||||
"net/http"
|
||||
|
||||
"fiskerinc.com/modules/adminroles"
|
||||
"fiskerinc.com/modules/common/authproviders"
|
||||
c "fiskerinc.com/modules/common/context"
|
||||
"fiskerinc.com/modules/db/queries"
|
||||
"fiskerinc.com/modules/jwt"
|
||||
"fiskerinc.com/modules/logger"
|
||||
"fiskerinc.com/modules/utils"
|
||||
"github.com/fiskerinc/cloud-services/pkg/adminroles"
|
||||
"github.com/fiskerinc/cloud-services/pkg/common/authproviders"
|
||||
c "github.com/fiskerinc/cloud-services/pkg/common/context"
|
||||
"github.com/fiskerinc/cloud-services/pkg/db/queries"
|
||||
"github.com/fiskerinc/cloud-services/pkg/jwt"
|
||||
"github.com/fiskerinc/cloud-services/pkg/logger"
|
||||
"github.com/fiskerinc/cloud-services/pkg/utils"
|
||||
)
|
||||
|
||||
var errNoUsername = errors.New("no username")
|
||||
|
||||
@@ -7,12 +7,12 @@ import (
|
||||
"strings"
|
||||
"testing"
|
||||
|
||||
"fiskerinc.com/modules/adminroles"
|
||||
"fiskerinc.com/modules/common/authproviders"
|
||||
c "fiskerinc.com/modules/common/context"
|
||||
"fiskerinc.com/modules/db/queries/mocks"
|
||||
"fiskerinc.com/modules/httphandlers"
|
||||
helper "fiskerinc.com/modules/testhelper"
|
||||
"github.com/fiskerinc/cloud-services/pkg/adminroles"
|
||||
"github.com/fiskerinc/cloud-services/pkg/common/authproviders"
|
||||
c "github.com/fiskerinc/cloud-services/pkg/common/context"
|
||||
"github.com/fiskerinc/cloud-services/pkg/db/queries/mocks"
|
||||
"github.com/fiskerinc/cloud-services/pkg/httphandlers"
|
||||
helper "github.com/fiskerinc/cloud-services/pkg/testhelper"
|
||||
)
|
||||
|
||||
const expectedOkBody = "OK"
|
||||
|
||||
@@ -4,7 +4,7 @@ import (
|
||||
"net/http"
|
||||
"strings"
|
||||
|
||||
"fiskerinc.com/modules/utils/envtool"
|
||||
"github.com/fiskerinc/cloud-services/pkg/utils/envtool"
|
||||
)
|
||||
|
||||
// ServiceBaseURL base url of service i.e. "/service"
|
||||
|
||||
@@ -5,7 +5,7 @@ import (
|
||||
"reflect"
|
||||
"testing"
|
||||
|
||||
"fiskerinc.com/modules/testhelper"
|
||||
"github.com/fiskerinc/cloud-services/pkg/testhelper"
|
||||
)
|
||||
|
||||
func TestHandleBaseURL(t *testing.T) {
|
||||
|
||||
@@ -3,7 +3,7 @@ package httphandlers
|
||||
import (
|
||||
"net/http"
|
||||
|
||||
"fiskerinc.com/modules/common/context"
|
||||
"github.com/fiskerinc/cloud-services/pkg/common/context"
|
||||
)
|
||||
|
||||
const ClientIDContextKey context.ContextType = "client_id"
|
||||
|
||||
@@ -4,7 +4,7 @@ import (
|
||||
"fmt"
|
||||
"net/http"
|
||||
|
||||
"fiskerinc.com/modules/logger"
|
||||
"github.com/fiskerinc/cloud-services/pkg/logger"
|
||||
)
|
||||
|
||||
func LogRequest(next http.HandlerFunc) http.HandlerFunc {
|
||||
|
||||
@@ -5,9 +5,9 @@ import (
|
||||
"net/http"
|
||||
"testing"
|
||||
|
||||
"fiskerinc.com/modules/common"
|
||||
"fiskerinc.com/modules/httphandlers"
|
||||
"fiskerinc.com/modules/testhelper"
|
||||
"github.com/fiskerinc/cloud-services/pkg/common"
|
||||
"github.com/fiskerinc/cloud-services/pkg/httphandlers"
|
||||
"github.com/fiskerinc/cloud-services/pkg/testhelper"
|
||||
)
|
||||
|
||||
func TestLogRequest(t *testing.T) {
|
||||
|
||||
@@ -4,7 +4,7 @@ import (
|
||||
"fmt"
|
||||
"net/http"
|
||||
|
||||
"fiskerinc.com/modules/utils"
|
||||
"github.com/fiskerinc/cloud-services/pkg/utils"
|
||||
)
|
||||
|
||||
// MethodAll to handle all http method
|
||||
|
||||
@@ -5,7 +5,7 @@ import (
|
||||
"net/http/httptest"
|
||||
"testing"
|
||||
|
||||
"fiskerinc.com/modules/testhelper"
|
||||
"github.com/fiskerinc/cloud-services/pkg/testhelper"
|
||||
)
|
||||
|
||||
func TestCheckMethod(t *testing.T) {
|
||||
|
||||
@@ -5,8 +5,8 @@ import (
|
||||
"net/http"
|
||||
"runtime/debug"
|
||||
|
||||
"fiskerinc.com/modules/logger"
|
||||
"fiskerinc.com/modules/utils"
|
||||
"github.com/fiskerinc/cloud-services/pkg/logger"
|
||||
"github.com/fiskerinc/cloud-services/pkg/utils"
|
||||
)
|
||||
|
||||
// PanicHandler Panic handler wrapper for http handlers
|
||||
|
||||
@@ -6,7 +6,7 @@ import (
|
||||
"strings"
|
||||
"testing"
|
||||
|
||||
"fiskerinc.com/modules/testhelper"
|
||||
"github.com/fiskerinc/cloud-services/pkg/testhelper"
|
||||
)
|
||||
|
||||
func checkPanic(w http.ResponseWriter, r *http.Request) {
|
||||
|
||||
@@ -5,7 +5,7 @@ import (
|
||||
"encoding/xml"
|
||||
"net/http"
|
||||
|
||||
"fiskerinc.com/modules/validator"
|
||||
"github.com/fiskerinc/cloud-services/pkg/validator"
|
||||
"github.com/pkg/errors"
|
||||
)
|
||||
|
||||
|
||||
@@ -5,9 +5,9 @@ import (
|
||||
"net/http"
|
||||
"testing"
|
||||
|
||||
"fiskerinc.com/modules/common"
|
||||
h "fiskerinc.com/modules/httphandlers"
|
||||
th "fiskerinc.com/modules/testhelper"
|
||||
"github.com/fiskerinc/cloud-services/pkg/common"
|
||||
h "github.com/fiskerinc/cloud-services/pkg/httphandlers"
|
||||
th "github.com/fiskerinc/cloud-services/pkg/testhelper"
|
||||
)
|
||||
|
||||
func TestParseRequestHandler(t *testing.T) {
|
||||
|
||||
@@ -9,8 +9,8 @@ import (
|
||||
|
||||
httpSwagger "github.com/swaggo/http-swagger"
|
||||
|
||||
"fiskerinc.com/modules/logger"
|
||||
"fiskerinc.com/modules/utils/envtool"
|
||||
"github.com/fiskerinc/cloud-services/pkg/logger"
|
||||
"github.com/fiskerinc/cloud-services/pkg/utils/envtool"
|
||||
)
|
||||
|
||||
var swaggerHandler func(http.ResponseWriter, *http.Request)
|
||||
|
||||
@@ -4,7 +4,7 @@ import (
|
||||
"net/http"
|
||||
"testing"
|
||||
|
||||
"fiskerinc.com/modules/testhelper"
|
||||
"github.com/fiskerinc/cloud-services/pkg/testhelper"
|
||||
)
|
||||
|
||||
const expectedRedirectURL = "/docs/index.html"
|
||||
|
||||
Reference in New Issue
Block a user