ingest

package
v0.2.2 Latest Latest
Warning

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

Go to latest
Published: Apr 12, 2026 License: Apache-2.0 Imports: 10 Imported by: 0

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

func WithLogger(l *slog.Logger) Option

WithLogger specifies the logger for the orchestrator

func WithQueryInterval

func WithQueryInterval(q time.Duration) Option

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

func (*Orchestrator) Start

func (o *Orchestrator) Start(ctx context.Context) error

Start starts the provider orchestration service loop [BLOCKING]

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

Jump to

Keyboard shortcuts

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