repo

package
v0.20.3 Latest Latest
Warning

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

Go to latest
Published: Nov 15, 2023 License: Apache-2.0 Imports: 13 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var NewClientTester = func(t *testing.T, repo *api.Repo, emptyIndex bool, indexFile string) ClientTester {
	switch repo.Kind {
	case api.Kind_CHARTMUSEUM:
		return chartmuseum.NewTester(t, repo, emptyIndex, indexFile)
	default:
		t.Errorf("unsupported repo kind %q", repo.Kind)
		return nil
	}
}

NewClientTester returns a fake repo for testing purposes

The func is exposed as a var to allow tests to temporarily replace its implementation, e.g. to return a fake.

Functions

func NewClient

func NewClient(repo *api.Repo, opts ...types.Option) (client.ChartsReaderWriter, error)

NewClient returns a Client object

Types

type ClientTester

type ClientTester interface {
	ServeHTTP(w http.ResponseWriter, r *http.Request)
	GetChart(w http.ResponseWriter, r *http.Request, chart string)
	GetIndex(w http.ResponseWriter, r *http.Request, emptyIndex bool, indexFile string)
	GetChartPackage(w http.ResponseWriter, r *http.Request, chartPackageName string)
	PostChart(w http.ResponseWriter, r *http.Request)
	GetURL() string
}

ClientTester defines the methods that a fake tester should implement

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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