Documentation ¶
Overview ¶
package securities contains the code for the SecuritiesService implementation.
Index ¶
Constants ¶
View Source
const QuoteProviderING = "ing"
View Source
const QuoteProviderYF = "yf"
Variables ¶
View Source
var ErrEmptyResult = errors.New("empty result")
Functions ¶
func NewService ¶
func NewService(db *persistence.DB) portfoliov1connect.SecuritiesServiceHandler
func RegisterQuoteProvider ¶
func RegisterQuoteProvider(name string, qp QuoteProvider)
AddCommand adds a command using the specific symbol.
Types ¶
type QuoteProvider ¶
type QuoteProvider interface {
LatestQuote(ctx context.Context, ls *portfoliov1.ListedSecurity) (quote *portfoliov1.Currency, t time.Time, err error)
}
QuoteProvider is an interface that retrieves quotes for a [ListedSecurity]. They can either be historical quotes or the latest quote.
Click to show internal directories.
Click to hide internal directories.