deprecate direct calls to sshconfig
This commit is contained in:
58
box.go
Normal file
58
box.go
Normal file
@@ -0,0 +1,58 @@
|
||||
package main
|
||||
|
||||
import "time"
|
||||
|
||||
type Box struct {
|
||||
Addr string `json:"addr"`
|
||||
User string `json:"user"`
|
||||
Key string `json:"key"`
|
||||
ssh *SSHConfig
|
||||
}
|
||||
|
||||
func (b *Box) ZFSGetLastSnapshot(path string) (s Snapshot, err error) {
|
||||
return b.ssh.getLastSnapshot(path)
|
||||
}
|
||||
|
||||
func (b *Box) ZFSIsLastSnapshot(s Snapshot) bool {
|
||||
return b.ssh.isLastSnapshot(s)
|
||||
}
|
||||
|
||||
func (b *Box) ZFSGetFirstSnapshot(path string) (s Snapshot, err error) {
|
||||
return b.ssh.getFirstSnapshot(path)
|
||||
}
|
||||
|
||||
func (b *Box) ZFSGetNextSnapshot(src Snapshot) (next Snapshot, err error) {
|
||||
return b.ssh.getNextSnapshot(src)
|
||||
}
|
||||
|
||||
func (b *Box) ZFSUpdateSnapshotList() (err error) {
|
||||
return b.ssh.getSnapshotList()
|
||||
}
|
||||
|
||||
func (b *Box) ZFSGetSnapshotList() []Snapshot {
|
||||
return b.ssh.snapshot
|
||||
}
|
||||
|
||||
func (b *Box) ZFSUpdateList() (err error) {
|
||||
return b.ssh.getZFSList()
|
||||
}
|
||||
|
||||
func (b *Box) ZFSIsZFS(path string) bool {
|
||||
return b.ssh.isZFS(path)
|
||||
}
|
||||
|
||||
func (b *Box) ZFSCreateZFS(path string) (err error) {
|
||||
return b.ssh.createZFS(path)
|
||||
}
|
||||
|
||||
func (b *Box) GetTime() time.Time {
|
||||
return b.ssh.now
|
||||
}
|
||||
|
||||
func (b *Box) UpdateTime() (err error) {
|
||||
return b.ssh.getTime()
|
||||
}
|
||||
|
||||
func (b *Box) SSHExec(cmd string) (err error) {
|
||||
return b.ssh.exec(cmd)
|
||||
}
|
||||
Reference in New Issue
Block a user