utils

package
v0.12.0 Latest Latest
Warning

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

Go to latest
Published: Dec 20, 2021 License: Apache-2.0 Imports: 17 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	// UnixEpoch is the number of seconds that have elapsed since January 1, 1970
	UnixEpoch = time.Unix(0, 0)
)

Functions

func ChartExistInIndex

func ChartExistInIndex(name string, version string, index *helmRepo.IndexFile) (bool, error)

ChartExistInIndex checks if a specific chart version is present in the index file.

func CopyFile added in v0.6.1

func CopyFile(destPath string, srcPath string) error

CopyFile copies a file from srcPath to destPath, ensuring the destPath directory exists.

func EncodeSha1

func EncodeSha1(s string) string

EncodeSha1 returns a SHA1 representation of the provided string

func FileExists

func FileExists(f string) (bool, error)

FileExists will test if a file exists

func FindChartURL

func FindChartURL(name string, version string, index *helmRepo.IndexFile, sourceURL string) (string, error)

FindChartURL will return the chart url

func GetDateThreshold

func GetDateThreshold(date string) (time.Time, error)

GetDateThreshold will parse a string date agains a fixed layout and return a time.Date value

func GetFileContentType

func GetFileContentType(filepath string) (string, error)

GetFileContentType returns the content type of a file.

func GetListenAddress added in v0.7.0

func GetListenAddress() (string, error)

GetListenAddress returns a free local direction

func HTTPResponseBody

func HTTPResponseBody(res *http.Response) string

HTTPResponseBody returns the body of an HTTP response

func LoadIndexFromRepo

func LoadIndexFromRepo(repo *api.Repo) (*helmRepo.IndexFile, error)

LoadIndexFromRepo get the index.yaml from a Helm repo and returns an index object

func NormalizeChartURL added in v0.7.0

func NormalizeChartURL(repoURL, chartURL string) (string, error)

NormalizeChartURL forms the full download URL in case we pass a relative URL

func Untar

func Untar(tarball, targetDir string) error

Untar extracts compressed archives

Types

This section is empty.

Jump to

Keyboard shortcuts

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