downloader

package
v1.4.0 Latest Latest
Warning

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

Go to latest
Published: Sep 5, 2023 License: Apache-2.0 Imports: 15 Imported by: 0

Documentation

Index

Constants

View Source
const (
	ManifestFilename = "manifest.json"
	ImageFilename    = "images.tar.gz"
	ConfigFilename   = "configs.tar.gz"
	BaseDstDir       = "/tmp/kc-downloader"

	ChartFilename = "charts.tgz"
)

Variables

View Source
var (
	CloudStaticServer = "https://oss.kubeclipper.io/packages"
)

Functions

func SetOptions

func SetOptions(op *Options)

SetOptions set downloader options

Types

type Downloader

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

func NewInstance

func NewInstance(ctx context.Context, name, version, arch string, online, dryRun bool) (*Downloader, error)

func (*Downloader) Download

func (dl *Downloader) Download(fileList ...string) (err error)

Download file list

func (*Downloader) DownloadAll

func (dl *Downloader) DownloadAll() (cPath, iPath string, err error)

DownloadAll download config and image file

func (*Downloader) DownloadAndUnpackConfigs

func (dl *Downloader) DownloadAndUnpackConfigs() (string, error)

DownloadAndUnpackConfigs download and unpack config file

func (*Downloader) DownloadCharts added in v1.4.0

func (dl *Downloader) DownloadCharts() (string, error)

DownloadCharts download chart file

func (*Downloader) DownloadConfigs

func (dl *Downloader) DownloadConfigs() (string, error)

DownloadConfigs download config file

func (*Downloader) DownloadCustomImages added in v1.3.1

func (dl *Downloader) DownloadCustomImages(imageList ...string) (files []string, err error)

DownloadCustomImages download custom image file

func (*Downloader) DownloadFile

func (dl *Downloader) DownloadFile(dstDir, filename string) (err error)

DownloadFile download the file to the specified directory

func (*Downloader) DownloadImages

func (dl *Downloader) DownloadImages() (string, error)

DownloadImages download image file

func (*Downloader) GetChartDownloadPath added in v1.4.0

func (dl *Downloader) GetChartDownloadPath() string

func (*Downloader) RemoveAll

func (dl *Downloader) RemoveAll() error

RemoveAll remove config and image file

func (*Downloader) RemoveCharts added in v1.4.0

func (dl *Downloader) RemoveCharts() error

RemoveCharts remove chart file

func (*Downloader) RemoveConfigs

func (dl *Downloader) RemoveConfigs() error

RemoveConfigs remove config file

func (*Downloader) RemoveCustomImages added in v1.3.1

func (dl *Downloader) RemoveCustomImages(imageList ...string) (err error)

RemoveCustomImages remove custom image file

func (*Downloader) RemoveImages

func (dl *Downloader) RemoveImages() error

RemoveImages remove image file

type ManifestElement

type ManifestElement struct {
	Name   string `json:"name"`
	Digest string `json:"digest"`
	Path   string `json:"path"`
}

type Options

type Options struct {
	Address       string `json:"address" yaml:"address"`
	TLSCertFile   string `json:"tlsCertFile" yaml:"tlsCertFile"`
	TLSPrivateKey string `json:"tlsPrivateKey" yaml:"tlsPrivateKey"`
}

func NewOptions

func NewOptions() *Options

Jump to

Keyboard shortcuts

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