store

package
v0.0.0-...-0cd719c Latest Latest
Warning

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

Go to latest
Published: Dec 16, 2022 License: Apache-2.0 Imports: 15 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func GetBundleKey

func GetBundleKey(repoName string, bundle *api.Bundle) string

func GetGVKKey

func GetGVKKey(gvk *api.GroupVersionKind, bundleID string) string

func GetPackageKey

func GetPackageKey(repoName, pkg string) string

Types

type BoltDBTable

type BoltDBTable[E IdentifiableEntry] struct {
	// contains filtered or unexported fields
}

func NewBoltDBTable

func NewBoltDBTable[E IdentifiableEntry](database *bolt.DB, tableName string) (*BoltDBTable[E], error)

func (*BoltDBTable[E]) Create

func (b *BoltDBTable[E]) Create() error

func (*BoltDBTable[E]) Delete

func (b *BoltDBTable[E]) Delete() error

func (*BoltDBTable[E]) DeleteEntriesWithPrefix

func (b *BoltDBTable[E]) DeleteEntriesWithPrefix(prefix string) error

func (*BoltDBTable[E]) DeleteEntriesWithPrefixInTransaction

func (b *BoltDBTable[E]) DeleteEntriesWithPrefixInTransaction(tx *bolt.Tx, prefix string) error

func (*BoltDBTable[E]) DeleteEntryWithKey

func (b *BoltDBTable[E]) DeleteEntryWithKey(key string) error

func (*BoltDBTable[E]) DeleteEntryWithKeyInTransaction

func (b *BoltDBTable[E]) DeleteEntryWithKeyInTransaction(tx *bolt.Tx, key string) error

func (*BoltDBTable[E]) Get

func (b *BoltDBTable[E]) Get(key string) (*E, error)

func (*BoltDBTable[E]) Has

func (b *BoltDBTable[E]) Has(key string) (bool, error)

func (*BoltDBTable[E]) Insert

func (b *BoltDBTable[E]) Insert(entry *E) error

func (*BoltDBTable[E]) InsertInTransaction

func (b *BoltDBTable[E]) InsertInTransaction(tx *bolt.Tx, entry *E) error

func (*BoltDBTable[E]) Iterate

func (b *BoltDBTable[E]) Iterate(fn IterationFunction[E]) error

func (*BoltDBTable[E]) List

func (b *BoltDBTable[E]) List() ([]E, error)

func (*BoltDBTable[E]) Search

func (b *BoltDBTable[E]) Search(fn FilterFunction[E]) ([]E, error)

func (*BoltDBTable[E]) Seek

func (b *BoltDBTable[E]) Seek(prefix string) ([]E, error)

type CachedBundle

type CachedBundle struct {
	*api.Bundle
	BundleID            string             `json:"id"`
	Repository          string             `json:"repository"`
	DefaultChannelName  string             `json:"defaultChannelName"`
	PackageDependencies []property.Package `json:"packageDependencies"`
}

func (CachedBundle) EntryID

func (c CachedBundle) EntryID() string

func (CachedBundle) ID

func (c CachedBundle) ID() v2.EntityID

type CachedGVKBundle

type CachedGVKBundle struct {
	CachedBundle
	GVKID string `json:"gvkId"`
	GVK   string `json:"gvk"`
}

func (CachedGVKBundle) EntryID

func (c CachedGVKBundle) EntryID() string

type CachedPackage

type CachedPackage struct {
	*api.Package
	PackageID  string `json:"id"`
	Repository string `json:"repository"`
}

func (CachedPackage) EntryID

func (c CachedPackage) EntryID() string

type CachedRepository

type CachedRepository struct {
	RepositoryName   string `json:"name"`
	RepositorySource string `json:"source"`
}

func (CachedRepository) EntryID

func (c CachedRepository) EntryID() string

type FilterFunction

type FilterFunction[E IdentifiableEntry] func(*E) (bool, error)

type IdentifiableEntry

type IdentifiableEntry interface {
	EntryID() string
}

type IterationFunction

type IterationFunction[E IdentifiableEntry] func(*E) error

type PackageDatabase

type PackageDatabase interface {
	HasRepository(ctx context.Context, repo string) (bool, error)
	ListRepositories(ctx context.Context) ([]CachedRepository, error)
	ListPackages(ctx context.Context) ([]CachedPackage, error)
	ListBundles(ctx context.Context) ([]CachedBundle, error)
	ListBundlesForGVK(ctx context.Context, group string, version string, kind string) ([]CachedBundle, error)
	ListGVKs(ctx context.Context) (map[string][]CachedBundle, error)
	SearchPackages(ctx context.Context, searchTerm string) ([]CachedPackage, error)
	SearchBundles(ctx context.Context, searchTerm string) ([]CachedBundle, error)
	CacheRepository(ctx context.Context, repository repository.Repository) error
	RemoveRepository(ctx context.Context, repoName string) error
	GetPackage(ctx context.Context, packageID string) (*CachedPackage, error)
	GetBundle(ctx context.Context, bundleID string) (*CachedBundle, error)
	IterateBundles(ctx context.Context, fn func(bundle *CachedBundle) error) error
	GetBundlesForPackage(ctx context.Context, packageName string, options ...PackageSearchOption) ([]CachedBundle, error)
	Close() error
}

func NewPackageDatabase

func NewPackageDatabase(databasePath string, logger *logrus.Logger) (PackageDatabase, error)

type PackageSearchOption

type PackageSearchOption func(config *packageSearchConfig)

func InChannel

func InChannel(channel string) PackageSearchOption

func InRepositories

func InRepositories(repositories ...string) PackageSearchOption

func InVersionRange

func InVersionRange(versionRange semver.Range) PackageSearchOption

Jump to

Keyboard shortcuts

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