pkg

package
v2.0.0-...-eccd1d4 Latest Latest
Warning

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

Go to latest
Published: Feb 28, 2024 License: BSD-2-Clause Imports: 26 Imported by: 0

Documentation

Index

Constants

View Source
const (
	AssetTypeOther          = "Other"
	AssetTypeVM             = "VM"
	AssetTypeChart          = "Chart"
	AssetTypeContainerImage = "Container Image"
	AssetTypeMetaFile       = "MetaFile"
)
View Source
const (
	MetaFileTypeCLI    = "CLI"
	MetaFileTypeConfig = "CONFIG"
	MetaFileTypeOther  = "MISC"
)

Variables

This section is empty.

Functions

func ApplyParameters

func ApplyParameters(url *url.URL, parameters ...QueryStringParameter)

func Hash

func Hash(filePath, hashAlgorithm string) (string, error)

func LoadChart

func LoadChart(chartPath string) (*models.ChartVersion, error)

func MakeURL

func MakeURL(host, path string, values url.Values) *url.URL

Types

type Asset

type Asset struct {
	DisplayName            string                  `json:"displayname"`
	Filename               string                  `json:"filename"`
	Version                string                  `json:"version"`
	Type                   string                  `json:"type"`
	Size                   int64                   `json:"size"`
	Downloadable           bool                    `json:"downloadable"`
	Downloads              int64                   `json:"downloads"`
	DownloadRequestPayload *DownloadRequestPayload `json:"-"`
	Error                  string                  `json:"error,omitempty"`
	Status                 string                  `json:"status,omitempty"`
}

func GetAssets

func GetAssets(product *models.Product, version string) []*Asset

func GetAssetsByType

func GetAssetsByType(assetType string, product *models.Product, version string) []*Asset

type ChartLoaderFunc

type ChartLoaderFunc func(name string) (*helmChart.Chart, error)
var ChartLoader ChartLoaderFunc = loader.Load

type CredentialsResponse

type CredentialsResponse struct {
	AccessID     string    `json:"accessId"`
	AccessKey    string    `json:"accessKey"`
	SessionToken string    `json:"sessionToken"`
	Expiration   time.Time `json:"expiration"`
}

func (*CredentialsResponse) AWSCredentials

func (c *CredentialsResponse) AWSCredentials() aws.Credentials

type DebuggingClient

type DebuggingClient struct {
	Logger               *log.Logger
	PrintRequests        bool
	PrintRequestPayloads bool
	PrintResposePayloads bool

	PerformRequest PerformRequestFunc
	// contains filtered or unexported fields
}

func NewClient

func NewClient(output io.Writer, printRequests, printRequestPayloads, printResponsePayloads bool) *DebuggingClient

func (*DebuggingClient) Do

func (c *DebuggingClient) Do(req *http.Request) (*http.Response, error)

func (*DebuggingClient) Get

func (c *DebuggingClient) Get(requestURL *url.URL) (*http.Response, error)

func (*DebuggingClient) Post

func (c *DebuggingClient) Post(requestURL *url.URL, content io.Reader, contentType string) (*http.Response, error)

func (*DebuggingClient) PostForm

func (c *DebuggingClient) PostForm(requestURL *url.URL, content url.Values) (resp *http.Response, err error)

func (*DebuggingClient) PostJSON

func (c *DebuggingClient) PostJSON(requestURL *url.URL, content interface{}) (*http.Response, error)

func (*DebuggingClient) Put

func (c *DebuggingClient) Put(requestURL *url.URL, content io.Reader, contentType string) (*http.Response, error)

func (*DebuggingClient) SendRequest

func (c *DebuggingClient) SendRequest(method string, requestURL *url.URL, headers map[string]string, content io.Reader) (*http.Response, error)

type DownloadRequestPayload

type DownloadRequestPayload struct {
	ProductId           string `json:"productid,omitempty"`
	AppVersion          string `json:"appVersion,omitempty"`
	EulaAccepted        bool   `json:"eulaAccepted"`
	DockerlinkVersionID string `json:"dockerlinkVersionId,omitempty"`
	DockerUrlId         string `json:"dockerUrlId,omitempty"`
	ImageTagId          string `json:"imageTagId,omitempty"`
	DeploymentFileId    string `json:"deploymentFileId,omitempty"`
	ChartVersion        string `json:"chartVersion,omitempty"`
	IsAddonFile         bool   `json:"isAddonFile,omitempty"`
	AddonFileId         string `json:"addonFileId,omitempty"`
	MetaFileID          string `json:"metafileid,omitempty"`
	MetaFileObjectID    string `json:"metafileobjectid,omitempty"`
}

type DownloadResponse

type DownloadResponse struct {
	Response *DownloadResponseBody `json:"response"`
}

type DownloadResponseBody

type DownloadResponseBody struct {
	PreSignedURL string `json:"presignedurl"`
	Message      string `json:"message"`
	StatusCode   int    `json:"statuscode"`
}

type GetProductResponse

type GetProductResponse struct {
	Response *GetProductResponsePayload `json:"response"`
}

type GetProductResponsePayload

type GetProductResponsePayload struct {
	Message    string          `json:"message"`
	StatusCode int             `json:"statuscode"`
	Data       *models.Product `json:"data"`
}

type HTTPClient

type HTTPClient interface {
	Get(requestURL *url.URL) (*http.Response, error)
	Post(requestURL *url.URL, content io.Reader, contentType string) (*http.Response, error)
	PostForm(requestURL *url.URL, content url.Values) (resp *http.Response, err error)
	PostJSON(requestURL *url.URL, content interface{}) (*http.Response, error)
	Put(requestURL *url.URL, content io.Reader, contentType string) (*http.Response, error)
	SendRequest(method string, requestURL *url.URL, headers map[string]string, content io.Reader) (*http.Response, error)
	Do(req *http.Request) (*http.Response, error)
}

type ListProductFilter

type ListProductFilter struct {
	Text    string   `json:"search,omitempty"`
	AllOrgs bool     `json:"-"`
	OrgIds  []string `json:"Publishers,omitempty"`
}

func (*ListProductFilter) QueryString

func (f *ListProductFilter) QueryString() string

type ListProductResponse

type ListProductResponse struct {
	Response *ListProductResponsePayload `json:"response"`
}

type ListProductResponseParams

type ListProductResponseParams struct {
	Filters      map[string][]interface{} `json:"filters"`
	Pagination   *internal.Pagination     `json:"pagination"`
	ProductCount int                      `json:"itemsnumber"`
	Search       string                   `json:"search"`
	SortingList  []*internal.Sorting      `json:"sortinglist"`
	SelectList   []interface{}            `json:"selectlist"`
}

type ListProductResponsePayload

type ListProductResponsePayload struct {
	Message          string                     `json:"message"`
	StatusCode       int                        `json:"statuscode"`
	Products         []*models.Product          `json:"dataList"`
	AvailableFilters interface{}                `json:"availablefilters"`
	Params           *ListProductResponseParams `json:"params"`
}

type Marketplace

type Marketplace struct {
	Host          string
	APIHost       string
	UIHost        string
	StorageBucket string
	StorageRegion string
	Client        HTTPClient
	Output        io.Writer
	// contains filtered or unexported fields
}

func (*Marketplace) AttachLocalChart

func (m *Marketplace) AttachLocalChart(chartPath, instructions string, product *models.Product, version *models.Version) (*models.Product, error)

func (*Marketplace) AttachLocalContainerImage

func (m *Marketplace) AttachLocalContainerImage(imageFile, image, tag, tagType, instructions string, product *models.Product, version *models.Version) (*models.Product, error)

func (*Marketplace) AttachMetaFile

func (m *Marketplace) AttachMetaFile(metafile, metafileType, metafileVersion string, product *models.Product, version *models.Version) (*models.Product, error)

func (*Marketplace) AttachOtherFile

func (m *Marketplace) AttachOtherFile(file string, product *models.Product, version *models.Version) (*models.Product, error)

func (*Marketplace) AttachPublicChart

func (m *Marketplace) AttachPublicChart(chartPath *url.URL, instructions string, product *models.Product, version *models.Version) (*models.Product, error)

func (*Marketplace) AttachPublicContainerImage

func (m *Marketplace) AttachPublicContainerImage(image, tag, tagType, instructions string, product *models.Product, version *models.Version) (*models.Product, error)

func (*Marketplace) DecodeJson

func (m *Marketplace) DecodeJson(input io.Reader, output interface{}) error

func (*Marketplace) Download

func (m *Marketplace) Download(filename string, payload *DownloadRequestPayload) error

func (*Marketplace) DownloadChart

func (m *Marketplace) DownloadChart(chartURL *url.URL) (*models.ChartVersion, error)

func (*Marketplace) EnableStrictDecoding

func (m *Marketplace) EnableStrictDecoding()

func (*Marketplace) GetAPIHost

func (m *Marketplace) GetAPIHost() string

func (*Marketplace) GetHost

func (m *Marketplace) GetHost() string

func (*Marketplace) GetProduct

func (m *Marketplace) GetProduct(slug string) (*models.Product, error)

func (*Marketplace) GetProductWithVersion

func (m *Marketplace) GetProductWithVersion(slug, version string) (*models.Product, *models.Version, error)

func (*Marketplace) GetUIHost

func (m *Marketplace) GetUIHost() string

func (*Marketplace) GetUploadCredentials

func (m *Marketplace) GetUploadCredentials() (*CredentialsResponse, error)

func (*Marketplace) GetUploader

func (m *Marketplace) GetUploader(orgID string) (internal.Uploader, error)

func (*Marketplace) ListProducts

func (m *Marketplace) ListProducts(filter *ListProductFilter) ([]*models.Product, error)

func (*Marketplace) PutProduct

func (m *Marketplace) PutProduct(product *models.Product, versionUpdate bool) (*models.Product, error)

func (*Marketplace) SetUploader

func (m *Marketplace) SetUploader(uploader internal.Uploader)

func (*Marketplace) UploadVM

func (m *Marketplace) UploadVM(vmFile string, product *models.Product, version *models.Version) (*models.Product, error)

type MarketplaceInterface

type MarketplaceInterface interface {
	EnableStrictDecoding()
	DecodeJson(input io.Reader, output interface{}) error

	GetHost() string
	GetAPIHost() string
	GetUIHost() string

	ListProducts(filter *ListProductFilter) ([]*models.Product, error)
	GetProduct(slug string) (*models.Product, error)
	GetProductWithVersion(slug, version string) (*models.Product, *models.Version, error)
	PutProduct(product *models.Product, versionUpdate bool) (*models.Product, error)

	GetUploader(orgID string) (internal.Uploader, error)
	SetUploader(uploader internal.Uploader)

	Download(filename string, payload *DownloadRequestPayload) error

	DownloadChart(chartURL *url.URL) (*models.ChartVersion, error)
	AttachLocalChart(chartPath, instructions string, product *models.Product, version *models.Version) (*models.Product, error)
	AttachPublicChart(chartPath *url.URL, instructions string, product *models.Product, version *models.Version) (*models.Product, error)

	AttachLocalContainerImage(imageFile, image, tag, tagType, instructions string, product *models.Product, version *models.Version) (*models.Product, error)
	AttachPublicContainerImage(image, tag, tagType, instructions string, product *models.Product, version *models.Version) (*models.Product, error)

	AttachMetaFile(metafile, metafileType, metafileVersion string, product *models.Product, version *models.Version) (*models.Product, error)

	AttachOtherFile(file string, product *models.Product, version *models.Version) (*models.Product, error)

	UploadVM(vmFile string, product *models.Product, version *models.Version) (*models.Product, error)
}

type PerformRequestFunc

type PerformRequestFunc func(req *http.Request) (*http.Response, error)

type QueryStringParameter

type QueryStringParameter interface {
	QueryString() string
}

type VersionDoesNotExistError

type VersionDoesNotExistError struct {
	Product string
	Version string
}

func (*VersionDoesNotExistError) Error

func (e *VersionDoesNotExistError) Error() string

func (*VersionDoesNotExistError) Is

func (e *VersionDoesNotExistError) Is(otherError error) bool

type VersionSpecificDetailsPayload

type VersionSpecificDetailsPayload struct {
	Message    string                                `json:"message"`
	StatusCode int                                   `json:"statuscode"`
	Data       *models.VersionSpecificProductDetails `json:"data"`
}

type VersionSpecificDetailsPayloadResponse

type VersionSpecificDetailsPayloadResponse struct {
	Response *VersionSpecificDetailsPayload `json:"response"`
}

type VersionSpecificDetailsRequestPayload

type VersionSpecificDetailsRequestPayload struct {
	ProductId     string `json:"productId"`
	VersionNumber string `json:"versionNumber"`
}

Directories

Path Synopsis
Code generated by counterfeiter.
Code generated by counterfeiter.

Jump to

Keyboard shortcuts

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