Restructure project layout

This commit is contained in:
eikendev 2021-01-16 16:56:49 +01:00
parent a49db216d5
commit 9a4a096526
No known key found for this signature in database
GPG key ID: A1BDB1B28C8EF694
32 changed files with 35 additions and 35 deletions

View file

@ -12,7 +12,7 @@ RUN set -ex \
&& update-ca-certificates \
&& go mod download \
&& go mod verify \
&& GOOS=linux GOARCH=amd64 go build -ldflags="-w -s" -o app . \
&& make build \
&& chmod +x /build/app
FROM alpine

View file

@ -2,7 +2,7 @@ IMAGE := eikendev/pushbits
.PHONY: build
build:
go build -ldflags="-w -s" -o app .
go build -ldflags="-w -s" -o app ./cmd/pushbits
.PHONY: test
test:

View file

@ -6,12 +6,12 @@ import (
"os/signal"
"syscall"
"github.com/pushbits/server/authentication/credentials"
"github.com/pushbits/server/configuration"
"github.com/pushbits/server/database"
"github.com/pushbits/server/dispatcher"
"github.com/pushbits/server/router"
"github.com/pushbits/server/runner"
"github.com/pushbits/server/internal/authentication/credentials"
"github.com/pushbits/server/internal/configuration"
"github.com/pushbits/server/internal/database"
"github.com/pushbits/server/internal/dispatcher"
"github.com/pushbits/server/internal/router"
"github.com/pushbits/server/internal/runner"
)
func setupCleanup(db *database.Database, dp *dispatcher.Dispatcher) {

View file

@ -5,8 +5,8 @@ import (
"log"
"net/http"
"github.com/pushbits/server/authentication"
"github.com/pushbits/server/model"
"github.com/pushbits/server/internal/authentication"
"github.com/pushbits/server/internal/model"
"github.com/gin-gonic/gin"
)

View file

@ -4,7 +4,7 @@ import (
"errors"
"net/http"
"github.com/pushbits/server/model"
"github.com/pushbits/server/internal/model"
"github.com/gin-gonic/gin"
)

View file

@ -1,7 +1,7 @@
package api
import (
"github.com/pushbits/server/model"
"github.com/pushbits/server/internal/model"
)
// The Database interface for encapsulating database access.

View file

@ -6,8 +6,8 @@ import (
"strings"
"time"
"github.com/pushbits/server/authentication"
"github.com/pushbits/server/model"
"github.com/pushbits/server/internal/authentication"
"github.com/pushbits/server/internal/model"
"github.com/gin-gonic/gin"
)

View file

@ -5,8 +5,8 @@ import (
"log"
"net/http"
"github.com/pushbits/server/authentication"
"github.com/pushbits/server/model"
"github.com/pushbits/server/internal/authentication"
"github.com/pushbits/server/internal/model"
"github.com/gin-gonic/gin"
)

View file

@ -4,7 +4,7 @@ import (
"errors"
"net/http"
"github.com/pushbits/server/authentication"
"github.com/pushbits/server/internal/authentication"
"github.com/gin-gonic/gin"
)

View file

@ -4,8 +4,8 @@ import (
"errors"
"net/http"
"github.com/pushbits/server/authentication/credentials"
"github.com/pushbits/server/model"
"github.com/pushbits/server/internal/authentication/credentials"
"github.com/pushbits/server/internal/model"
"github.com/gin-gonic/gin"
)

View file

@ -4,7 +4,7 @@ import (
"errors"
"net/http"
"github.com/pushbits/server/model"
"github.com/pushbits/server/internal/model"
"github.com/gin-gonic/gin"
)

View file

@ -3,7 +3,7 @@ package credentials
import (
"log"
"github.com/pushbits/server/configuration"
"github.com/pushbits/server/internal/configuration"
"github.com/alexedwards/argon2id"
)

View file

@ -3,8 +3,8 @@ package database
import (
"errors"
"github.com/pushbits/server/assert"
"github.com/pushbits/server/model"
"github.com/pushbits/server/internal/assert"
"github.com/pushbits/server/internal/model"
"gorm.io/gorm"
)

View file

@ -8,8 +8,8 @@ import (
"path/filepath"
"time"
"github.com/pushbits/server/authentication/credentials"
"github.com/pushbits/server/model"
"github.com/pushbits/server/internal/authentication/credentials"
"github.com/pushbits/server/internal/model"
"gorm.io/driver/mysql"
"gorm.io/driver/sqlite"

View file

@ -3,8 +3,8 @@ package database
import (
"errors"
"github.com/pushbits/server/assert"
"github.com/pushbits/server/model"
"github.com/pushbits/server/internal/assert"
"github.com/pushbits/server/internal/model"
"gorm.io/gorm"
)

View file

@ -4,7 +4,7 @@ import (
"fmt"
"log"
"github.com/pushbits/server/model"
"github.com/pushbits/server/internal/model"
"github.com/matrix-org/gomatrix"
)

View file

@ -4,7 +4,7 @@ import (
"fmt"
"log"
"github.com/pushbits/server/model"
"github.com/pushbits/server/internal/model"
)
// SendNotification sends a notification to the specified user.

View file

@ -3,7 +3,7 @@ package model
import (
"log"
"github.com/pushbits/server/authentication/credentials"
"github.com/pushbits/server/internal/authentication/credentials"
)
// User holds information like the name, the secret, and the applications of a user.

View file

@ -3,11 +3,11 @@ package router
import (
"log"
"github.com/pushbits/server/api"
"github.com/pushbits/server/authentication"
"github.com/pushbits/server/authentication/credentials"
"github.com/pushbits/server/database"
"github.com/pushbits/server/dispatcher"
"github.com/pushbits/server/internal/api"
"github.com/pushbits/server/internal/authentication"
"github.com/pushbits/server/internal/authentication/credentials"
"github.com/pushbits/server/internal/database"
"github.com/pushbits/server/internal/dispatcher"
"github.com/gin-contrib/location"
"github.com/gin-gonic/gin"