downloader

package
v0.0.0-...-8478a25 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Dec 5, 2024 License: BSD-2-Clause-Patent Imports: 18 Imported by: 0

Documentation

Overview

Copyright 2024 Harness Inc. All rights reserved. Use of this source code is governed by a BSD-style license that can be found in the LICENSE file.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ExpandCache

func ExpandCache(s string) string

ExpandCache returns the root directory where task downloads and repositories should be cached.

func ExpandCacheSlice

func ExpandCacheSlice(items []string) []string

ExpandCacheSlice returns the root directory where task downloads and repositories should be cached.

func IsRepository

func IsRepository(s string) bool

IsRepository returns true if the provided download url is a git repository.

func SplitRef

func SplitRef(s string) (string, string)

SplitRef splits the repository url and the commit ref.

Types

type Downloader

type Downloader struct {
	// contains filtered or unexported fields
}

func New

func New(cloner cloner.Cloner, dir string) Downloader

func (*Downloader) DownloadExecutable

func (d *Downloader) DownloadExecutable(ctx context.Context, taskType string, exec *task.ExecutableConfig) (string, error)

func (*Downloader) DownloadRepo

func (d *Downloader) DownloadRepo(ctx context.Context, repo *task.Repository) (string, error)

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL