spi

package
v0.0.0-...-50752a0 Latest Latest
Warning

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

Go to latest
Published: Apr 17, 2024 License: Apache-2.0 Imports: 19 Imported by: 0

Documentation

Index

Constants

View Source
const (
	SPIFCR_waiting_for_delivered_phase = "File content request status has not been delivered"
	SPIFCR_prefix                      = "spi-fcr-"
)

Variables

View Source
var ValidDevfileLocations = cdqanalysis.ValidDevfileLocations

Functions

func DownloadDevfileUsingSPI

func DownloadDevfileUsingSPI(s SPI, ctx context.Context, component v1alpha1.Component, repoURL string, ref string, path string) ([]byte, string, error)

func DownloadDevfileandDockerfileUsingSPI

func DownloadDevfileandDockerfileUsingSPI(s SPI, ctx context.Context, name string, component v1alpha1.Component, repoURL string, ref string, path string) ([]byte, []byte, string, error)

func DownloadFileUsingSPI

func DownloadFileUsingSPI(s SPI, ctx context.Context, fcrName string, component v1alpha1.Component, repoURL string, ref string, filepath string) ([]byte, error)

Types

type MockSPIClient

type MockSPIClient struct {
	K8sClient client.Client
}

func (MockSPIClient) GetFileContents

func (s MockSPIClient) GetFileContents(ctx context.Context, name string, component v1alpha1.Component, repoURL string, filepath string, ref string) (io.ReadCloser, error)

GetFileContents mocks the GetFileContents function from SPI If "repoURL" parameter contains "test-error-response", then an error value will be returned, otherwise we return a mock devfile that can be read.

type SPI

type SPI interface {
	GetFileContents(ctx context.Context, name string, component v1alpha1.Component, repoUrl string, filepath string, ref string) (io.ReadCloser, error)
}

type SPIClient

type SPIClient struct {
	K8sClient client.Client
}

func (SPIClient) GetFileContents

func (s SPIClient) GetFileContents(ctx context.Context, name string, component v1alpha1.Component, repoUrl string, filepath string, ref string) (io.ReadCloser, error)

GetFileContents is a wrapper call to scm file retriever's GetFileContents()

type SPIFileContentRequestError

type SPIFileContentRequestError struct {
	Message string
}

SPIFileContentRequestError returns an internal error

func (*SPIFileContentRequestError) Error

Jump to

Keyboard shortcuts

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