Documentation
¶
Index ¶
- type ErrorResponse
- type PriceResponse
- type PricesResponse
- type Service
- func (s *Service) PricesGet(w http.ResponseWriter, r *http.Request, ps httprouter.Params)
- func (s *Service) SourceGet(w http.ResponseWriter, r *http.Request, ps httprouter.Params)
- func (s *Service) SourcesGet(w http.ResponseWriter, r *http.Request, ps httprouter.Params)
- func (s *Service) Start() error
- func (s *Service) StatusGet(w http.ResponseWriter, r *http.Request, ps httprouter.Params)
- func (s *Service) Stop()
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type ErrorResponse ¶
type ErrorResponse struct {
Error string `json:"error"`
}
ErrorResponse is used when something went wrong.
type PriceResponse ¶
type PriceResponse struct {
Source string `json:"source"`
Base string `json:"base"`
BaseReal string `json:"base_real"`
Quote string `json:"quote"`
QuoteReal string `json:"quote_real"`
Price float64 `json:"price"`
LastUpdatedReal string `json:"lastUpdatedReal"`
LastUpdatedWander string `json:"lastUpdatedWander"`
}
PriceResponse gives the detail on one price.
type PricesResponse ¶
type PricesResponse struct {
Prices []*PriceResponse `json:"prices"`
}
PricesResponse gives details on multiple prices.
type Service ¶
type Service struct {
*httprouter.Router
// contains filtered or unexported fields
}
Service is the HTTP service.
func NewService ¶
NewService creates a new service instance (with optional mocks for test purposes).
func (*Service) PricesGet ¶
func (s *Service) PricesGet(w http.ResponseWriter, r *http.Request, ps httprouter.Params)
PricesGet gets information on all prices.
func (*Service) SourceGet ¶
func (s *Service) SourceGet(w http.ResponseWriter, r *http.Request, ps httprouter.Params)
SourceGet gets information on one price.
func (*Service) SourcesGet ¶
func (s *Service) SourcesGet(w http.ResponseWriter, r *http.Request, ps httprouter.Params)
SourcesGet gets information on all prices.
func (*Service) StatusGet ¶
func (s *Service) StatusGet(w http.ResponseWriter, r *http.Request, ps httprouter.Params)
StatusGet says all is well.
Click to show internal directories.
Click to hide internal directories.