cache

package
v0.90.16 Latest Latest
Warning

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

Go to latest
Published: Sep 26, 2024 License: Apache-2.0 Imports: 17 Imported by: 0

Documentation

Index

Constants

View Source
const (
	// InstallerApplicationName is to use as application name by installer.
	InstallerApplicationName = "openshift-installer"
	// AgentApplicationName is to use as application name used by agent.
	AgentApplicationName = "agent"
	// ImageDataType is used by installer.
	ImageDataType = "image"
	// FilesDataType is used by agent.
	FilesDataType = "files"
)

Variables

This section is empty.

Functions

func DownloadImageFile

func DownloadImageFile(baseURL string, applicationName string) (string, error)

DownloadImageFile is a helper function that obtains an image file from a given URL, puts it in the cache and returns the local file path. If the file is compressed by a known compressor, the file is uncompressed prior to being returned.

func DownloadImageFileWithSha added in v0.90.0

func DownloadImageFileWithSha(baseURL string, applicationName string, sha256Checksum string) (string, error)

DownloadImageFileWithSha sets the sha256Checksum which is checked on download.

func GetCacheDir

func GetCacheDir(dataType, applicationName string) (string, error)

GetCacheDir returns a local path of the cache, where the installer should put the data: <user_cache_dir>/agent/<dataType>_cache If the directory doesn't exist, it will be automatically created.

func GetFileFromCache

func GetFileFromCache(fileName string, cacheDir string) (string, error)

GetFileFromCache returns path of the cached file if found, otherwise returns an empty string or error.

Types

This section is empty.

Jump to

Keyboard shortcuts

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