store

package
v0.0.0-...-f34f428 Latest Latest
Warning

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

Go to latest
Published: Apr 16, 2021 License: Apache-2.0 Imports: 8 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func InitRepositoryProvider

func InitRepositoryProvider(databaseProvider string)

InitRepositoryProvider - One time init for the given DB Provider

Types

type ChartStore

type ChartStore interface {
	// This will add or update the given chart
	Save(chart ChartStoreRecord, batchID string) error

	// Delete chart versions for a given batch
	DeleteBatch(endpoint, chart, batchID string) error

	// Delete all charts for the given endpoint
	DeleteForEndpoint(endpoint string) error

	// RenameEndpoint renames an endpoint (==renames helm repository)
	RenameEndpoint(endpointID, name string) error

	// GetLatestCharts gets all of the latest charts
	GetLatestCharts() ([]*ChartStoreRecord, error)

	// Version is optional - empty means get latest
	GetChart(repo, name, version string) (*ChartStoreRecord, error)

	// Get Chart Versions
	GetChartVersions(repo, name string) ([]*ChartStoreRecord, error)

	// Get Endopoint IDs stored in the chart store
	GetEndpointIDs() ([]string, error)
}

ChartStore is the Helm Chart Store repository

func NewHelmChartDBStore

func NewHelmChartDBStore(dcp *sql.DB) (ChartStore, error)

NewHelmChartDBStore will create a new instance of the AnalysisDBStore

type ChartStoreRecord

type ChartStoreRecord struct {
	EndpointID  string          `json:"endpoint"`
	Name        string          `json:"name"`
	Repository  string          `json:"repo_name"`
	Version     string          `json:"version"`
	AppVersion  string          `json:"app_version"`
	Description string          `json:"description"`
	IconURL     string          `json:"icon_url"`
	ChartURL    string          `json:"chart_url"`
	Sources     []string        `json:"sources"`
	Created     time.Time       `json:"created"`
	Digest      string          `json:"digest"`
	IsLatest    bool            `json:"is_latest"`
	SemVer      SemanticVersion `json:"-"`
}

ChartStoreRecord represents a Helm Chart Version record

type ChartStoreRecordList

type ChartStoreRecordList []*ChartStoreRecord

func (ChartStoreRecordList) Len

func (r ChartStoreRecordList) Len() int

func (ChartStoreRecordList) Less

func (r ChartStoreRecordList) Less(i, j int) bool

func (ChartStoreRecordList) Swap

func (r ChartStoreRecordList) Swap(i, j int)

type HelmChartDBStore

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

HelmChartDBStore is a DB-backed Helm Chart repository

func (*HelmChartDBStore) DeleteBatch

func (p *HelmChartDBStore) DeleteBatch(endpointID, chart, batchID string) error

DeleteBatch will remove all chart versions not with the given batch id

func (*HelmChartDBStore) DeleteForEndpoint

func (p *HelmChartDBStore) DeleteForEndpoint(endpointID string) error

DeleteForEndpoint will remove all Helm Charts for a given endpoint guid

func (*HelmChartDBStore) GetChart

func (p *HelmChartDBStore) GetChart(repo, name, version string) (*ChartStoreRecord, error)

GetChart gets a single helm chart

func (*HelmChartDBStore) GetChartVersions

func (p *HelmChartDBStore) GetChartVersions(repo, name string) ([]*ChartStoreRecord, error)

GetChartVersions will get all of the versions for a given chart

func (*HelmChartDBStore) GetEndpointIDs

func (p *HelmChartDBStore) GetEndpointIDs() ([]string, error)

GetEndpointIDs will get all unique endpoint IDs from the database

func (*HelmChartDBStore) GetLatestCharts

func (p *HelmChartDBStore) GetLatestCharts() ([]*ChartStoreRecord, error)

GetLatestCharts will get only the info for the latest version of each chart

func (*HelmChartDBStore) RenameEndpoint

func (p *HelmChartDBStore) RenameEndpoint(endpointID, name string) error

RenameEndpoint will update all charts for a given endpoint to have the new repository name

func (*HelmChartDBStore) Save

func (p *HelmChartDBStore) Save(chart ChartStoreRecord, batchID string) error

Save a Helm Chart to the database

type SemanticVersion

type SemanticVersion struct {
	Version *semver.Version
	Text    string
	Valid   bool
}

func NewSemanticVersion

func NewSemanticVersion(version string) SemanticVersion

NewSemanticVersion parses and returns a Semantic Version

func (*SemanticVersion) LessThan

func (s *SemanticVersion) LessThan(d *SemanticVersion) bool

func (*SemanticVersion) LessThanReleaseVersions

func (s *SemanticVersion) LessThanReleaseVersions(d *SemanticVersion) bool

Jump to

Keyboard shortcuts

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