Rename project module to cgnolink
This commit is contained in:
parent
a4cfa52e3e
commit
fca15187b2
7 changed files with 28 additions and 28 deletions
|
|
@ -1,10 +1,10 @@
|
|||
FROM golang:1.16-alpine AS builder
|
||||
ADD . /src
|
||||
RUN cd /src/cmd/link && go build
|
||||
RUN cd /src/cmd/cgnolink && go build
|
||||
|
||||
FROM alpine
|
||||
EXPOSE 8080
|
||||
WORKDIR /app
|
||||
COPY --from=builder /src/cmd/link/link /app/
|
||||
COPY --from=builder /src/cmd/cgnolink/cgnolink /app/
|
||||
COPY --from=builder /src/migrations /app/migrations
|
||||
ENTRYPOINT ./link
|
||||
ENTRYPOINT ./cgnolink
|
||||
20
cmd/cgnolink/main.go
Normal file
20
cmd/cgnolink/main.go
Normal file
|
|
@ -0,0 +1,20 @@
|
|||
package main
|
||||
|
||||
import (
|
||||
"cgnolink"
|
||||
"cgnolink/database"
|
||||
)
|
||||
|
||||
func main() {
|
||||
conf := cgnolink.NewConfig()
|
||||
|
||||
pool := database.Pool(conf)
|
||||
|
||||
if err := cgnolink.Migrate(pool); err != nil {
|
||||
panic(err)
|
||||
}
|
||||
|
||||
server := cgnolink.NewServer(conf, pool)
|
||||
|
||||
server.Logger.Fatal(server.Start(":8080"))
|
||||
}
|
||||
|
|
@ -1,20 +0,0 @@
|
|||
package main
|
||||
|
||||
import (
|
||||
"link"
|
||||
"link/database"
|
||||
)
|
||||
|
||||
func main() {
|
||||
conf := link.NewConfig()
|
||||
|
||||
pool := database.Pool(conf)
|
||||
|
||||
if err := link.Migrate(pool); err != nil {
|
||||
panic(err)
|
||||
}
|
||||
|
||||
server := link.NewServer(conf, pool)
|
||||
|
||||
server.Logger.Fatal(server.Start(":8080"))
|
||||
}
|
||||
|
|
@ -1,4 +1,4 @@
|
|||
package link
|
||||
package cgnolink
|
||||
|
||||
import (
|
||||
"github.com/knadh/koanf"
|
||||
|
|
|
|||
2
go.mod
2
go.mod
|
|
@ -1,4 +1,4 @@
|
|||
module link
|
||||
module cgnolink
|
||||
|
||||
go 1.16
|
||||
|
||||
|
|
|
|||
|
|
@ -1,4 +1,4 @@
|
|||
package link
|
||||
package cgnolink
|
||||
|
||||
import (
|
||||
"context"
|
||||
|
|
|
|||
|
|
@ -1,11 +1,11 @@
|
|||
package link
|
||||
package cgnolink
|
||||
|
||||
import (
|
||||
"cgnolink/link"
|
||||
"github.com/jackc/pgx/v4/pgxpool"
|
||||
"github.com/knadh/koanf"
|
||||
"github.com/labstack/echo/v4"
|
||||
"github.com/labstack/echo/v4/middleware"
|
||||
"link/link"
|
||||
"net/http"
|
||||
)
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue