repo

package
v0.10.9 Latest Latest
Warning

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

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

Documentation

Index

Constants

View Source
const (
	RepoIndexRefreshPeriod = 10 * time.Second
	RepoFetchIndexTimeout  = 4 * time.Second
)

Variables

View Source
var ErrFetchNoResponseYet = errors.New("no response from chart repo yet")

Functions

func DefaultRemoteFetcher

func DefaultRemoteFetcher(url string) ([]byte, error)

func NewFilesystemCache

func NewFilesystemCache(dir string, limit int) (*fsCache, error)

Types

type Cache

type Cache interface {
	// Fetch must return a error which satisfies os.IsNotExist()
	// is given name do not exist in the cache
	Fetch(name string) ([]byte, error)
	Store(name string, data []byte) error
	Clean() error
}

type CacheFactory

type CacheFactory func(name string) (Cache, error)

func DefaultFileCacheFactory

func DefaultFileCacheFactory(cacheDir string) CacheFactory

type Catalog

type Catalog struct {
	sync.Mutex
	// contains filtered or unexported fields
}

func NewCatalog

func NewCatalog(factory CacheFactory, fetcher RemoteFetcher, stopCh <-chan struct{}) *Catalog

func (*Catalog) CreateRepoIfNotExist

func (c *Catalog) CreateRepoIfNotExist(repoURL string) (*Repo, error)

type ChartFetcher

type ChartFetcher func(*shipper.Chart) (*helmchart.Chart, error)

func FetchChartFunc

func FetchChartFunc(c *Catalog) ChartFetcher

type ChartVersionResolver

type ChartVersionResolver func(*shipper.Chart) (*repo.ChartVersion, error)

func ResolveChartVersionFunc

func ResolveChartVersionFunc(c *Catalog) ChartVersionResolver

type RemoteFetcher

type RemoteFetcher func(url string) ([]byte, error)

type Repo

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

func NewRepo

func NewRepo(repoURL string, cache Cache, fetcher RemoteFetcher) (*Repo, error)

func (*Repo) Fetch

func (r *Repo) Fetch(chartspec *shipper.Chart) (*chart.Chart, error)

func (*Repo) FetchChartVersions

func (r *Repo) FetchChartVersions(chartspec *shipper.Chart) (repo.ChartVersions, error)

func (*Repo) FetchRemote

func (r *Repo) FetchRemote(cv *repo.ChartVersion) (*chart.Chart, error)

func (*Repo) LoadCached

func (r *Repo) LoadCached(cv *repo.ChartVersion) (*chart.Chart, error)

func (*Repo) ResolveVersion

func (r *Repo) ResolveVersion(chartspec *shipper.Chart) (*repo.ChartVersion, error)

func (*Repo) Start

func (r *Repo) Start(stopCh <-chan struct{})

Jump to

Keyboard shortcuts

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