Documentation ¶
Overview ¶
shyost/exchange-driver
This file is part of Shyost.
shyost/exchange-driver is free software: you can redistribute it and/or modify it under the terms of the Apache License, Version 2.0 (the "License").
shyost/models is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the Apache License, Version 2.0 for more details.
You should have received a copy of the Apache License, Version 2.0 along with shyost/exchange-driver. If not, see <https://www.apache.org/licenses/LICENSE-2.0>.
shyost/exchange/driver
This file is part of Shyost.
shyost/exchange/driver is free software: you can redistribute it and/or modify it under the terms of the Apache License, Version 2.0 (the "License").
shyost/models is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the Apache License, Version 2.0 for more details.
You should have received a copy of the Apache License, Version 2.0 along with shyost/exchange/driver. If not, see <https://www.apache.org/licenses/LICENSE-2.0>.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type CandleReader ¶
type CandleReader interface { // Subscribe is used to subscribe to the topic that allows retrieving the // required project data. Subscribe(pair *models.Pair, timeframe models.TimeFrame) (string, error) // Connect is used to connect to the exchange provider. Case somme problem // occur the error should be returned Connect() error // Start is used to start the process of consuming data from the exchange // provider, processing it, and sending it to the provided channel. Start(channel chan DataTransport) }
CandleReader is an interface that defines methods for subscribing to a topic, connecting to an exchange provider, converting time frames, and starting the process of consuming data from the exchange provider and sending it to a channel.
type DataTransport ¶
type DataTransport struct { Candle *models.Candle `json:"candle"` Pair *models.Pair `json:"pair"` TimeFrame *models.TimeFrame `json:"timeframe"` Read time.Time `json:"read"` }
DataTransport represents the data transport structure used for exchanging candle and pair information. It contains the candle data, pair information, timeframe, and the read timestamp.
type TimeFrame ¶
type TimeFrame interface { // ToExchangeFormat converts the bot time frame to the corresponding exchange // time frame format. It takes a `timeframe` of type `models.TimeFrame` as input // and returns a pointer to `models.TimeFrame`. The returned `models.TimeFrame` // represents the equivalent time frame in the exchange format. ToExchangeFormat(timeframe models.TimeFrame) *models.TimeFrame // ToBotFormat converts the exchange time frame string to the corresponding bot // time frame format. It takes a `timeframe` of type `models.TimeFrame` as input // and returns a pointer to `models.TimeFrame`. If the given `timeframe` is not // recognized or cannot be converted, it returns `nil`. The returned // `models.TimeFrame` represents the equivalent time frame in the bot format. ToBotFormat(timeframe models.TimeFrame) *models.TimeFrame }
TimeFrame is an interface that defines methods for converting time frames between the bot and exchange formats.