Documentation
¶
Index ¶
- func AllHealthy(ctx context.Context, providers []HealthChecker) error
- func HealthCheckAll(ctx context.Context, providers []HealthChecker) map[string]error
- type ExchangeRateProviderdeprecated
- type GetPaymentStatusParams
- type HealthChecker
- type InitiatePaymentParams
- type InitiatePaymentResponse
- type Payment
- type PaymentEvent
- type PaymentProviderdeprecated
- type PaymentStatus
- type Provider
- type ProviderMetadata
- type RateFetcher
- type RateHistory
- type RateInfo
- type RateStats
- type SupportedChecker
- type UpdatePaymentStatusParams
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 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 InitiatePaymentResponse ¶
type InitiatePaymentResponse = payment.InitiatePaymentResponse
Payment
type PaymentProvider
deprecated
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 RateStats ¶ added in v1.3.0
RateStats contains statistics about exchange rates
func CalculateStats ¶ added in v1.3.0
CalculateStats calculates statistics for a set of rates
type UpdatePaymentStatusParams ¶
type UpdatePaymentStatusParams = payment.UpdatePaymentStatusParams
Payment
Click to show internal directories.
Click to hide internal directories.