Documentation ¶
Index ¶
- type ExchangeRate
- type ExchangeRates
- type WatcherServer
- func (w *WatcherServer) Echo(ctx context.Context, tr *pb.TickerRequest) (*pb.TickerRequest, error)
- func (w *WatcherServer) GetInfo(ctx context.Context, tr *pb.TickerRequest) (*pb.TickerResponse, error)
- func (w *WatcherServer) MoreInfo(ctx context.Context, tr *pb.TickerRequest) (*pb.CompanyResponse, error)
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type ExchangeRate ¶
type ExchangeRate struct {
Rate string `json:"5. Exchange Rate"`
}
type ExchangeRates ¶
type ExchangeRates struct {
R ExchangeRate `json:"Realtime Currency Exchange Rate"`
}
ExchangeRates is a struct composed of ExchangeRate It is used to unmarshal FOREX JSON data from the Alpha Vantage API
type WatcherServer ¶
type WatcherServer struct { pb.UnimplementedWatcherServer // contains filtered or unexported fields }
func NewWatcher ¶
func NewWatcher(sp *data.StockPrices, l *log.Logger) *WatcherServer
func (*WatcherServer) Echo ¶
func (w *WatcherServer) Echo(ctx context.Context, tr *pb.TickerRequest) (*pb.TickerRequest, error)
Echo returns the request that was passed to it
func (*WatcherServer) GetInfo ¶
func (w *WatcherServer) GetInfo(ctx context.Context, tr *pb.TickerRequest) (*pb.TickerResponse, error)
GetInfo returns a TickerResponse containing the price of the security in USD
func (*WatcherServer) MoreInfo ¶
func (w *WatcherServer) MoreInfo(ctx context.Context, tr *pb.TickerRequest) (*pb.CompanyResponse, error)
MoreInfo returns a CompanyResponse containing important financial ratios
Click to show internal directories.
Click to hide internal directories.