Add first version of the windows ASG provider
This commit is contained in:
@@ -103,7 +103,7 @@ type PWDApi interface {
|
||||
}
|
||||
|
||||
func NewPWD(f docker.FactoryApi, e event.EventApi, s storage.StorageApi) *pwd {
|
||||
return &pwd{dockerFactory: f, event: e, storage: s, generator: xidGenerator{}, windowsProvisioner: provisioner.NewWindows(f), dindProvisioner: provisioner.NewDinD(f)}
|
||||
return &pwd{dockerFactory: f, event: e, storage: s, generator: xidGenerator{}, windowsProvisioner: provisioner.NewWindowsASG(f, s), dindProvisioner: provisioner.NewDinD(f)}
|
||||
}
|
||||
|
||||
func (p *pwd) getProvisioner(t string) (provisioner.ProvisionerApi, error) {
|
||||
|
||||
@@ -19,6 +19,12 @@ type Instance struct {
|
||||
Type string `json:"type" bson:"type"`
|
||||
Session *Session `json:"-" bson:"-"`
|
||||
ctx context.Context `json:"-" bson:"-"`
|
||||
WindowsId string `json:"-" bson:"windows_id"`
|
||||
}
|
||||
|
||||
type WindowsInstance struct {
|
||||
ID string `bson:"id"`
|
||||
SessionId string `bson:"session_id"`
|
||||
}
|
||||
|
||||
type InstanceConfig struct {
|
||||
|
||||
@@ -6,18 +6,19 @@ import (
|
||||
)
|
||||
|
||||
type Session struct {
|
||||
Id string `json:"id"`
|
||||
Instances map[string]*Instance `json:"instances" bson:"-"`
|
||||
CreatedAt time.Time `json:"created_at"`
|
||||
ExpiresAt time.Time `json:"expires_at"`
|
||||
PwdIpAddress string `json:"pwd_ip_address"`
|
||||
Ready bool `json:"ready"`
|
||||
Stack string `json:"stack"`
|
||||
StackName string `json:"stack_name"`
|
||||
ImageName string `json:"image_name"`
|
||||
Host string `json:"host"`
|
||||
Clients []*Client `json:"-" bson:"-"`
|
||||
rw sync.Mutex `json:"-"`
|
||||
Id string `json:"id"`
|
||||
Instances map[string]*Instance `json:"instances" bson:"-"`
|
||||
CreatedAt time.Time `json:"created_at"`
|
||||
ExpiresAt time.Time `json:"expires_at"`
|
||||
PwdIpAddress string `json:"pwd_ip_address"`
|
||||
Ready bool `json:"ready"`
|
||||
Stack string `json:"stack"`
|
||||
StackName string `json:"stack_name"`
|
||||
ImageName string `json:"image_name"`
|
||||
Host string `json:"host"`
|
||||
Clients []*Client `json:"-" bson:"-"`
|
||||
WindowsAssigned []*WindowsInstance `json:"-" bson:"-"`
|
||||
rw sync.Mutex `json:"-"`
|
||||
}
|
||||
|
||||
func (s *Session) Lock() {
|
||||
|
||||
Reference in New Issue
Block a user