Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Option ¶
type Option func(o *Orchestrator)
func WithLogger ¶
WithLogger specifies the logger for the orchestrator
func WithQueryInterval ¶
WithQueryInterval specifies query interval for the orchestrator's jobs. Defaults to 1s. This should only be modified if the registered providers with the orchestrator have sparse runs (once every hour / 24hrs)
type Orchestrator ¶
type Orchestrator struct {
// contains filtered or unexported fields
}
Orchestrator is the main job scheduler for registered providers
func New ¶
func New(storage storage.Storage, opts ...Option) *Orchestrator
New creates a new Orchestrator instance
func (*Orchestrator) Register ¶
func (o *Orchestrator) Register(p Provider) error
Register registers a new provider with the orchestrator. The provider is immediately queued up for execution
type Provider ¶
type Provider interface {
// Name returns the human-readable name of the provider
Name() string
// Interval returns the interval at which the provider should be called
Interval() time.Duration
// Fetch is the provider's main fetch job, yielding exchange rate data points
Fetch(context.Context) ([]*types.ExchangeRate, error)
}
Provider is a single custom exchange rate provider
Click to show internal directories.
Click to hide internal directories.