Documentation ¶
Index ¶
- type AddonClient
- type Client
- type ClientFactory
- type ClientModeDirGetter
- func (g *ClientModeDirGetter) AddonDocURL(name internal.AddonName, version internal.AddonVersion) (string, error)
- func (g *ClientModeDirGetter) AddonLoadInfo(name internal.AddonName, version internal.AddonVersion) (LoadType, string, error)
- func (g *ClientModeDirGetter) Cleanup() error
- func (g *ClientModeDirGetter) IndexReader() (io.ReadCloser, error)
- type ClientModeDirGetterCfg
- type GitGetterCreator
- type HTTPGetter
- func (h *HTTPGetter) AddonDocURL(name internal.AddonName, version internal.AddonVersion) (string, error)
- func (h *HTTPGetter) AddonLoadInfo(name internal.AddonName, version internal.AddonVersion) (LoadType, string, error)
- func (h *HTTPGetter) Cleanup() error
- func (h *HTTPGetter) IndexReader() (io.ReadCloser, error)
- type HgGetterCreator
- type LoadType
- type Provider
- type RepositoryGetter
- type S3GetterCreator
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type AddonClient ¶
type AddonClient interface { Cleanup() error GetCompleteAddon(entry internal.IndexEntry) (internal.AddonWithCharts, error) GetIndex() (*internal.Index, error) }
AddonClient defines abstraction to get and unmarshal raw index and addon into Models
type Client ¶
type Client struct {
// contains filtered or unexported fields
}
Client wraps the concrete getters and provide common functionality for converting the raw addon into models.
func NewClient ¶
func NewClient(concreteGetter RepositoryGetter, addonLoader addonLoader, documentationEnabled bool, log logrus.FieldLogger) (*Client, error)
NewClient returns new instance of Client
func (*Client) GetCompleteAddon ¶
func (d *Client) GetCompleteAddon(entry internal.IndexEntry) (internal.AddonWithCharts, error)
GetCompleteAddon returns a addon with his charts as AddonWithCharts instance.
type ClientFactory ¶
type ClientFactory struct {
// contains filtered or unexported fields
}
ClientFactory knows how to build the concrete RepositoryGetter for given addon repository URL.
func NewClientFactory ¶
func NewClientFactory(allowedGetters map[string]Provider, addonLoader addonLoader, documentationEnabled bool, log logrus.FieldLogger) (*ClientFactory, error)
NewClientFactory returns new instance of the ClientFactory
func (*ClientFactory) NewGetter ¶
func (cli *ClientFactory) NewGetter(rawURL, instPath string) (AddonClient, error)
NewGetter decodes and returns new concrete RepositoryGetter for given type of the repository URL.
type ClientModeDirGetter ¶
type ClientModeDirGetter struct {
// contains filtered or unexported fields
}
ClientModeDirGetter downloads a directory. In this mode, dst must be a directory path (doesn't have to exist). Src must point to an archive or directory (such as in s3).
func (*ClientModeDirGetter) AddonDocURL ¶
func (g *ClientModeDirGetter) AddonDocURL(name internal.AddonName, version internal.AddonVersion) (string, error)
AddonDocURL returns url for addon documentation
func (*ClientModeDirGetter) AddonLoadInfo ¶
func (g *ClientModeDirGetter) AddonLoadInfo(name internal.AddonName, version internal.AddonVersion) (LoadType, string, error)
AddonLoadInfo returns information how to load addon
func (*ClientModeDirGetter) Cleanup ¶
func (g *ClientModeDirGetter) Cleanup() error
Cleanup removes folder where repository was cloned.
func (*ClientModeDirGetter) IndexReader ¶
func (g *ClientModeDirGetter) IndexReader() (io.ReadCloser, error)
IndexReader returns index reader
type ClientModeDirGetterCfg ¶
type ClientModeDirGetterCfg struct { Cli rafter.Client TmpDir string Underlying getter.Getter Addr string Src string Protocol string }
ClientModeDirGetterCfg holds input parameters for ClientModeDirGetter constructor
type GitGetterCreator ¶
GitGetterCreator provides functionality for loading addon from any Git repository.
func (GitGetterCreator) NewGit ¶
func (g GitGetterCreator) NewGit(addr, src string) (RepositoryGetter, error)
NewGit returns new instance of RepositoryGetter with functionality for loading addon from any Git repository.
type HTTPGetter ¶
type HTTPGetter struct {
// contains filtered or unexported fields
}
HTTPGetter provides functionality for loading addon from any HTTP/HTTPS repository serving static files.
func (*HTTPGetter) AddonDocURL ¶
func (h *HTTPGetter) AddonDocURL(name internal.AddonName, version internal.AddonVersion) (string, error)
AddonDocURL returns url for addon documentation
func (*HTTPGetter) AddonLoadInfo ¶
func (h *HTTPGetter) AddonLoadInfo(name internal.AddonName, version internal.AddonVersion) (LoadType, string, error)
AddonLoadInfo returns information how to load addon
func (*HTTPGetter) Cleanup ¶
func (h *HTTPGetter) Cleanup() error
Cleanup removes directory where content was downloaded
func (*HTTPGetter) IndexReader ¶
func (h *HTTPGetter) IndexReader() (io.ReadCloser, error)
IndexReader returns index reader
type HgGetterCreator ¶
HgGetterCreator provides functionality for loading addon from any Mercurial repository.
func (HgGetterCreator) NewHg ¶
func (g HgGetterCreator) NewHg(addr, src string) (RepositoryGetter, error)
NewHg returns new instance of RepositoryGetter with functionality for loading addon from any Mercurial repository.
type LoadType ¶
type LoadType int
LoadType define the load type of addon located in file system
const ( // DirectoryLoadType defines that addon should be loaded as directory DirectoryLoadType LoadType = iota // ArchiveLoadType defines that addon should be loaded as archive (e.g. tgz) ArchiveLoadType LoadType = iota // UnknownLoadType define that addon cannot be loaded because type is unknown UnknownLoadType LoadType = iota )
type Provider ¶
type Provider func(idxAddr, dstPath string) (RepositoryGetter, error)
Provider defines factory func for returning concrete addon RepositoryGetter
type RepositoryGetter ¶
type RepositoryGetter interface { Cleanup() error IndexReader() (io.ReadCloser, error) AddonLoadInfo(name internal.AddonName, version internal.AddonVersion) (LoadType, string, error) AddonDocURL(name internal.AddonName, version internal.AddonVersion) (string, error) }
RepositoryGetter defines functionality for downloading addons from repository such as git, http, etc.
func NewClientModeDirGetter ¶
func NewClientModeDirGetter(in ClientModeDirGetterCfg) (RepositoryGetter, error)
NewClientModeDirGetter returns new instance of ClientModeDirGetter
func NewHTTP ¶
func NewHTTP(idxAddr, dst string) (RepositoryGetter, error)
NewHTTP returns new instance of HTTPGetter
type S3GetterCreator ¶
S3GetterCreator provides functionality for loading addon from any S3 repository.
func (S3GetterCreator) NewS3 ¶
func (g S3GetterCreator) NewS3(addr, src string) (RepositoryGetter, error)
NewS3 returns new instance of RepositoryGetter with functionality for loading addon from any S3 repository.