-
Notifications
You must be signed in to change notification settings - Fork 162
/
basic_deps.go
44 lines (34 loc) · 1.04 KB
/
basic_deps.go
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
package cmd
import (
boshcmd "github.com/cloudfoundry/bosh-utils/fileutil"
boshlog "github.com/cloudfoundry/bosh-utils/logger"
boshsys "github.com/cloudfoundry/bosh-utils/system"
boshuuid "github.com/cloudfoundry/bosh-utils/uuid"
"github.com/pivotal-golang/clock"
bicrypto "github.com/cloudfoundry/bosh-cli/crypto"
boshui "github.com/cloudfoundry/bosh-cli/ui"
)
type BasicDeps struct {
FS boshsys.FileSystem
UI *boshui.ConfUI
Logger boshlog.Logger
UUIDGen boshuuid.Generator
CmdRunner boshsys.CmdRunner
Compressor boshcmd.Compressor
SHA1Calc bicrypto.SHA1Calculator
Time clock.Clock
}
func NewBasicDeps(ui *boshui.ConfUI, logger boshlog.Logger) BasicDeps {
fs := boshsys.NewOsFileSystemWithStrictTempRoot(logger)
cmdRunner := boshsys.NewExecCmdRunner(logger)
return BasicDeps{
FS: fs,
UI: ui,
Logger: logger,
UUIDGen: boshuuid.NewGenerator(),
CmdRunner: cmdRunner,
Compressor: boshcmd.NewTarballCompressor(cmdRunner, fs),
SHA1Calc: bicrypto.NewSha1Calculator(fs),
Time: clock.NewClock(),
}
}