-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathapp.go
38 lines (30 loc) · 968 Bytes
/
app.go
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
package main
import (
binancehttp "binance-wails/binance-http"
"context"
"fmt"
"github.com/adshao/go-binance/v2"
)
// App struct
type App struct {
ctx context.Context
}
// NewApp creates a new App application struct
func NewApp() *App {
return &App{}
}
// startup is called when the app starts. The context is saved
// so we can call the runtime methods
func (a *App) startup(ctx context.Context) {
a.ctx = ctx
}
// Greet returns a greeting for the given name
func (a *App) Greet(name string) string {
return fmt.Sprintf("Hello %s, It's show time!", name)
}
func (a *App) KlineService(symbol string, interval string, limit int) (res []*binance.Kline, err error) {
return binancehttp.KlinesService(symbol, interval, limit)
}
func (a *App) KlineServiceWithStartAndEnd(symbol string, start, end int64, interval string, limit int) (res []*binance.Kline, err error) {
return binancehttp.KlinesServiceWithStartAndEnd(symbol, start, end, interval, limit)
}