Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
View Source
var DefaultRefreshInterval = 12 * time.Hour
Functions ¶
This section is empty.
Types ¶
type ModelPrice ¶
type ModelPricing ¶
type ModelPricing interface {
// Start starts the pricing update loop
Start(ctx context.Context)
// GetPrice returns the price for a given model, or nil if the model is not found
GetPrice(model string) *ModelPrice
// Close stops the pricing update loop
Close()
}
ModelPricing is an interface for getting the price for a given model
func NewModelPricing ¶ added in v1.0.32
func NewModelPricing(options ...ModelPricingOption) ModelPricing
type ModelPricingOption ¶ added in v1.0.32
type ModelPricingOption func(*modelPricing)
func WithInterval ¶
func WithInterval(interval time.Duration) ModelPricingOption
func WithOnError ¶
func WithOnError(onError func(error)) ModelPricingOption
func WithOnUpdate ¶
func WithOnUpdate(onUpdate func(int)) ModelPricingOption
Click to show internal directories.
Click to hide internal directories.