tmp
This commit is contained in:
parent
0cef1773a7
commit
f8f10b7c15
@ -5,6 +5,7 @@ import (
|
|||||||
|
|
||||||
"git.optclblast.xyz/draincloud/draincloud-core/internal/app"
|
"git.optclblast.xyz/draincloud/draincloud-core/internal/app"
|
||||||
"git.optclblast.xyz/draincloud/draincloud-core/internal/plugin"
|
"git.optclblast.xyz/draincloud/draincloud-core/internal/plugin"
|
||||||
|
"git.optclblast.xyz/draincloud/draincloud-core/internal/storage/postgres"
|
||||||
)
|
)
|
||||||
|
|
||||||
func main() {
|
func main() {
|
||||||
@ -12,5 +13,8 @@ func main() {
|
|||||||
ps := plugin.NewPluginStore()
|
ps := plugin.NewPluginStore()
|
||||||
pl := plugin.MustNewPluginLoader(ctx, 8081, ps)
|
pl := plugin.MustNewPluginLoader(ctx, 8081, ps)
|
||||||
pl.Run(ctx)
|
pl.Run(ctx)
|
||||||
app.New().Run(context.TODO())
|
|
||||||
|
pg := postgres.New(ctx, "postgres://draincloud:draincloud_secret@localhost:5432/draincloud?sslmode=disable")
|
||||||
|
|
||||||
|
app.New(pg).Run(context.TODO())
|
||||||
}
|
}
|
||||||
|
@ -7,9 +7,9 @@ services:
|
|||||||
environment:
|
environment:
|
||||||
POSTGRES_USERNAME: draincloud
|
POSTGRES_USERNAME: draincloud
|
||||||
POSTGRES_DB: draincloud
|
POSTGRES_DB: draincloud
|
||||||
POSTGRES_PASSWORD: draincloud.dev.secret
|
POSTGRES_PASSWORD: draincloud_secret
|
||||||
volumes:
|
volumes:
|
||||||
- draincloud-db-data:/
|
- draincloud-db-data:/var/lib/postgresql/data
|
||||||
|
|
||||||
volumes:
|
volumes:
|
||||||
draincloud-db-data: {}
|
draincloud-db-data: {}
|
@ -20,11 +20,16 @@ type DrainCloud struct {
|
|||||||
datadase storage.Database
|
datadase storage.Database
|
||||||
}
|
}
|
||||||
|
|
||||||
func New() *DrainCloud {
|
func New(
|
||||||
|
datadase storage.Database,
|
||||||
|
) *DrainCloud {
|
||||||
mux := gin.Default()
|
mux := gin.Default()
|
||||||
|
|
||||||
d := new(DrainCloud)
|
d := &DrainCloud{
|
||||||
|
datadase: datadase,
|
||||||
|
}
|
||||||
|
|
||||||
|
// Built-in auth component of DrainCloud-Core
|
||||||
authGroup := mux.Group("/auth")
|
authGroup := mux.Group("/auth")
|
||||||
{
|
{
|
||||||
authGroup.POST("/register", d.Register)
|
authGroup.POST("/register", d.Register)
|
||||||
|
@ -4,7 +4,7 @@ import "time"
|
|||||||
|
|
||||||
type Session struct {
|
type Session struct {
|
||||||
ID string
|
ID string
|
||||||
User *User
|
User *User
|
||||||
}
|
}
|
||||||
|
|
||||||
type User struct {
|
type User struct {
|
||||||
|
Loading…
Reference in New Issue
Block a user