mirror of
https://github.com/pushbits/server.git
synced 2025-05-10 23:47:00 +02:00
Restructure project layout
This commit is contained in:
parent
a49db216d5
commit
9a4a096526
32 changed files with 35 additions and 35 deletions
|
@ -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
|
||||
|
|
2
Makefile
2
Makefile
|
@ -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:
|
||||
|
|
|
@ -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) {
|
|
@ -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"
|
||||
)
|
|
@ -4,7 +4,7 @@ import (
|
|||
"errors"
|
||||
"net/http"
|
||||
|
||||
"github.com/pushbits/server/model"
|
||||
"github.com/pushbits/server/internal/model"
|
||||
|
||||
"github.com/gin-gonic/gin"
|
||||
)
|
|
@ -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.
|
|
@ -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"
|
||||
)
|
|
@ -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"
|
||||
)
|
|
@ -4,7 +4,7 @@ import (
|
|||
"errors"
|
||||
"net/http"
|
||||
|
||||
"github.com/pushbits/server/authentication"
|
||||
"github.com/pushbits/server/internal/authentication"
|
||||
|
||||
"github.com/gin-gonic/gin"
|
||||
)
|
|
@ -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"
|
||||
)
|
|
@ -4,7 +4,7 @@ import (
|
|||
"errors"
|
||||
"net/http"
|
||||
|
||||
"github.com/pushbits/server/model"
|
||||
"github.com/pushbits/server/internal/model"
|
||||
|
||||
"github.com/gin-gonic/gin"
|
||||
)
|
|
@ -3,7 +3,7 @@ package credentials
|
|||
import (
|
||||
"log"
|
||||
|
||||
"github.com/pushbits/server/configuration"
|
||||
"github.com/pushbits/server/internal/configuration"
|
||||
|
||||
"github.com/alexedwards/argon2id"
|
||||
)
|
|
@ -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"
|
||||
)
|
|
@ -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"
|
|
@ -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"
|
||||
)
|
|
@ -4,7 +4,7 @@ import (
|
|||
"fmt"
|
||||
"log"
|
||||
|
||||
"github.com/pushbits/server/model"
|
||||
"github.com/pushbits/server/internal/model"
|
||||
|
||||
"github.com/matrix-org/gomatrix"
|
||||
)
|
|
@ -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.
|
|
@ -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.
|
|
@ -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"
|
Loading…
Add table
Add a link
Reference in a new issue