Documentation ¶
Index ¶
- func FormatHub(hub string) string
- func List(lister Lister, all bool, format constants.Format) error
- func SetRemoteFunc(f NewRemoteFunc)
- type Catalog
- type Config
- type DownloadRequest
- type DownloadResult
- type HubLister
- type ListItem
- type ListItems
- type Lister
- type NewRemoteFunc
- type SearchRequest
- type SearchResult
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func List ¶
List uses the provided lister to obtain a list of application and cluster images and displays them in the specified format.
func SetRemoteFunc ¶
func SetRemoteFunc(f NewRemoteFunc)
SetRemoteFunc sets the function that creates remote application catalog.
This allows external implementations to override the default behavior of returning default distribution portal.
Types ¶
type Catalog ¶
type Catalog interface { // Search searches the application catalog. // // The provided pattern is treated as an application name substring. If // the pattern is empty, all applications are returned. Search(pattern string) ([]app.Application, error) // Download downloads an application from the catalog. Download(name, version string) (io.ReadCloser, error) // GetName returns the catalog name. GetName() string }
Catalog defines an interface for an application catalog.
func NewRemoteFor ¶
NewRemoteFor returns client for the specified application catalog.
type Config ¶
type Config struct { // Name is the catalog name. Name string // Operator is the cluster or Ops Center operator. Operator ops.Operator // Apps is the cluster or Ops Center application service. Apps app.Applications }
Config is the application catalog configuration.
type DownloadRequest ¶
type DownloadRequest struct { // Application specifies application to download. Application loc.Locator }
DownloadRequest describes a request to download an application tarball.
type DownloadResult ¶
type DownloadResult struct { // Path is the path to the downloaded tarball. Path string }
DownloadResult is an application download result.
func Download ¶
func Download(req DownloadRequest) (*DownloadResult, error)
Download downloads the specified application and returns its path.
func (*DownloadResult) Close ¶
func (r *DownloadResult) Close() error
Close removes the downloaded tarball.
Implements io.Closer.
type HubLister ¶
type HubLister struct {
// contains filtered or unexported fields
}
HubLister lists applications on the hub
type ListItem ¶
type ListItem interface { // GetName returns the image name. GetName() string // GetVersion returns the image version. GetVersion() semver.Version // GetType returns the image type (application or cluster). GetType() string // GetCreated returns the image creation time. GetCreated() time.Time // GetDescription returns the image description. GetDescription() string }
ListItem defines interface for a single list item.
func NewListItemFromApp ¶
func NewListItemFromApp(app app.Application) (ListItem, error)
NewListItemFromApp makes a list item from the app service application.
type ListItems ¶
type ListItems []ListItem
ListItems is a collection of application and cluster images.
func (ListItems) Latest ¶
Latest returns a list of items containing latest stable versions of application and cluster images from this list.
type Lister ¶
type Lister interface { // List retrieves application and cluster images. List(all bool) (ListItems, error) // Hub returns the name of the Hub this lister talks to. Hub() string }
Lister defines common interface for listing application and cluster images.
type NewRemoteFunc ¶
NewRemoteFunc defines a function that returns a new instance of a remote catalog.
type SearchRequest ¶
type SearchRequest struct { // Pattern is an optional application name pattern (a substring). Pattern string // Local is whether to search local cluster catalog. Local bool // Remote is whether to search remote Ops Center catalog. Remote bool }
SearchRequest describes an application search request.
type SearchResult ¶
type SearchResult struct { // Apps maps the catalog name (such as 'get.gravitational.io' or local // cluster name) to a list of applications found in it. Apps map[string][]app.Application }
SearchResult is an application search result.
func Search ¶
func Search(req SearchRequest) (*SearchResult, error)
Search searches local and/or remote catalogs for the specified application.