util

package
v0.1.5 Latest Latest
Warning

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

Go to latest
Published: Jun 5, 2021 License: Apache-2.0 Imports: 21 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func MakeRelFsOnDisk

func MakeRelFsOnDisk(basePath string) filesys.FileSystem

MakeFsOnDisk makes an instance of relFsOnDisk.

func NewKustomizationFile

func NewKustomizationFile(fSys filesys.FileSystem) (*kustomizationFile, error)

NewKustomizationFile returns a new instance.

func StringInSlice

func StringInSlice(str string, list []string) bool

StringInSlice returns true if the string is in the slice.

func Unzip

func Unzip(src []byte, path string) (filenames []string, err error)

based on https://golangcode.com/unzip-files-in-go/ Code shown Licenced under MIT Licence

Types

type CachedDownloader

type CachedDownloader struct{}

func (CachedDownloader) Download

func (c CachedDownloader) Download(url string) (resp *http.Response, err error)

type CliJSON

type CliJSON struct {
	Catalog   map[string]Entry `json:"catalog"`
	Framework Entry            `json:"framework"`
	Cli       Entry            `json:"cli"`
}

func (*CliJSON) Load

func (cj *CliJSON) Load(d Downloader) (err error)

type Downloader

type Downloader interface {
	Download(url string) (resp *http.Response, err error)
}

type Entry

type Entry struct {
	Name     string    `json:"name"`
	Versions []Version `json:"versions"`
}

func (Entry) GetReleaseOrLatest

func (e Entry) GetReleaseOrLatest(r string) (v Version, err error)

type Version

type Version struct {
	Name     string            `json:"name"`
	Archive  string            `json:"archive,omitempty"`
	Archives map[string]string `json:"archives,omitempty"`
}

Jump to

Keyboard shortcuts

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