helm

package
v1.24.5 Latest Latest
Warning

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

Go to latest
Published: Apr 28, 2024 License: Apache-2.0 Imports: 18 Imported by: 0

Documentation

Index

Constants

View Source
const MaxSyncVerionCount = 3

MaxSyncVerionCount 最大同步版本,仅同步某个chart的最近的 n 个版本

Variables

View Source
var ErrSynchronizing = errors.New("synchronizing")

Functions

func SyncChartsToChartmuseum

func SyncChartsToChartmuseum(ctx context.Context, remote RepositoryConfig, localChartMuseum RepositoryConfig) error

func SyncChartsToChartmuseumWithProcess

func SyncChartsToChartmuseumWithProcess(ctx context.Context, remote RepositoryConfig, localChartMuseum RepositoryConfig, onProcess func(ProcessEvent)) error

Types

type Auth

type Auth func(req *http.Request)

func BasicAuth

func BasicAuth(username, password string) Auth

func TokenAuth

func TokenAuth(token string) Auth

type ChartmuseumClient

type ChartmuseumClient struct {
	*CommonClient
	// contains filtered or unexported fields
}

func MustNewChartMuseumClient

func MustNewChartMuseumClient(cfg *RepositoryConfig) *ChartmuseumClient

func NewChartMuseumClient

func NewChartMuseumClient(cfg *RepositoryConfig) (*ChartmuseumClient, error)

func (*ChartmuseumClient) GetChartBufferedFiles

func (c *ChartmuseumClient) GetChartBufferedFiles(ctx context.Context, repo, name, version string) ([]*loader.BufferedFile, error)

func (*ChartmuseumClient) GetChartFile

func (c *ChartmuseumClient) GetChartFile(ctx context.Context, repo, filename string) ([]byte, error)

func (*ChartmuseumClient) GetChartVersion

func (c *ChartmuseumClient) GetChartVersion(ctx context.Context, repo, name, version string) (*helm_repo.ChartVersion, error)

func (*ChartmuseumClient) GetIndex

func (c *ChartmuseumClient) GetIndex(ctx context.Context, repo string) (*helm_repo.IndexFile, error)

func (*ChartmuseumClient) HeadChartVersion

func (c *ChartmuseumClient) HeadChartVersion(ctx context.Context, repo, name, version string) error

func (*ChartmuseumClient) Health

func (c *ChartmuseumClient) Health(ctx context.Context) error

func (*ChartmuseumClient) ListAllChartVersions

func (c *ChartmuseumClient) ListAllChartVersions(ctx context.Context, repo string) (map[string]helm_repo.ChartVersions, error)

func (*ChartmuseumClient) ListChartVersions

func (c *ChartmuseumClient) ListChartVersions(ctx context.Context, repo string, name string) (*helm_repo.ChartVersions, error)

func (*ChartmuseumClient) NewLegencyRepositoryClientFrom

func (c *ChartmuseumClient) NewLegencyRepositoryClientFrom(ctx context.Context, repo string) (*LegencyRepository, error)

func (*ChartmuseumClient) UploadChart

func (c *ChartmuseumClient) UploadChart(ctx context.Context, repo string, chartContent io.Reader) error

type CommonClient

type CommonClient struct {
	Client *http.Client
	Server string
	Auth   Auth
}

type ErrorResponse

type ErrorResponse struct {
	ErrorMsg string `json:"error,omitempty"`
}

func (ErrorResponse) Error

func (e ErrorResponse) Error() string

type Errors

type Errors []error

func (Errors) Error

func (errs Errors) Error() string

type Goconcurrent

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

func NewGoconcurrent

func NewGoconcurrent(concurrent int) *Goconcurrent

func (*Goconcurrent) Go

func (g *Goconcurrent) Go(f func())

type LegencyRepository

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

func NewLegencyRepository

func NewLegencyRepository(cfg *RepositoryConfig) (*LegencyRepository, error)

func (*LegencyRepository) GetFile

func (r *LegencyRepository) GetFile(ctx context.Context, url string) (io.ReadCloser, error)

GetChart 如果 version 为空,则使用最新版本

type Options

type Options struct {
	Addr string `json:"addr,omitempty" description:"chart repository url"`
}

func NewDefaultOptions

func NewDefaultOptions() *Options

type ProcessEvent

type ProcessEvent struct {
	Chart   *repo.ChartVersion
	Error   error
	Message string
}

type RepositoryConfig

type RepositoryConfig struct {
	Name          string `json:"name,omitempty"`
	URL           string `json:"url,omitempty"`
	Username      string `json:"username,omitempty"`
	Password      string `json:"password,omitempty"`
	Cert          []byte `json:"cert,omitempty"`
	Key           []byte `json:"key,omitempty"`
	CA            []byte `json:"ca,omitempty"`
	SkipTLSVerify bool   `json:"skipTLSVerify,omitempty"`
}

Jump to

Keyboard shortcuts

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