uploaders

package
v2.0.0-...-7b710ec Latest Latest
Warning

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

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

Documentation

Index

Constants

View Source
const VerificationError = errors.Sentinel("verification")

Variables

This section is empty.

Functions

func GenerateCACertPool

func GenerateCACertPool(
	certs []*x509.Certificate,
	files []string,
) (*tls.Config, error)

func WithBearerAuth

func WithBearerAuth(rt http.RoundTripper, token string) http.RoundTripper

func WithHeader

func WithHeader(rt http.RoundTripper) withHeader

Types

type COSS3Uploader

type COSS3Uploader struct {
	COSS3UploaderConfig
	// contains filtered or unexported fields
}

func (*COSS3Uploader) Name

func (u *COSS3Uploader) Name() string

func (*COSS3Uploader) UploadFile

func (r *COSS3Uploader) UploadFile(ctx context.Context, path string, file io.Reader) (string, error)

type COSS3UploaderConfig

type COSS3UploaderConfig struct {
	ApiKey            string `json:"apiKey" yaml:"apiKey"`
	ServiceInstanceID string `json:"serviceInstanceID" yaml:"serviceInstanceID"`
	AuthEndpoint      string `json:"authEndpoint" yaml:"authEndpoint"`
	ServiceEndpoint   string `json:"serviceEndpoint" yaml:"serviceEndpoint"`
	Bucket            string `json:"bucket" yaml:"bucket"`
}

type LocalFilePathUploader

type LocalFilePathUploader struct {
	LocalFilePath string
}

func (*LocalFilePathUploader) Name

func (u *LocalFilePathUploader) Name() string

func (*LocalFilePathUploader) UploadFile

func (r *LocalFilePathUploader) UploadFile(ctx context.Context, file string, reader io.Reader) (string, error)

type MarketplaceUploader

type MarketplaceUploader struct {
	MarketplaceUploaderConfig
	// contains filtered or unexported fields
}

func (*MarketplaceUploader) Name

func (u *MarketplaceUploader) Name() string

func (*MarketplaceUploader) UploadFile

func (r *MarketplaceUploader) UploadFile(ctx context.Context, fileName string, reader io.Reader) (id string, err error)

type MarketplaceUploaderConfig

type MarketplaceUploaderConfig struct {
	URL                 string   `json:"url"`
	Token               string   `json:"-"`
	AdditionalCertFiles []string `json:"additionalCertFiles,omitempty"`

	CipherSuites []uint16
	MinVersion   uint16
	// contains filtered or unexported fields
}

type MarketplaceUsageResponse

type MarketplaceUsageResponse struct {
	RequestID string      `json:"requestId,omitempty"`
	Status    MktplStatus `json:"status,omitempty"`
	Message   string      `json:"message,omitempty"`
	ErrorCode string      `json:"errorCode,omitempty"`

	Details *MarketplaceUsageResponseDetails `json:"details,omitempty"`
}

type MarketplaceUsageResponseDetails

type MarketplaceUsageResponseDetails struct {
	Code       string `json:"code"`
	StatusCode int    `json:"statusCode"`
	Retryable  bool   `json:"retryable,omitempty"`
}

type MktplStatus

type MktplStatus = string

type NoOpUploader

type NoOpUploader struct{}

func (*NoOpUploader) Name

func (u *NoOpUploader) Name() string

func (*NoOpUploader) UploadFile

func (r *NoOpUploader) UploadFile(ctx context.Context, fileName string, reader io.Reader) (string, error)

type RedHatInsightsUploader

type RedHatInsightsUploader struct {
	RedHatInsightsUploaderConfig
	// contains filtered or unexported fields
}

func (*RedHatInsightsUploader) Name

func (u *RedHatInsightsUploader) Name() string

func (*RedHatInsightsUploader) UploadFile

func (r *RedHatInsightsUploader) UploadFile(ctx context.Context, fileName string, reader io.Reader) (string, error)

type RedHatInsightsUploaderConfig

type RedHatInsightsUploaderConfig struct {
	URL                 string   `json:"url"`
	Token               string   `json:"-"`
	OperatorVersion     string   `json:"operatorVersion"`
	ClusterID           string   `json:"clusterID"`
	AdditionalCertFiles []string `json:"additionalCertFiles,omitempty"`
	// contains filtered or unexported fields
}

type ReportJobError

type ReportJobError struct {
	ErrorMessage string
	Err          error
}

func (*ReportJobError) Error

func (re *ReportJobError) Error() string

func (*ReportJobError) Unwrap

func (re *ReportJobError) Unwrap() error

type Uploader

type Uploader interface {
	UploaderTarget
	UploadFile(ctx context.Context, fileName string, reader io.Reader) (id string, err error)
}

func NewCOSS3Uploader

func NewCOSS3Uploader(
	config *COSS3UploaderConfig,
) (Uploader, error)

func NewMarketplaceUploader

func NewMarketplaceUploader(
	config *MarketplaceUploaderConfig,
) (Uploader, error)

func NewRedHatInsightsUploader

func NewRedHatInsightsUploader(
	config *RedHatInsightsUploaderConfig,
) (Uploader, error)

func ProvideRedHatInsightsUploader

func ProvideRedHatInsightsUploader(
	ctx context.Context,
	client client.Client,
	log logr.Logger,
) (Uploader, error)

type UploaderTarget

type UploaderTarget interface {
	Name() string
}
var (
	UploaderTargetRedHatInsights UploaderTarget = &RedHatInsightsUploader{}
	UploaderTargetNoOp           UploaderTarget = &NoOpUploader{}
	UploaderTargetLocalPath      UploaderTarget = &LocalFilePathUploader{}
	UploaderTargetCOSS3          UploaderTarget = &COSS3Uploader{}
	UploaderTargetMarketplace    UploaderTarget = &MarketplaceUploader{}
	UploaderTargetDataService    UploaderTarget = &dataservice.DataService{}
)

func MustParseUploaderTarget

func MustParseUploaderTarget(s string) UploaderTarget

type UploaderTargets

type UploaderTargets []UploaderTarget

type Uploaders

type Uploaders []Uploader

Jump to

Keyboard shortcuts

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