This commit is contained in:
Jonathan Leibiusky @xetorthio
2017-05-19 17:25:05 -03:00
parent 686c861928
commit 911d56bc49
5 changed files with 154 additions and 0 deletions

41
pwd/pwd.go Normal file
View File

@@ -0,0 +1,41 @@
package pwd
import (
"sync"
"time"
"github.com/play-with-docker/play-with-docker/docker"
)
type Session struct {
rw sync.Mutex
Id string `json:"id"`
Instances map[string]*Instance `json:"instances"`
clients []*Client `json:"-"`
CreatedAt time.Time `json:"created_at"`
ExpiresAt time.Time `json:"expires_at"`
scheduled bool `json:"-"`
ticker *time.Ticker `json:"-"`
PwdIpAddress string `json:"pwd_ip_address"`
Ready bool `json:"ready"`
Stack string `json:"stack"`
closingTimer *time.Timer `json:"-"`
}
type Instance struct {
}
type Client struct {
}
type pwd struct {
docker docker.Docker `json:"-"`
}
type PWDApi interface {
NewSession(duration time.Duration, stack string) (*Session, error)
}
func NewPWD(d docker.Docker) pwd {
return pwd{docker: d}
}