Documentation ¶
Index ¶
- func GetBundleKey(repoName string, bundle *api.Bundle) string
- func GetGVKKey(gvk *api.GroupVersionKind, bundleID string) string
- func GetPackageKey(repoName, pkg string) string
- type BoltDBTable
- func (b *BoltDBTable[E]) Create() error
- func (b *BoltDBTable[E]) Delete() error
- func (b *BoltDBTable[E]) DeleteEntriesWithPrefix(prefix string) error
- func (b *BoltDBTable[E]) DeleteEntriesWithPrefixInTransaction(tx *bolt.Tx, prefix string) error
- func (b *BoltDBTable[E]) DeleteEntryWithKey(key string) error
- func (b *BoltDBTable[E]) DeleteEntryWithKeyInTransaction(tx *bolt.Tx, key string) error
- func (b *BoltDBTable[E]) Get(key string) (*E, error)
- func (b *BoltDBTable[E]) Has(key string) (bool, error)
- func (b *BoltDBTable[E]) Insert(entry *E) error
- func (b *BoltDBTable[E]) InsertInTransaction(tx *bolt.Tx, entry *E) error
- func (b *BoltDBTable[E]) Iterate(fn IterationFunction[E]) error
- func (b *BoltDBTable[E]) List() ([]E, error)
- func (b *BoltDBTable[E]) Search(fn FilterFunction[E]) ([]E, error)
- func (b *BoltDBTable[E]) Seek(prefix string) ([]E, error)
- type CachedBundle
- type CachedGVKBundle
- type CachedPackage
- type CachedRepository
- type FilterFunction
- type IdentifiableEntry
- type IterationFunction
- type PackageDatabase
- type PackageSearchOption
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func GetPackageKey ¶
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]) 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
Click to show internal directories.
Click to hide internal directories.