init; project structure & bybit provider
This commit is contained in:
commit
ae096d4820
14 changed files with 482 additions and 0 deletions
28
cmd/app/main.go
Normal file
28
cmd/app/main.go
Normal file
|
|
@ -0,0 +1,28 @@
|
|||
package main
|
||||
|
||||
import (
|
||||
"context"
|
||||
"crypto_alert_bot/internal/config"
|
||||
"crypto_alert_bot/internal/entities"
|
||||
"crypto_alert_bot/internal/logger"
|
||||
"crypto_alert_bot/internal/provider/bybit"
|
||||
"fmt"
|
||||
)
|
||||
|
||||
func main() {
|
||||
// read config
|
||||
cfg := config.MustLoad()
|
||||
// init logger
|
||||
log := logger.NewAppLogger(&cfg.Logger)
|
||||
log.Info("app started")
|
||||
// init telegram bot
|
||||
b := bybit.New(log, &cfg.Providers.Bybit)
|
||||
price, err := b.Price(context.Background(), entities.Pair{
|
||||
BaseCurrency: "BTC",
|
||||
QuoteCurrency: "USDT",
|
||||
})
|
||||
if err != nil {
|
||||
panic(err)
|
||||
}
|
||||
fmt.Printf("%+v\n", price)
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue