Documentation ¶
Index ¶
- type HTTPRunner
- func (h *HTTPRunner) GetAuthDataTicker() <-chan time.Time
- func (h *HTTPRunner) GetBlockTicker() <-chan time.Time
- func (h *HTTPRunner) GetGlobalDataTicker() <-chan time.Time
- func (h *HTTPRunner) GetOrderbookTicker() <-chan time.Time
- func (h *HTTPRunner) GetRateTicker() <-chan time.Time
- func (h *HTTPRunner) Start() error
- func (h *HTTPRunner) Stop() error
- type Option
- type Server
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type HTTPRunner ¶
type HTTPRunner struct {
// contains filtered or unexported fields
}
HTTPRunner is an implementation of FetcherRunner that run a HTTP server and tick when it receives request to a certain endpoints.
func NewHTTPRunner ¶
func NewHTTPRunner(options ...Option) (*HTTPRunner, error)
NewHTTPRunner creates a new instance of HTTPRunner.
func (*HTTPRunner) GetAuthDataTicker ¶
func (h *HTTPRunner) GetAuthDataTicker() <-chan time.Time
GetAuthDataTicker returns the auth data ticker.
func (*HTTPRunner) GetBlockTicker ¶
func (h *HTTPRunner) GetBlockTicker() <-chan time.Time
GetBlockTicker returns the block ticker.
func (*HTTPRunner) GetGlobalDataTicker ¶
func (h *HTTPRunner) GetGlobalDataTicker() <-chan time.Time
GetGlobalDataTicker returns the global data ticker.
func (*HTTPRunner) GetOrderbookTicker ¶
func (h *HTTPRunner) GetOrderbookTicker() <-chan time.Time
GetOrderbookTicker returns the order book ticker.
func (*HTTPRunner) GetRateTicker ¶
func (h *HTTPRunner) GetRateTicker() <-chan time.Time
GetRateTicker returns the rate ticker.
func (*HTTPRunner) Start ¶
func (h *HTTPRunner) Start() error
Start initializes and starts the ticker HTTP server. It returns an error if the server is started already. It is guaranteed that the HTTP server is ready to serve request after this method is returned. The HTTP server is listened on all network interfaces.
func (*HTTPRunner) Stop ¶
func (h *HTTPRunner) Stop() error
Stop stops the HTTP server. It returns an error if the server is already stopped.
type Option ¶
type Option func(hr *HTTPRunner)
Option is the option to setup the HTTPRunner on creation.
func WithBindAddr ¶ added in v0.1.2
WithBindAddr setups the HTTPRunner instance with the given bindAddr. Without this option, NewHTTPRunner will use a random bindAddr.
type Server ¶
type Server struct {
// contains filtered or unexported fields
}
Server is the HTTP ticker server.
func NewServer ¶
func NewServer(runner *HTTPRunner, bindAddr string) *Server
NewServer creates a new instance of HttpRunnerServer.