store

package
v1.0.0 Latest Latest
Warning

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

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

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Merged

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

Merged is a store that merges the results of multiple stores together.

If a plugin is present in multiple stores, the later version is preferred. If a plugin with the same version is present in multiple stores, the one from the later store (as initialized) is preferred.

func NewMerged

func NewMerged(logger logrus.FieldLogger, stores ...Store) *Merged

NewMerged creates a new instance of the merged store.

func (*Merged) GetPlugins

func (store *Merged) GetPlugins(pluginFilter *model.PluginFilter) ([]*model.Plugin, error)

GetPlugins fetches the given page of plugins. The first page is 0.

type Proxy

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

Proxy is a store that fetches its result from some remote marketplace server.

func NewProxy

func NewProxy(marketplaceURL string, logger logrus.FieldLogger) (*Proxy, error)

NewProxy creates a new instance of a proxy store.

func (*Proxy) GetPlugins

func (store *Proxy) GetPlugins(pluginFilter *model.PluginFilter) ([]*model.Plugin, error)

GetPlugins fetches the given page of plugins. The first page is 0.

type StaticStore

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

StaticStore provides access to a store backed by a static set of plugins.

func NewStatic

func NewStatic(plugins []*model.Plugin, logger logrus.FieldLogger) (*StaticStore, error)

NewStatic constructs a new instance of a static store using the given plugins.

func NewStaticFromReader

func NewStaticFromReader(reader io.Reader, logger logrus.FieldLogger) (*StaticStore, error)

NewStatic constructs a new instance of a static store, parsing the plugins from the given reader.

func (*StaticStore) GetPlugins

func (store *StaticStore) GetPlugins(pluginFilter *model.PluginFilter) ([]*model.Plugin, error)

GetPlugins fetches the given page of plugins. The first page is 0.

type Store

type Store interface {
	GetPlugins(filter *model.PluginFilter) ([]*model.Plugin, error)
}

Store describes the interface to the backing store.

Jump to

Keyboard shortcuts

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