repo

package
v1.2.3 Latest Latest
Warning

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

Go to latest
Published: Sep 29, 2022 License: MIT Imports: 16 Imported by: 0

Documentation

Index

Constants

View Source
const APIVersionV1 = "v1"

Variables

View Source
var (
	ErrNoAPIVersion   = errors.New("no API version specified")
	ErrNoChartVersion = errors.New("no chart version found")
	ErrNoChartName    = errors.New("no chart name found")
	ErrEmptyIndexYaml = errors.New("empty index.yaml file")
)

Functions

This section is empty.

Types

type ChartRepository

type ChartRepository struct {
	Config     *Entry
	ChartPaths []string
	Client     getter.Getter
	IndexFile  *IndexFile
	CachePath  string
}

func NewChartRepository

func NewChartRepository(cfg *Entry, getters getter.Providers) (*ChartRepository, error)

func (*ChartRepository) DownloadIndexFile

func (r *ChartRepository) DownloadIndexFile() (string, error)

type ChartVersion

type ChartVersion struct {
	*chart.Metadata
	URLs                    []string  `json:"urls"`
	Created                 time.Time `json:"created,omitempty"`
	Removed                 bool      `json:"removed,omitempty"`
	Digest                  string    `json:"digest,omitempty"`
	ChecksumDeprecated      string    `json:"checksum,omitempty"`
	EngineDeprecated        string    `json:"engine,omitempty"`
	TillerVersionDeprecated string    `json:"tillerVersion,omitempty"`
	URLDeprecated           string    `json:"url,omitempty"`
}

type ChartVersions

type ChartVersions []*ChartVersion

func (ChartVersions) Len

func (c ChartVersions) Len() int

func (ChartVersions) Less

func (c ChartVersions) Less(a, b int) bool

func (ChartVersions) Swap

func (c ChartVersions) Swap(i, j int)

type Entry

type Entry struct {
	Name                  string `json:"name"`
	URL                   string `json:"url"`
	Username              string `json:"username"`
	Password              string `json:"password"`
	CertFile              string `json:"certFile"`
	KeyFile               string `json:"keyFile"`
	CAFile                string `json:"caFile"`
	InsecureSkipTLSverify bool   `json:"insecure_skip_tls_verify"`
	PassCredentialsAll    bool   `json:"pass_credentials_all"`
}

Entry represents a collection of parameters for chart repository

type File

type File struct {
	APIVersion   string    `json:"apiVersion"`
	Generated    time.Time `json:"generated"`
	Repositories []*Entry  `json:"repositories"`
}

File represents the repositories.yaml file

func LoadFile

func LoadFile(path string) (*File, error)

LoadFile takes a file at the given path and returns a File object

func NewFile

func NewFile() *File

NewFile generates an empty repositories file.

Generated and APIVersion are automatically set.

func (*File) Add

func (r *File) Add(re ...*Entry)

Add adds one or more repo entries to a repo file.

func (*File) Get

func (r *File) Get(name string) *Entry

Get returns an entry with the given name if it exists, otherwise returns nil

func (*File) Has

func (r *File) Has(name string) bool

Has returns true if the given name is already a repository name.

func (*File) Remove

func (r *File) Remove(name string) bool

Remove removes the entry from the list of repositories.

func (*File) Update

func (r *File) Update(re ...*Entry)

Update attempts to replace one or more repo entries in a repo file. If an entry with the same name doesn't exist in the repo file it will add it.

func (*File) WriteFile

func (r *File) WriteFile(path string, perm os.FileMode) error

WriteFile writes a repositories file to the given path.

type IndexFile

type IndexFile struct {
	ServerInfo  map[string]interface{}   `json:"serverInfo,omitempty"`
	APIVersion  string                   `json:"apiVersion"`
	Generated   time.Time                `json:"generated"`
	Entries     map[string]ChartVersions `json:"entries"`
	PublicKeys  []string                 `json:"publicKeys,omitempty"`
	Annotations map[string]string        `json:"annotations,omitempty"`
}

func LoadIndexFile

func LoadIndexFile(path string) (*IndexFile, error)

func NewIndexFile

func NewIndexFile() *IndexFile

func (IndexFile) Get

func (i IndexFile) Get(name, version string) (*ChartVersion, error)

func (IndexFile) SortEntries

func (i IndexFile) SortEntries()

Jump to

Keyboard shortcuts

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