add control package, reorganize some files and packages
This commit is contained in:
parent
50e27db1c4
commit
a2d741c13a
|
@ -4,6 +4,9 @@ type DockerEnvironment struct {
|
|||
BaseEnvironment
|
||||
}
|
||||
|
||||
// Ensure DockerEnvironment implements Environment
|
||||
var _ Environment = &DockerEnvironment{}
|
||||
|
||||
func NewDockerEnvironment() *DockerEnvironment {
|
||||
return &DockerEnvironment{}
|
||||
}
|
|
@ -21,6 +21,9 @@ type Environment interface {
|
|||
type BaseEnvironment struct {
|
||||
}
|
||||
|
||||
// Ensure BaseEnvironment implements Environment
|
||||
var _ Environment = &BaseEnvironment{}
|
||||
|
||||
func (env *BaseEnvironment) Create() error {
|
||||
return nil
|
||||
}
|
||||
|
@ -41,3 +44,7 @@ func (env *BaseEnvironment) ReCreate() error {
|
|||
}
|
||||
return env.Create()
|
||||
}
|
||||
|
||||
func (env *BaseEnvironment) Exec() error {
|
||||
return nil
|
||||
}
|
12
control/server.go
Normal file
12
control/server.go
Normal file
|
@ -0,0 +1,12 @@
|
|||
package control
|
||||
|
||||
// Server is a single instance of a Service managed by the panel
|
||||
type Server struct {
|
||||
Service *Service
|
||||
}
|
||||
|
||||
// HasPermission checks wether a provided token has a specific permission
|
||||
func (s *Server) HasPermission(token string, permission string) bool {
|
||||
// TODO: properly implement this
|
||||
return true
|
||||
}
|
7
control/service.go
Normal file
7
control/service.go
Normal file
|
@ -0,0 +1,7 @@
|
|||
package control
|
||||
|
||||
import "github.com/schrej/wings/control/environments"
|
||||
|
||||
type Service struct {
|
||||
Environment environments.Environment
|
||||
}
|
|
@ -1,7 +0,0 @@
|
|||
package services
|
||||
|
||||
import "github.com/schrej/wings/environments"
|
||||
|
||||
type Service struct {
|
||||
Environment environments.Environment
|
||||
}
|
Loading…
Reference in New Issue
Block a user