More standard Go project directory structure
This commit is contained in:
parent
d9d70c77b6
commit
5ed35c5a90
|
@ -3,13 +3,12 @@ package main
|
||||||
import (
|
import (
|
||||||
"log"
|
"log"
|
||||||
"net/http"
|
"net/http"
|
||||||
|
"whitelistmanager/internal/invite"
|
||||||
|
"whitelistmanager/internal/minecraft"
|
||||||
|
"whitelistmanager/internal/store"
|
||||||
|
"whitelistmanager/internal/transport"
|
||||||
|
|
||||||
"github.com/alexedwards/flow"
|
"github.com/alexedwards/flow"
|
||||||
|
|
||||||
"whitelistmanager/invite"
|
|
||||||
"whitelistmanager/minecraft"
|
|
||||||
"whitelistmanager/store"
|
|
||||||
"whitelistmanager/transport"
|
|
||||||
)
|
)
|
||||||
|
|
||||||
func main() {
|
func main() {
|
|
@ -11,11 +11,10 @@ import (
|
||||||
"net/http"
|
"net/http"
|
||||||
"os"
|
"os"
|
||||||
"time"
|
"time"
|
||||||
|
"whitelistmanager/internal/store"
|
||||||
|
|
||||||
"golang.org/x/oauth2"
|
"golang.org/x/oauth2"
|
||||||
"golang.org/x/oauth2/endpoints"
|
"golang.org/x/oauth2/endpoints"
|
||||||
|
|
||||||
"whitelistmanager/store"
|
|
||||||
)
|
)
|
||||||
|
|
||||||
const NoMinecraftOwnership = "minecraft is not owned"
|
const NoMinecraftOwnership = "minecraft is not owned"
|
|
@ -5,8 +5,7 @@ import (
|
||||||
"database/sql"
|
"database/sql"
|
||||||
"errors"
|
"errors"
|
||||||
"math/big"
|
"math/big"
|
||||||
|
"whitelistmanager/internal/store"
|
||||||
"whitelistmanager/store"
|
|
||||||
)
|
)
|
||||||
|
|
||||||
const NotOwnerofServer = "user is not owner of server"
|
const NotOwnerofServer = "user is not owner of server"
|
|
@ -3,12 +3,12 @@ package invite_test
|
||||||
import (
|
import (
|
||||||
"database/sql"
|
"database/sql"
|
||||||
"testing"
|
"testing"
|
||||||
|
"whitelistmanager/internal/invite"
|
||||||
|
"whitelistmanager/internal/store"
|
||||||
|
|
||||||
"github.com/golang/mock/gomock"
|
"github.com/golang/mock/gomock"
|
||||||
|
|
||||||
"whitelistmanager/invite"
|
|
||||||
mock_store "whitelistmanager/mocks/store"
|
mock_store "whitelistmanager/mocks/store"
|
||||||
"whitelistmanager/store"
|
|
||||||
)
|
)
|
||||||
|
|
||||||
func TestInvite(t *testing.T) {
|
func TestInvite(t *testing.T) {
|
|
@ -3,10 +3,9 @@ package minecraft
|
||||||
import (
|
import (
|
||||||
"errors"
|
"errors"
|
||||||
"fmt"
|
"fmt"
|
||||||
|
"whitelistmanager/internal/store"
|
||||||
|
|
||||||
mcrcon "github.com/Kelwing/mc-rcon"
|
mcrcon "github.com/Kelwing/mc-rcon"
|
||||||
|
|
||||||
"whitelistmanager/store"
|
|
||||||
)
|
)
|
||||||
|
|
||||||
const (
|
const (
|
|
@ -10,14 +10,13 @@ import (
|
||||||
"fmt"
|
"fmt"
|
||||||
"log"
|
"log"
|
||||||
"net/http"
|
"net/http"
|
||||||
|
"whitelistmanager/internal/auth"
|
||||||
|
"whitelistmanager/internal/invite"
|
||||||
|
"whitelistmanager/internal/minecraft"
|
||||||
|
"whitelistmanager/internal/store"
|
||||||
|
|
||||||
"github.com/alexedwards/flow"
|
"github.com/alexedwards/flow"
|
||||||
"github.com/google/uuid"
|
"github.com/google/uuid"
|
||||||
|
|
||||||
"whitelistmanager/auth"
|
|
||||||
"whitelistmanager/invite"
|
|
||||||
"whitelistmanager/minecraft"
|
|
||||||
"whitelistmanager/store"
|
|
||||||
)
|
)
|
||||||
|
|
||||||
type Handler struct {
|
type Handler struct {
|
|
@ -12,16 +12,16 @@ import (
|
||||||
"strings"
|
"strings"
|
||||||
"testing"
|
"testing"
|
||||||
"time"
|
"time"
|
||||||
|
"whitelistmanager/internal/invite"
|
||||||
|
"whitelistmanager/internal/store"
|
||||||
|
"whitelistmanager/internal/transport"
|
||||||
|
|
||||||
"github.com/alexedwards/flow"
|
"github.com/alexedwards/flow"
|
||||||
"github.com/golang/mock/gomock"
|
"github.com/golang/mock/gomock"
|
||||||
|
|
||||||
"whitelistmanager/invite"
|
|
||||||
mock_invite "whitelistmanager/mocks/invite"
|
mock_invite "whitelistmanager/mocks/invite"
|
||||||
mock_minecraft "whitelistmanager/mocks/minecraft"
|
mock_minecraft "whitelistmanager/mocks/minecraft"
|
||||||
mock_store "whitelistmanager/mocks/store"
|
mock_store "whitelistmanager/mocks/store"
|
||||||
"whitelistmanager/store"
|
|
||||||
"whitelistmanager/transport"
|
|
||||||
)
|
)
|
||||||
|
|
||||||
type invitePayload struct {
|
type invitePayload struct {
|
|
@ -6,8 +6,7 @@ package mock_invite
|
||||||
|
|
||||||
import (
|
import (
|
||||||
reflect "reflect"
|
reflect "reflect"
|
||||||
|
"whitelistmanager/internal/store"
|
||||||
store "whitelistmanager/store"
|
|
||||||
|
|
||||||
gomock "github.com/golang/mock/gomock"
|
gomock "github.com/golang/mock/gomock"
|
||||||
)
|
)
|
||||||
|
|
|
@ -6,8 +6,7 @@ package mock_minecraft
|
||||||
|
|
||||||
import (
|
import (
|
||||||
reflect "reflect"
|
reflect "reflect"
|
||||||
|
"whitelistmanager/internal/store"
|
||||||
store "whitelistmanager/store"
|
|
||||||
|
|
||||||
gomock "github.com/golang/mock/gomock"
|
gomock "github.com/golang/mock/gomock"
|
||||||
)
|
)
|
||||||
|
|
|
@ -6,8 +6,7 @@ package mock_store
|
||||||
|
|
||||||
import (
|
import (
|
||||||
reflect "reflect"
|
reflect "reflect"
|
||||||
|
"whitelistmanager/internal/store"
|
||||||
store "whitelistmanager/store"
|
|
||||||
|
|
||||||
gomock "github.com/golang/mock/gomock"
|
gomock "github.com/golang/mock/gomock"
|
||||||
)
|
)
|
||||||
|
|
Loading…
Reference in a new issue