Add ssh proxy
This commit is contained in:
committed by
Marcos Lilljedahl
parent
9de63d5c17
commit
755e3c7707
@@ -150,6 +150,20 @@ func (p *pwd) InstanceFindByIP(ip string) *Instance {
|
||||
return nil
|
||||
}
|
||||
|
||||
func (p *pwd) InstanceFindByIPAndSession(sessionPrefix, ip string) *Instance {
|
||||
defer observeAction("InstanceFindByIPAndSession", time.Now())
|
||||
for id, s := range sessions {
|
||||
if strings.HasPrefix(id, sessionPrefix) {
|
||||
for _, i := range s.Instances {
|
||||
if i.IP == ip {
|
||||
return i
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
return nil
|
||||
}
|
||||
|
||||
func (p *pwd) InstanceFindByAlias(sessionPrefix, alias string) *Instance {
|
||||
defer observeAction("InstanceFindByAlias", time.Now())
|
||||
for id, s := range sessions {
|
||||
|
||||
@@ -68,6 +68,7 @@ type PWDApi interface {
|
||||
InstanceGet(session *Session, name string) *Instance
|
||||
InstanceFindByIP(ip string) *Instance
|
||||
InstanceFindByAlias(sessionPrefix, alias string) *Instance
|
||||
InstanceFindByIPAndSession(sessionPrefix, ip string) *Instance
|
||||
InstanceDelete(session *Session, instance *Instance) error
|
||||
InstanceWriteToTerminal(instance *Instance, data string)
|
||||
InstanceAllowedImages() []string
|
||||
|
||||
Reference in New Issue
Block a user