marketplace

package
v0.4.0 Latest Latest
Warning

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

Go to latest
Published: Dec 5, 2024 License: Apache-2.0 Imports: 18 Imported by: 0

Documentation

Index

Constants

View Source
const DuplicateError = errors.Sentinel("duplicate")
View Source
const RetryableError = errors.Sentinel("retryable")

Variables

View Source
var DefaultBackoff = wait.Backoff{
	Steps:    4,
	Duration: 50 * time.Millisecond,
	Factor:   5.0,
	Jitter:   0.1,
}

Functions

This section is empty.

Types

type Client

type Client interface {
	Metrics() MarketplaceMetrics
}

func NewClient

func NewClient(config *MarketplaceConfig) (Client, error)

type MarketplaceConfig

type MarketplaceConfig struct {
	URL   string `json:"url"`
	Token string `json:"-"`

	TlsConfig *tls.Config
	// contains filtered or unexported fields
}

type MarketplaceMetrics

type MarketplaceMetrics interface {
	Status(ctx context.Context, id string) (*MarketplaceUsageResponse, error)
	Upload(ctx context.Context, fileName string, reader io.Reader) (id string, err error)
}

type MarketplaceUsageResponse

type MarketplaceUsageResponse struct {
	RequestID     string      `json:"requestId,omitempty"`
	CorrelationID string      `json:"correlationId,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
const (
	MktplStatusSuccess    MktplStatus = "success"
	MktplStatusInProgress MktplStatus = "inProgress"
	MktplStatusFailed     MktplStatus = "failed"
)

Jump to

Keyboard shortcuts

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