helm

package
v0.6.0 Latest Latest
Warning

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

Go to latest
Published: Sep 23, 2020 License: Apache-2.0 Imports: 24 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func NewTracker

func NewTracker(
	svc *tracker.Services,
	r *hub.Repository,
	opts ...func(t tracker.Tracker),
) tracker.Tracker

NewTracker creates a new Tracker instance.

func WithIndexLoader

func WithIndexLoader(il hub.HelmIndexLoader) func(t tracker.Tracker)

WithIndexLoader allows providing a specific Helm repository index loader for a Tracker instance.

func WithNumWorkers

func WithNumWorkers(n int) func(t tracker.Tracker)

WithNumWorkers allows providing a specific number of workers for a Tracker instance.

Types

type Job

type Job struct {
	Kind         JobKind
	ChartVersion *helmrepo.ChartVersion
}

Job represents a job for registering or unregistering a Helm package version available in the provided Helm repository. Jobs are created by the dispatcher and will eventually be handled by a worker.

type JobKind

type JobKind int

JobKind represents the kind of a job, which can be register or unregister.

const (
	// Register represents a job to Register a Helm package version.
	Register JobKind = iota

	// Unregister represents a job to Unregister a Helm package version.
	Unregister
)

type Tracker

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

Tracker is in charge of tracking the packages available in a Helm repository, registering and unregistering them as needed.

func (*Tracker) Track

func (t *Tracker) Track(wg *sync.WaitGroup) error

Track registers or unregisters the Helm packages available in the repository provided as needed. It is in charge of generating jobs to register or unregister Helm packages and dispatching them among the available workers.

type Worker

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

Worker is in charge of handling Helm packages register and unregister jobs generated by the tracker.

func NewWorker

func NewWorker(
	svc *tracker.Services,
	r *hub.Repository,
) *Worker

NewWorker creates a new worker instance.

func (*Worker) Run

func (w *Worker) Run(wg *sync.WaitGroup, queue chan *Job)

Run instructs the worker to start handling jobs. It will keep running until the jobs queue is empty or the context is done.

Jump to

Keyboard shortcuts

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