handlers

package
v0.66.0 Latest Latest
Warning

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

Go to latest
Published: Aug 2, 2024 License: MIT Imports: 19 Imported by: 0

Documentation

Index

Constants

View Source
const (
	// Provider's assets consist of three files/URLs: zipped binary, hashes and signature
	ProviderDownloadURLName         providerURLName = "download_url"
	ProviderSHASumsURLName          providerURLName = "shasums_url"
	ProviderSHASumsSignatureURLName providerURLName = "shasums_signature_url"
)

Variables

This section is empty.

Functions

This section is empty.

Types

type CommonProviderHandler added in v0.58.7

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

func NewCommonProviderHandler added in v0.58.7

func NewCommonProviderHandler(includes, excludes *[]string) *CommonProviderHandler

func (*CommonProviderHandler) CanHandleProvider added in v0.58.7

func (handler *CommonProviderHandler) CanHandleProvider(provider *models.Provider) bool

CanHandleProvider implements ProviderHandler.CanHandleProvider

type ProviderDirectHandler added in v0.58.7

type ProviderDirectHandler struct {
	*CommonProviderHandler

	*ReverseProxy
	// contains filtered or unexported fields
}

func NewProviderDirectHandler added in v0.58.7

func NewProviderDirectHandler(providerService *services.ProviderService, cacheProviderHTTPStatusCode int, method *cliconfig.ProviderInstallationDirect, credsSource *cliconfig.CredentialsSource) *ProviderDirectHandler

func (*ProviderDirectHandler) Download added in v0.58.7

func (handler *ProviderDirectHandler) Download(ctx echo.Context, provider *models.Provider) error

Download implements ProviderHandler.Download

func (*ProviderDirectHandler) GetPlatform added in v0.58.7

func (handler *ProviderDirectHandler) GetPlatform(ctx echo.Context, provider *models.Provider, downloaderController router.Controller, cacheRequestID string) error

GetPlatform implements ProviderHandler.GetPlatform

func (*ProviderDirectHandler) GetVersions added in v0.58.7

func (handler *ProviderDirectHandler) GetVersions(ctx echo.Context, provider *models.Provider) error

GetVersions implements ProviderHandler.GetVersions

func (*ProviderDirectHandler) String added in v0.58.7

func (handler *ProviderDirectHandler) String() string

type ProviderFilesystemMirrorHandler added in v0.58.7

type ProviderFilesystemMirrorHandler struct {
	*CommonProviderHandler
	// contains filtered or unexported fields
}

func (*ProviderFilesystemMirrorHandler) Download added in v0.58.7

func (handler *ProviderFilesystemMirrorHandler) Download(ctx echo.Context, provider *models.Provider) error

Download implements ProviderHandler.Download

func (*ProviderFilesystemMirrorHandler) GetPlatform added in v0.58.7

func (handler *ProviderFilesystemMirrorHandler) GetPlatform(ctx echo.Context, provider *models.Provider, downloaderController router.Controller, cacheRequestID string) error

GetPlatform implements ProviderHandler.GetPlatform

func (*ProviderFilesystemMirrorHandler) GetVersions added in v0.58.7

func (handler *ProviderFilesystemMirrorHandler) GetVersions(ctx echo.Context, provider *models.Provider) error

GetVersions implements ProviderHandler.GetVersions

func (*ProviderFilesystemMirrorHandler) String added in v0.58.7

func (handler *ProviderFilesystemMirrorHandler) String() string

type ProviderHandler added in v0.58.7

type ProviderHandler interface {
	// CanHandleProvider returns true if the given provider can be handled by this handler.
	CanHandleProvider(provider *models.Provider) bool

	// GetVersions serves a request that returns all versions for a single provider.
	GetVersions(ctx echo.Context, provider *models.Provider) error

	// GetPlatform serves a request that returns a provider for a specific platform.
	GetPlatform(ctx echo.Context, provider *models.Provider, downloaderController router.Controller, cacheRequestID string) error

	// Download serves a request to download the target file.
	Download(ctx echo.Context, provider *models.Provider) error
}

func NewProviderFilesystemMirrorHandler added in v0.58.7

func NewProviderFilesystemMirrorHandler(providerService *services.ProviderService, cacheProviderHTTPStatusCode int, method *cliconfig.ProviderInstallationFilesystemMirror) ProviderHandler

func NewProviderNetworkMirrorHandler added in v0.58.7

func NewProviderNetworkMirrorHandler(providerService *services.ProviderService, cacheProviderHTTPStatusCode int, networkMirror *cliconfig.ProviderInstallationNetworkMirror, credsSource *cliconfig.CredentialsSource) ProviderHandler

type ProviderNetworkMirrorHandler added in v0.58.7

type ProviderNetworkMirrorHandler struct {
	*CommonProviderHandler

	*http.Client
	// contains filtered or unexported fields
}

func (*ProviderNetworkMirrorHandler) Download added in v0.58.7

func (handler *ProviderNetworkMirrorHandler) Download(ctx echo.Context, provider *models.Provider) error

Download implements ProviderHandler.Download

func (*ProviderNetworkMirrorHandler) GetPlatform added in v0.58.7

func (handler *ProviderNetworkMirrorHandler) GetPlatform(ctx echo.Context, provider *models.Provider, downloaderController router.Controller, cacheRequestID string) error

GetPlatform implements ProviderHandler.GetPlatform

func (*ProviderNetworkMirrorHandler) GetVersions added in v0.58.7

func (handler *ProviderNetworkMirrorHandler) GetVersions(ctx echo.Context, provider *models.Provider) error

GetVersions implements ProviderHandler.GetVersions

func (*ProviderNetworkMirrorHandler) String added in v0.58.7

func (handler *ProviderNetworkMirrorHandler) String() string

type ReverseProxy

type ReverseProxy struct {
	ServerURL   *url.URL
	CredsSource *cliconfig.CredentialsSource

	Rewrite        func(*httputil.ProxyRequest)
	ModifyResponse func(resp *http.Response) error
	ErrorHandler   func(http.ResponseWriter, *http.Request, error)
}

func (*ReverseProxy) NewRequest

func (reverseProxy *ReverseProxy) NewRequest(ctx echo.Context, targetURL *url.URL) (er error)

func (ReverseProxy) WithModifyResponse

func (reverseProxy ReverseProxy) WithModifyResponse(fn func(resp *http.Response) error) *ReverseProxy

func (ReverseProxy) WithRewrite

func (reverseProxy ReverseProxy) WithRewrite(fn func(req *httputil.ProxyRequest)) *ReverseProxy

Jump to

Keyboard shortcuts

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