provider

package
v1.5.4 Latest Latest
Warning

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

Go to latest
Published: Dec 26, 2025 License: MIT Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func AllHealthy added in v1.3.0

func AllHealthy(
	ctx context.Context,
	providers []HealthChecker,
) error

AllHealthy checks if all providers are healthy

func HealthCheckAll added in v1.3.0

func HealthCheckAll(
	ctx context.Context,
	providers []HealthChecker,
) map[string]error

HealthCheckAll checks the health of all providers and returns a map of results

Types

type ExchangeRateProvider deprecated

type ExchangeRateProvider = exchange.Exchange

Deprecated: Use exchange.Exchange instead.

type GetPaymentStatusParams

type GetPaymentStatusParams = payment.GetPaymentStatusParams

Payment

type HealthChecker added in v1.3.0

type HealthChecker = exchange.HealthChecker

Exchange

func FirstHealthy added in v1.3.0

func FirstHealthy(
	ctx context.Context,
	providers []HealthChecker,
) (HealthChecker, error)

FirstHealthy returns the first healthy provider from the list

type InitiatePaymentParams

type InitiatePaymentParams = payment.InitiatePaymentParams

Payment

type InitiatePaymentResponse

type InitiatePaymentResponse = payment.InitiatePaymentResponse

Payment

type Payment added in v1.3.0

type Payment = payment.Payment

Payment

type PaymentEvent

type PaymentEvent = payment.PaymentEvent

Payment

type PaymentProvider deprecated

type PaymentProvider = payment.Payment

Deprecated: Use payment.Payment instead.

type PaymentStatus

type PaymentStatus = payment.PaymentStatus

Payment

type Provider added in v1.3.0

type Provider = exchange.Exchange

Exchange

type ProviderMetadata added in v1.3.0

type ProviderMetadata = exchange.ProviderMetadata

Exchange

type RateFetcher added in v1.3.0

type RateFetcher = exchange.RateFetcher

Exchange

type RateHistory added in v1.3.0

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

RateHistory tracks historical rate data

func NewRateHistory added in v1.3.0

func NewRateHistory(size int) *RateHistory

NewRateHistory creates a new RateHistory with the specified maximum size

func (*RateHistory) Add added in v1.3.0

func (h *RateHistory) Add(rate RateInfo)

Add adds a new rate to the history

func (*RateHistory) Average added in v1.3.0

func (h *RateHistory) Average(since time.Time) float64

Average calculates the average rate over the specified duration

func (*RateHistory) Get added in v1.3.0

func (h *RateHistory) Get() []RateInfo

Get returns the rate history

type RateInfo added in v1.3.0

type RateInfo = exchange.RateInfo

Exchange

type RateStats added in v1.3.0

type RateStats struct {
	Min     float64
	Max     float64
	Average float64
	Count   int
}

RateStats contains statistics about exchange rates

func CalculateStats added in v1.3.0

func CalculateStats(rates []float64) RateStats

CalculateStats calculates statistics for a set of rates

type SupportedChecker added in v1.3.0

type SupportedChecker = exchange.SupportedChecker

Exchange

type UpdatePaymentStatusParams

type UpdatePaymentStatusParams = payment.UpdatePaymentStatusParams

Payment

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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