added more stuff

This commit is contained in:
2024-05-12 00:53:08 +03:00
parent 2e773d3c7e
commit 44d75030aa
20 changed files with 934 additions and 832 deletions

View File

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

View File

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

View File

@@ -1,36 +1,36 @@
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
Ports []Port
}
type FileBrowserInfo struct {
Id string
OwnerId string
ConnectedTo ServerInfo
}
type ServerData struct {
Id string
OwnerId string
Image string
VolumeId string
Nickname string
UserPermissions map[string]Permission
}
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
Ports []Port
}
type FileBrowserInfo struct {
Id string
OwnerId string
ConnectedTo ServerInfo
}
type ServerData struct {
Id string
OwnerId string
Image string
VolumeId string
Nickname string
UserPermissions map[string]Permission
}

View File

@@ -1,9 +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"`
}
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"`
}