refactored
This commit is contained in:
32
dbhandler/servers.go
Normal file
32
dbhandler/servers.go
Normal file
@@ -0,0 +1,32 @@
|
||||
package dbhandler
|
||||
|
||||
import (
|
||||
"context"
|
||||
|
||||
"git.acooldomain.co/server-manager/backend/models"
|
||||
)
|
||||
|
||||
type Server struct {
|
||||
Id string
|
||||
Owner string
|
||||
Image *models.Image
|
||||
Nickname string
|
||||
Command string
|
||||
Ports []models.Port
|
||||
}
|
||||
|
||||
type ServerUpdateRequest struct {
|
||||
Owner string
|
||||
Image *models.Image
|
||||
Nickname string
|
||||
Command string
|
||||
Ports []models.Port
|
||||
}
|
||||
|
||||
type ServersDbHandler interface {
|
||||
ListServers(ctx context.Context) ([]Server, error)
|
||||
GetServer(ctx context.Context, serverId string) (*Server, error)
|
||||
CreateServer(ctx context.Context, server Server) error
|
||||
DeleteServer(ctx context.Context, serverId string) error
|
||||
UpdateServer(ctx context.Context, serverId string, updateParams ServerUpdateRequest) error
|
||||
}
|
||||
Reference in New Issue
Block a user