github.com/niedbalski/juju@v0.0.0-20190215020005-8ff100488e47/service/systemd/shims.go (about) 1 // Copyright 2018 Canonical Ltd. 2 // Licensed under the AGPLv3, see LICENCE file for details. 3 4 package systemd 5 6 import ( 7 "os" 8 9 "github.com/juju/utils/exec" 10 ) 11 12 // Interfaces for call surfaces of command-line and file-system side-effects. 13 // These are "patched" over the existing methods by the test suite. 14 // To regenerate the mock for these interfaces, 15 // run "go generate" from the package directory. 16 //go:generate mockgen -package systemd -destination shims_mock_test.go github.com/juju/juju/service/systemd ShimFileOps,ShimExec 17 18 type ShimFileOps interface { 19 RemoveAll(name string) error 20 MkdirAll(dirname string) error 21 CreateFile(filename string, data []byte, perm os.FileMode) error 22 } 23 24 type ShimExec interface { 25 RunCommands(args exec.RunParams) (*exec.ExecResponse, error) 26 }