added more functionality

This commit is contained in:
2024-05-10 00:39:06 +03:00
parent 10c5367b9b
commit 5fc472832f
17 changed files with 413 additions and 37 deletions

3
models/go.mod Normal file
View File

@@ -0,0 +1,3 @@
module acooldomain.co/backend/models
go 1.22.0

13
models/permissions.go Normal file
View File

@@ -0,0 +1,13 @@
package models
type Permission int
const (
Start Permission = 1 << iota
Stop
Browse
Create
Delete
RunCommand
Admin
)

26
models/server.go Normal file
View File

@@ -0,0 +1,26 @@
package models
type Port struct {
Protocol string
Number int
}
type ImageInfo struct {
Name string
Version string
Ports []Port
}
type ServerInfo struct {
Id string
OwnerId string
Image ImageInfo
On bool
Nickname string
}
type FileBrowserInfo struct {
Id string
OwnerId string
ConnectedTo ServerInfo
}

9
models/user.go Normal file
View File

@@ -0,0 +1,9 @@
package models
type User struct {
Username string `json:"username"`
Email string `json:"email"`
MaxOwnedServers int `json:"maxed_owned_servers"`
Permissions Permission `json:"permissions"`
HashedPass string `json:"hashedPass"`
}