lang: Split the download code out into its own package

More cleanups.
This commit is contained in:
James Shubin
2021-10-21 00:05:37 -04:00
parent 5ac2447b85
commit 1796d20399
2 changed files with 4 additions and 3 deletions

View File

@@ -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"

View File

@@ -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
} }