fixed skeleton and permissions
This commit is contained in:
parent
7260c55c76
commit
9616aa3d5c
@ -12,8 +12,15 @@ type InstanceManager struct {
|
|||||||
instancemanager.InstanceManager
|
instancemanager.InstanceManager
|
||||||
}
|
}
|
||||||
|
|
||||||
// General
|
//General
|
||||||
// Read Only
|
// Read Only
|
||||||
|
|
||||||
|
func (self *InstanceManager) GetImage(ctx context.Context, imageId string) (*instancemanager.Image, error) {
|
||||||
|
return nil, nil
|
||||||
|
}
|
||||||
|
func (self *InstanceManager) ListImages(ctx context.Context) ([]instancemanager.Image, error) {
|
||||||
|
return nil, nil
|
||||||
|
}
|
||||||
func (self *InstanceManager) GetServer(ctx context.Context, serverId string) (*instancemanager.Server, error) {
|
func (self *InstanceManager) GetServer(ctx context.Context, serverId string) (*instancemanager.Server, error) {
|
||||||
return nil, nil
|
return nil, nil
|
||||||
}
|
}
|
||||||
@ -22,41 +29,33 @@ func (self *InstanceManager) ListServers(ctx context.Context) ([]instancemanager
|
|||||||
}
|
}
|
||||||
|
|
||||||
// State Changing
|
// State Changing
|
||||||
func (self *InstanceManager) StartServer(ctx context.Context, serverId string, command string, ports []models.Port) error {
|
func (self *InstanceManager) StartServer(ctx context.Context, serverId string, imageId string, command string, ports []models.Port) error {
|
||||||
return nil
|
return nil
|
||||||
}
|
}
|
||||||
func (self *InstanceManager) StopServer(ctx context.Context, serverId string) error {
|
func (self *InstanceManager) StopServer(ctx context.Context, serverId string) error {
|
||||||
return nil
|
return nil
|
||||||
}
|
}
|
||||||
|
|
||||||
func (self *InstanceManager) CreateServer(ctx context.Context, image models.Image) (*instancemanager.Server, error) {
|
func (self *InstanceManager) CreateServer(ctx context.Context) (*instancemanager.Server, error) {
|
||||||
|
|
||||||
return nil, nil
|
return nil, nil
|
||||||
}
|
}
|
||||||
|
|
||||||
func (self *InstanceManager) DeleteServer(ctx context.Context, serverId string) error {
|
func (self *InstanceManager) DeleteServer(ctx context.Context, serverId string) error {
|
||||||
return nil
|
return nil
|
||||||
}
|
}
|
||||||
|
|
||||||
// Terminal
|
// Terminal {return nil, nil}
|
||||||
|
|
||||||
// Read Only
|
// Status Changing {return nil, nil}
|
||||||
func (self *InstanceManager) GetLogs(ctx context.Context, serverId string) (string, error) {
|
|
||||||
return "", nil
|
|
||||||
}
|
|
||||||
|
|
||||||
// Status Changing
|
|
||||||
func (self *InstanceManager) InteractiveTerminal(ctx context.Context, serverId string) (*net.Conn, error) {
|
func (self *InstanceManager) InteractiveTerminal(ctx context.Context, serverId string) (*net.Conn, error) {
|
||||||
return nil, nil
|
return nil, nil
|
||||||
}
|
}
|
||||||
func (self *InstanceManager) RunCommand(ctx context.Context, serverId string, command string) (string, error) {
|
func (self *InstanceManager) ResizeTerminal(ctx context.Context, serverId string, width uint, height uint) error {
|
||||||
|
return nil
|
||||||
return "", nil
|
|
||||||
}
|
}
|
||||||
|
|
||||||
// File Browser
|
// File Browser {return nil, nil}
|
||||||
|
|
||||||
// Read Only
|
// Read Only {return nil, nil}
|
||||||
func (self *InstanceManager) GetFileBrowser(ctx context.Context, serverId string) (*models.FileBrowser, error) {
|
func (self *InstanceManager) GetFileBrowser(ctx context.Context, serverId string) (*models.FileBrowser, error) {
|
||||||
return nil, nil
|
return nil, nil
|
||||||
}
|
}
|
||||||
@ -64,7 +63,7 @@ func (self *InstanceManager) ListFileBrowsers(ctx context.Context) ([]models.Fil
|
|||||||
return nil, nil
|
return nil, nil
|
||||||
}
|
}
|
||||||
|
|
||||||
// Status Changing
|
// Status Changing {return nil, nil}
|
||||||
func (self *InstanceManager) StartFileBrowser(ctx context.Context, serverId string) (*models.FileBrowser, error) {
|
func (self *InstanceManager) StartFileBrowser(ctx context.Context, serverId string) (*models.FileBrowser, error) {
|
||||||
return nil, nil
|
return nil, nil
|
||||||
}
|
}
|
||||||
|
@ -544,6 +544,6 @@ func LoadGroup(group *gin.RouterGroup, config models.GlobalConfig) {
|
|||||||
group.GET("/:server_id/attach", auth.AuthorizedTo(models.RunCommand), connection.ServerAuthorized(models.RunCommand), auth.AuthorizationEnforcer(), connection.AttachServer)
|
group.GET("/:server_id/attach", auth.AuthorizedTo(models.RunCommand), connection.ServerAuthorized(models.RunCommand), auth.AuthorizationEnforcer(), connection.AttachServer)
|
||||||
group.PATCH("/:server_id", auth.AuthorizedTo(models.Admin), connection.ServerAuthorized(models.Admin), auth.AuthorizationEnforcer(), connection.UpdateServer)
|
group.PATCH("/:server_id", auth.AuthorizedTo(models.Admin), connection.ServerAuthorized(models.Admin), auth.AuthorizationEnforcer(), connection.UpdateServer)
|
||||||
group.POST("/:server_id/browse", auth.AuthorizedTo(models.Browse), connection.ServerAuthorized(models.Admin), auth.AuthorizationEnforcer(), connection.BrowseServer)
|
group.POST("/:server_id/browse", auth.AuthorizedTo(models.Browse), connection.ServerAuthorized(models.Admin), auth.AuthorizationEnforcer(), connection.BrowseServer)
|
||||||
group.GET("/:server_id/permissions", auth.AuthorizedTo(models.Browse), connection.ServerAuthorized(models.Admin), auth.AuthorizationEnforcer(), connection.GetServerUserPermissions)
|
group.GET("/:server_id/permissions", connection.GetServerUserPermissions)
|
||||||
group.POST("/:server_id/permissions", auth.AuthorizedTo(models.Browse), connection.ServerAuthorized(models.Admin), auth.AuthorizationEnforcer(), connection.SetServerUserPermissions)
|
group.POST("/:server_id/permissions", auth.AuthorizedTo(models.Admin), connection.ServerAuthorized(models.Admin), auth.AuthorizationEnforcer(), connection.SetServerUserPermissions)
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user