lang: Split the download code out into its own package
More cleanups.
This commit is contained in:
@@ -15,7 +15,7 @@
|
|||||||
// You should have received a copy of the GNU General Public License
|
// You should have received a copy of the GNU General Public License
|
||||||
// along with this program. If not, see <http://www.gnu.org/licenses/>.
|
// along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||||
|
|
||||||
package lang // TODO: move this into a sub package of lang/$name?
|
package download
|
||||||
|
|
||||||
import (
|
import (
|
||||||
"fmt"
|
"fmt"
|
||||||
@@ -25,6 +25,7 @@ import (
|
|||||||
|
|
||||||
"github.com/purpleidea/mgmt/gapi"
|
"github.com/purpleidea/mgmt/gapi"
|
||||||
"github.com/purpleidea/mgmt/lang"
|
"github.com/purpleidea/mgmt/lang"
|
||||||
|
"github.com/purpleidea/mgmt/lang/download"
|
||||||
"github.com/purpleidea/mgmt/lang/funcs/vars"
|
"github.com/purpleidea/mgmt/lang/funcs/vars"
|
||||||
"github.com/purpleidea/mgmt/lang/inputs"
|
"github.com/purpleidea/mgmt/lang/inputs"
|
||||||
"github.com/purpleidea/mgmt/lang/interfaces"
|
"github.com/purpleidea/mgmt/lang/interfaces"
|
||||||
@@ -215,7 +216,7 @@ func (obj *GAPI) Cli(cliInfo *gapi.CliInfo) (*gapi.Deploy, error) {
|
|||||||
},
|
},
|
||||||
}
|
}
|
||||||
// this fulfills the interfaces.Downloader interface
|
// this fulfills the interfaces.Downloader interface
|
||||||
downloader = &lang.Downloader{
|
downloader = &download.Downloader{
|
||||||
Depth: c.Int("depth"), // default of infinite is -1
|
Depth: c.Int("depth"), // default of infinite is -1
|
||||||
Retry: c.Int("retry"), // infinite is -1
|
Retry: c.Int("retry"), // infinite is -1
|
||||||
}
|
}
|
||||||
@@ -686,7 +687,7 @@ func (obj *GAPI) Get(getInfo *gapi.GetInfo) error {
|
|||||||
},
|
},
|
||||||
}
|
}
|
||||||
// this fulfills the interfaces.Downloader interface
|
// this fulfills the interfaces.Downloader interface
|
||||||
downloader := &lang.Downloader{
|
downloader := &download.Downloader{
|
||||||
Depth: c.Int("depth"), // default of infinite is -1
|
Depth: c.Int("depth"), // default of infinite is -1
|
||||||
Retry: c.Int("retry"), // infinite is -1
|
Retry: c.Int("retry"), // infinite is -1
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user